PageRenderTime 137ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://bitbucket.org/rsaqc/openesb-core
Korn Shell | 123 lines | 53 code | 24 blank | 46 comment | 2 complexity | 32adcd6b3dbaa17662be31d921979ffa 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 "jbiadmin01604 : Negative tests for application variable 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_VAR_FILE=$JV_SVC_REGRESS/deploytest/new-app-var.properties
  36. UPDATED_APP_VAR_FILE=$JV_SVC_REGRESS/deploytest/updated-app-var.properties
  37. INCORRECT_APP_VAR_FILE=$JV_SVC_REGRESS/deploytest/non-existant-app-var.properties
  38. JBI_ANT_CMD="$JBI_ANT_NEG -Djbi.component.name=$COMPONENT_NAME -Djbi.target=$TARGET"
  39. # Test : Test the application configuration operations for a component which is not installed - should get back an error.
  40. $JBI_ANT_CMD list-application-variables
  41. $JBI_ANT_CMD -Djbi.app.variables.file=$NEW_APP_VAR_FILE create-application-variable
  42. $JBI_ANT_CMD -Djbi.app.variables.file=$UPDATED_APP_VAR_FILE update-application-variable
  43. $JBI_ANT_CMD -Djbi.app.variable.name=securityCredentials delete-application-variable
  44. # Setup
  45. $JBI_ANT_NEG -Djbi.install.file=$COMPONENT_ARCHIVE -Djbi.target="server" install-component
  46. # Test : Test the application configuration for a component which is not started - should get back an error.
  47. $JBI_ANT_CMD list-application-variables
  48. $JBI_ANT_CMD -Djbi.app.variables.file=$NEW_APP_VAR_FILE create-application-variable
  49. $JBI_ANT_CMD -Djbi.app.variables.file=$UPDATED_APP_VAR_FILE update-application-variable
  50. $JBI_ANT_CMD -Djbi.app.variable.name=securityCredentials delete-application-variable
  51. # Start the component
  52. $JBI_ANT_CMD start-component
  53. # Test adding a duplicate application configuration
  54. $JBI_ANT_CMD -Djbi.app.variables.file=$NEW_APP_VAR_FILE create-application-variable
  55. $JBI_ANT_CMD list-application-variables
  56. $JBI_ANT_CMD -Djbi.app.variables.file=$NEW_APP_VAR_FILE create-application-variable
  57. $JBI_ANT_CMD list-application-variables
  58. $JBI_ANT_CMD -Djbi.app.variable.name=securityCredentials delete-application-variable
  59. $JBI_ANT_CMD -Djbi.app.variable.name=securityPrincipal delete-application-variable
  60. $JBI_ANT_CMD -Djbi.app.variable.name=port delete-application-variable
  61. # Test setting a non-existing application configuration
  62. $JBI_ANT_CMD list-application-variables
  63. $JBI_ANT_CMD -Djbi.app.variables.file=$INCORRECT_APP_VAR_FILE update-application-variable
  64. # Test deleting a non-existing application configuration
  65. $JBI_ANT_CMD -Djbi.app.variable.name=xyz delete-application-variable
  66. # Test adding a application variable with type=password
  67. asadmin create-jbi-application-variable -u $AS_ADMIN_USER $ASADMIN_PW_OPTS --port $ASADMIN_PORT --component $COMPONENT_NAME myPassword=[password]secret
  68. $JBI_ANT_CMD list-application-variables
  69. asadmin delete-jbi-application-variable -u $AS_ADMIN_USER $ASADMIN_PW_OPTS --port $ASADMIN_PORT --component $COMPONENT_NAME myPassword
  70. # Test adding a application variable with the type not specified / empty ( test fix for issue 148 )
  71. $JBI_ANT_CMD -Djbi.app.variable.name=FirstName -Djbi.app.variable.value=John create-application-variable
  72. $JBI_ANT_CMD list-application-variables
  73. $JBI_ANT_CMD -Djbi.app.variable.name=FirstName -Djbi.app.variable.value=1 -Djbi.app.variable.type=NUMBER update-application-variable
  74. $JBI_ANT_CMD list-application-variables
  75. $JBI_ANT_CMD -Djbi.app.variable.name=LastName -Djbi.app.variable.value=Doe -Djbi.app.variable.type=String create-application-variable
  76. $JBI_ANT_CMD list-application-variables
  77. #asadmin create-jbi-application-variable -u $AS_ADMIN_USER $ASADMIN_PW_OPTS --port $ASADMIN_PORT --component $COMPONENT_NAME FirstName=[]Jane
  78. #$JBI_ANT_CMD list-application-variables
  79. # Test upating a non String application variable where type is not specified
  80. $JBI_ANT_CMD -Djbi.app.variable.name=Numeric -Djbi.app.variable.value=1 -Djbi.app.variable.type=NUMBER create-application-variable
  81. $JBI_ANT_CMD list-application-variables
  82. $JBI_ANT_CMD -Djbi.app.variable.name=Numeric -Djbi.app.variable.value=5 update-application-variable
  83. $JBI_ANT_CMD list-application-variables
  84. # Test creating/updating a BOOLEAN application variable with a non-boolean value
  85. $JBI_ANT_CMD -Djbi.app.variable.name=Employed -Djbi.app.variable.value=xxx -Djbi.app.variable.type=BOOLEAN create-application-variable
  86. $JBI_ANT_CMD -Djbi.app.variable.name=Employed -Djbi.app.variable.value=true -Djbi.app.variable.type=BOOLEAN create-application-variable
  87. $JBI_ANT_CMD -Djbi.app.variable.name=Employed -Djbi.app.variable.value=yyy update-application-variable
  88. # Test creating/updating a NUMBER application variable with a non-numeric value
  89. # create
  90. $JBI_ANT_CMD -Djbi.app.variable.name=Count -Djbi.app.variable.value=One -Djbi.app.variable.type=NUMBER create-application-variable
  91. # update
  92. $JBI_ANT_CMD -Djbi.app.variable.name=Count -Djbi.app.variable.value=1 -Djbi.app.variable.type=NUMBER create-application-variable
  93. $JBI_ANT_CMD -Djbi.app.variable.name=Count -Djbi.app.variable.value=five update-application-variable
  94. # Test creating/updating a NUMBER application variable with a valid-numeric value
  95. $JBI_ANT_CMD -Djbi.app.variable.name=Count -Djbi.app.variable.value=-99 update-application-variable
  96. $JBI_ANT_CMD -Djbi.app.variable.name=Count -Djbi.app.variable.value=99.9 update-application-variable
  97. # Cleanup
  98. $JBI_ANT_CMD shut-down-component
  99. $JBI_ANT_CMD uninstall-component