PageRenderTime 26ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/ri-clients/jbi-admin-cli/regress/jbi-admin-cli00010.ksh

https://bitbucket.org/rsaqc/openesb-core
Korn Shell | 195 lines | 125 code | 29 blank | 41 comment | 10 complexity | 461e81d808cd0c4d3186281776872c80 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. # @(#)jbi-admin-cli00001.ksh
  25. # Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
  26. #
  27. # END_HEADER - DO NOT EDIT
  28. #
  29. #----------------------------------------------------------------------------------
  30. # Perform any necessary cleanup to restore the repository back to its initial state.
  31. #----------------------------------------------------------------------------------
  32. test_cleanup()
  33. {
  34. cleanup server
  35. }
  36. #----------------------------------------------------------------------------------
  37. # Main function called that will run the test
  38. #----------------------------------------------------------------------------------
  39. run_test()
  40. {
  41. initilize_test
  42. build_test_application_artifacts
  43. #test_cleanup
  44. #--------------------------------------------------------------------------------
  45. # Make sure cli-config-binding componet is installed and started
  46. #--------------------------------------------------------------------------------
  47. install_component server ${JV_SVC_BLD}/regress/dist/cli-config-binding.jar
  48. start_component server cli-config-binding
  49. echo ""
  50. echo "-------------------------------------------------------------------"
  51. echo " List the Application Variables for the cli-config-binding component"
  52. echo "-------------------------------------------------------------------"
  53. echo "list-jbi-application-variables --component=cli-config-binding"
  54. $AS8BASE/bin/asadmin list-jbi-application-variables --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS
  55. echo ""
  56. echo "-------------------------------------------------------------------"
  57. echo " Create the Application Variables for the cli-config-binding component using the command line"
  58. echo "-------------------------------------------------------------------"
  59. echo "create-jbi-application-variable --component=cli-config-binding FirstName=[String]Fred,LastName=Smith,t=[Boolean]true,f=[Boolean]false"
  60. $AS8BASE/bin/asadmin create-jbi-application-variable --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS FirstName=[String]Fred,LastName=Smith,t=[BOOLEAN]true,f=[BOOLEAN]false
  61. echo ""
  62. echo "-------------------------------------------------------------------"
  63. echo " List the Application Variables for the cli-config-binding component"
  64. echo "-------------------------------------------------------------------"
  65. echo "list-jbi-application-variables --component=cli-config-binding"
  66. $AS8BASE/bin/asadmin list-jbi-application-variables --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS
  67. echo ""
  68. echo "-------------------------------------------------------------------"
  69. echo " List again and save the output in the property file appVariables.property"
  70. echo "-------------------------------------------------------------------"
  71. echo "list-jbi-application-variables --terse --component=cli-config-binding"
  72. $AS8BASE/bin/asadmin list-jbi-application-variables --component=cli-config-binding --terse --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS > $JV_SVC_BLD/tmp/appVariables.property
  73. $AS8BASE/bin/asadmin list-jbi-application-variables --component=cli-config-binding --terse --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS
  74. echo ""
  75. echo "-------------------------------------------------------------------"
  76. echo " Try to create the same application variable that was already created ** Should generate and Error **"
  77. echo "-------------------------------------------------------------------"
  78. echo "create-jbi-application-variable --component=cli-config-binding FirstName=[String]Tom"
  79. $AS8BASE/bin/asadmin create-jbi-application-variable --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS FirstName=[String]Tom
  80. echo ""
  81. echo "-------------------------------------------------------------------"
  82. echo " List the Application Variables for the cli-config-binding component"
  83. echo "-------------------------------------------------------------------"
  84. echo "list-jbi-application-variables --component=cli-config-binding"
  85. $AS8BASE/bin/asadmin list-jbi-application-variables --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS
  86. echo ""
  87. echo "-------------------------------------------------------------------"
  88. echo " Update some existing variables from the command line"
  89. echo "-------------------------------------------------------------------"
  90. echo "update-jbi-application-variable --component=cli-config-binding FirstName=[String]Steve,LastName=Jones"
  91. $AS8BASE/bin/asadmin update-jbi-application-variable --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS FirstName=[String]Steve,LastName=Jones
  92. echo ""
  93. echo "-------------------------------------------------------------------"
  94. echo " List the Application Variables for the cli-config-binding component"
  95. echo "-------------------------------------------------------------------"
  96. echo "list-jbi-application-variables --component=cli-config-binding"
  97. $AS8BASE/bin/asadmin list-jbi-application-variables --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS
  98. echo ""
  99. echo "-------------------------------------------------------------------"
  100. echo " Update/restore some existing variables using the saved properties file"
  101. echo "-------------------------------------------------------------------"
  102. echo "update-jbi-application-variable --component=cli-config-binding appVariables.property"
  103. $AS8BASE/bin/asadmin update-jbi-application-variable --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS $JV_SVC_BLD/tmp/appVariables.property
  104. echo ""
  105. echo "-------------------------------------------------------------------"
  106. echo " List the Application Variables for the cli-config-binding component"
  107. echo "-------------------------------------------------------------------"
  108. echo "list-jbi-application-variables --component=cli-config-binding"
  109. $AS8BASE/bin/asadmin list-jbi-application-variables --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS
  110. echo ""
  111. echo "-------------------------------------------------------------------"
  112. echo " Delete the application variables"
  113. echo "-------------------------------------------------------------------"
  114. echo "delete-jbi-application-variable --component=cli-config-binding FirstName,LastName"
  115. $AS8BASE/bin/asadmin delete-jbi-application-variable --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS FirstName,LastName
  116. echo ""
  117. echo "-------------------------------------------------------------------"
  118. echo " List the Application Variables for the cli-config-binding component"
  119. echo "-------------------------------------------------------------------"
  120. echo "list-jbi-application-variables --component=cli-config-binding"
  121. $AS8BASE/bin/asadmin list-jbi-application-variables --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS
  122. echo ""
  123. echo "-------------------------------------------------------------------"
  124. echo " Create the Application Variables using a property file"
  125. echo "-------------------------------------------------------------------"
  126. echo "create-jbi-application-variable --component=cli-config-binding appVariables.property"
  127. $AS8BASE/bin/asadmin create-jbi-application-variable --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS $JV_SVC_BLD/tmp/appVariables.property
  128. echo ""
  129. echo "-------------------------------------------------------------------"
  130. echo " List the Application Variables for the cli-config-binding component"
  131. echo "-------------------------------------------------------------------"
  132. echo "list-jbi-application-variables --component=cli-config-binding"
  133. $AS8BASE/bin/asadmin list-jbi-application-variables --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS
  134. echo ""
  135. echo "-------------------------------------------------------------------"
  136. echo " Create an application variable that contains an embedded common and colon"
  137. echo "-------------------------------------------------------------------"
  138. echo "create-jbi-application-variable --component=cli-config-binding URL=http\://www.youraretheman.com,AMOUNT=$1\,000"
  139. $AS8BASE/bin/asadmin create-jbi-application-variable --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS "URL=http\://www.youraretheman.com,AMOUNT=1\,000"
  140. echo ""
  141. echo "-------------------------------------------------------------------"
  142. echo " List the Application Variables for the cli-config-binding component"
  143. echo "-------------------------------------------------------------------"
  144. echo "list-jbi-application-variables --component=cli-config-binding"
  145. $AS8BASE/bin/asadmin list-jbi-application-variables --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS
  146. echo ""
  147. echo "-------------------------------------------------------------------"
  148. echo " Delete the application variables"
  149. echo "-------------------------------------------------------------------"
  150. echo "delete-jbi-application-variable --component=cli-config-binding URL,AMOUNT"
  151. $AS8BASE/bin/asadmin delete-jbi-application-variable --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS URL,AMOUNT,FirstName,LastName,f,t
  152. echo ""
  153. echo "-------------------------------------------------------------------"
  154. echo " List the Application Variables for the cli-config-binding component"
  155. echo "-------------------------------------------------------------------"
  156. echo "list-jbi-application-variables --component=cli-config-binding"
  157. $AS8BASE/bin/asadmin list-jbi-application-variables --component=cli-config-binding --port $ADMIN_PORT --user $ADMIN_USER $ASADMIN_PW_OPTS
  158. }
  159. #----------------------------------------------------------------------------------
  160. # Perform the regression setup and call the function that will run the test
  161. #----------------------------------------------------------------------------------
  162. TEST_NAME="jbi-admin-cli00010"
  163. TEST_DESCRIPTION="Test Application Variable Commands"
  164. . ./regress_defs.ksh
  165. run_test
  166. exit 0