PageRenderTime 39ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/runtime/esb-manage/regress/jbiadmin01602.ksh

https://bitbucket.org/rsaqc/openesb-core
Korn Shell | 99 lines | 39 code | 20 blank | 40 comment | 2 complexity | 41e62e38dc260cc01558b4aa519d19c3 MD5 | raw file
  1. #!/bin/sh
  2. #
  3. # BEGIN_HEADER - DO NOT EDIT
  4. #
  5. # The contents of this file are subject to the terms
  6. # of the Common Development and Distribution License
  7. # (the "License"). You may not use this file except
  8. # in compliance with the License.
  9. #
  10. # You can obtain a copy of the license at
  11. # https://open-esb.dev.java.net/public/CDDLv1.0.html.
  12. # See the License for the specific language governing
  13. # permissions and limitations under the License.
  14. #
  15. # When distributing Covered Code, include this CDDL
  16. # HEADER in each file and include the License file at
  17. # https://open-esb.dev.java.net/public/CDDLv1.0.html.
  18. # If applicable add the following below this CDDL HEADER,
  19. # with the fields enclosed by brackets "[]" replaced with
  20. # your own identifying information: Portions Copyright
  21. # [year] [name of copyright owner]
  22. #
  23. #
  24. # @(#)jbiadmin01602.ksh
  25. # Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
  26. #
  27. # END_HEADER - DO NOT EDIT
  28. #
  29. echo "jbiadmin01602 : Negative tests for application configuration operations for target=server"
  30. . ./regress_defs.ksh
  31. ant -q -emacs -DESBMEMBER_ADMIN_PORT="$JBI_ADMIN_PORT" -lib "$REGRESS_CLASSPATH" -f jbiadmin01600.xml pkg.test.component
  32. TARGET=server
  33. COMPONENT_ARCHIVE=$JV_SVC_TEST_CLASSES/dist/component-with-custom-mbean.jar
  34. COMPONENT_NAME=manage-binding-1
  35. NEW_APP_CONFIG_FILE=$JV_SVC_REGRESS/deploytest/new-app-config.properties
  36. NEW_APP_CONFIG_EXTRA_FILE=$JV_SVC_REGRESS/deploytest/new-app-config-extra.properties
  37. INCORRECT_NEW_APP_CONFIG_FILE=$JV_SVC_REGRESS/deploytest/incorrect-new-app-config.properties
  38. UPDATED_APP_CONFIG_FILE=$JV_SVC_REGRESS/deploytest/updated-app-config.properties
  39. PARTIALLY_UPDATED_APP_CONFIG_FILE=$JV_SVC_REGRESS/deploytest/partially-updated-app-config.properties
  40. INCORRECT_APP_CONFIG_FILE=$JV_SVC_REGRESS/deploytest/non-existant-app-config.properties
  41. JBI_ANT_CMD="$JBI_ANT_NEG -Djbi.component.name=$COMPONENT_NAME -Djbi.target=$TARGET"
  42. # Test : Test the application configuration operations for a component which is not installed - should get back an error.
  43. $JBI_ANT_CMD list-application-configurations
  44. $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$NEW_APP_CONFIG_FILE create-application-configuration
  45. $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$UPDATED_APP_CONFIG_FILE update-application-configuration
  46. $JBI_ANT_CMD -Djbi.app.config.name=testConfig delete-application-configuration
  47. # Setup
  48. $JBI_ANT_NEG -Djbi.install.file=$COMPONENT_ARCHIVE -Djbi.target="server" install-component
  49. # Test : Test the application configuration for a component which is not started - should get back an error.
  50. $JBI_ANT_CMD list-application-configurations
  51. $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$NEW_APP_CONFIG_FILE create-application-configuration
  52. $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$UPDATED_APP_CONFIG_FILE update-application-configuration
  53. $JBI_ANT_CMD -Djbi.app.config.name=testConfig delete-application-configuration
  54. # Start the component
  55. $JBI_ANT_CMD start-component
  56. # Test adding a duplicate application configuration
  57. $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$NEW_APP_CONFIG_FILE create-application-configuration
  58. $JBI_ANT_CMD list-application-configurations
  59. $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$NEW_APP_CONFIG_FILE create-application-configuration
  60. $JBI_ANT_CMD -Djbi.app.config.name=testConfig delete-application-configuration
  61. # Test setting a non-existing application configuration
  62. $JBI_ANT_CMD -Djbi.app.config.name=someConfig -Djbi.app.config.params.file=$INCORRECT_APP_CONFIG_FILE update-application-configuration
  63. # Test deleting a non-existing application configuration
  64. $JBI_ANT_CMD -Djbi.app.config.name=aConfig delete-application-configuration
  65. # Test adding a application configuration with extra invalid fields should fail. ( fix for issue # 193)
  66. $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$NEW_APP_CONFIG_EXTRA_FILE create-application-configuration
  67. # Test adding a application configuration with not all fields present ( fix for issue # 149 )
  68. $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$INCORRECT_NEW_APP_CONFIG_FILE create-application-configuration
  69. $JBI_ANT_CMD list-application-configurations
  70. # Test updating a application configuration with only a subset of the fields updated
  71. $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$NEW_APP_CONFIG_FILE create-application-configuration
  72. $JBI_ANT_CMD list-application-configurations
  73. $JBI_ANT_CMD -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$PARTIALLY_UPDATED_APP_CONFIG_FILE update-application-configuration
  74. $JBI_ANT_CMD list-application-configurations
  75. # Test fix for Issue 277 : List an application configuration which does not exist
  76. asadmin show-jbi-application-configuration --component=$COMPONENT_NAME -u $AS_ADMIN_USER $ASADMIN_PW_OPTS --port $ASADMIN_PORT fred
  77. # Cleanup
  78. $JBI_ANT_CMD shut-down-component
  79. $JBI_ANT_CMD uninstall-component