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

/esb-test/sample-tests/regress/sample00001.ksh

https://bitbucket.org/openesb/openesb-core
Korn Shell | 143 lines | 44 code | 28 blank | 71 comment | 0 complexity | e9d60d2f0fff54b92980be976fb0fd66 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. # @(#)sample00001.ksh
  25. # Copyright 2004-2008 Sun Microsystems, Inc. All Rights Reserved.
  26. #
  27. # END_HEADER - DO NOT EDIT
  28. #
  29. #
  30. # This test installs and runs the JBI component examples that are posted on
  31. # the open-esb web site:
  32. # https://open-esb.dev.java.net/public/jbi-comp-examples/Developing_JBI_Components.html
  33. # This is required to ensure that any changes to the JBI runtime that affect
  34. # the examples are caught in time to update the examples on the web site so
  35. # that users will be able to run the examples.
  36. # The source for the examples is in the ri-examples/jbi-comp directory. The
  37. # build script for the examples produces the jbi-comp-examples.zip file that
  38. # is picked up in this test.
  39. #
  40. # @author mwhite
  41. #
  42. echo testname is sample00001
  43. #
  44. # Initial setup
  45. #
  46. . ./regress_defs.ksh
  47. my_test_domain=JBITest
  48. . $SRCROOT/antbld/regress/common_defs.ksh
  49. export SAMPLE_HOME
  50. SAMPLE_HOME=$JV_SVC_BLD/jbi-comp-examples
  51. rm -f $JV_SVC_BLD/sample00001.log 1>&2
  52. #
  53. # Unzip the example file into the test work directory
  54. #
  55. rm -rf $SAMPLE_HOME 1>&2
  56. SAVE_PWD=`pwd`
  57. cp jbi-comp-examples.zip $JV_SVC_BLD 1>&2
  58. cd $JV_SVC_BLD
  59. jar -xf jbi-comp-examples.zip 1>&2
  60. rm -f $JV_SVC_BLD/jbi-comp-example.zip 1&2
  61. cd $SAVE_PWD
  62. #
  63. # Set the GlassFish install root and admin settings in the build.properties
  64. # files for both examples (MyEngine and MyBinding)
  65. #
  66. echo "s#glassfish.home=.*#glassfish.home=$JV_AS8BASE#g" > $JV_SVC_BLD/buildproperties.sed
  67. echo "s#jbi.port=.*#jbi.port=$ASADMIN_PORT#g" >> $JV_SVC_BLD/buildproperties.sed
  68. sed -f $JV_SVC_BLD/buildproperties.sed $SAMPLE_HOME/MyEngine/build.properties > MyEngine.properties
  69. mv MyEngine.properties $SAMPLE_HOME/MyEngine/build.properties
  70. sed -f $JV_SVC_BLD/buildproperties.sed $SAMPLE_HOME/MyBinding/build.properties > MyBinding.properties
  71. mv MyBinding.properties $SAMPLE_HOME/MyBinding/build.properties
  72. #
  73. # Set the GlassFish JMX RMI provider URL in the test.properties for the
  74. # MyBinding example
  75. #
  76. echo "s#jmx.binding.inbound.endpoint.address.url=.*#jmx.binding.inbound.endpoint.address.url=$AS_JMX_REMOTE_URL#g" > $JV_SVC_BLD/testproperties.sed
  77. sed -f $JV_SVC_BLD/testproperties.sed $SAMPLE_HOME/MyBinding/test/java/bindingtest/test.properties > bindingtest.properties
  78. mv bindingtest.properties $SAMPLE_HOME/MyBinding/test/java/bindingtest/test.properties
  79. #
  80. # Start the HTTP BC for the test
  81. #
  82. $JBI_ANT -Djbi.component.name=sun-http-binding start-component > $JV_SVC_BLD/sun-http-binding-start.log
  83. #
  84. # Create the artifacts, install/deploy them, and run the MyEngine test, then
  85. # do the same for the MyBinding test
  86. #
  87. cd $SAMPLE_HOME/MyEngine
  88. $ANT_HOME/bin/ant package > $JV_SVC_BLD/MyEngine.package.log
  89. $ANT_HOME/bin/ant install > $JV_SVC_BLD/MyEngine.install.log
  90. $ANT_HOME/bin/ant test > $JV_SVC_BLD/MyEngine.test.log
  91. cd $SAMPLE_HOME/MyBinding
  92. $ANT_HOME/bin/ant package > $JV_SVC_BLD/MyBinding.package.log
  93. $ANT_HOME/bin/ant install > $JV_SVC_BLD/MyBinding.install.log
  94. $ANT_HOME/bin/ant test > $JV_SVC_BLD/MyBinding.test.log
  95. #
  96. # Shut down and uninstall the test components
  97. #
  98. cd $SAMPLE_HOME/MyBinding
  99. $ANT_HOME/bin/ant uninstall > $JV_SVC_BLD/MyBinding.uninstall.log
  100. cd $SAMPLE_HOME/MyEngine
  101. $ANT_HOME/bin/ant uninstall > $JV_SVC_BLD/MyEngine.uninstall.log
  102. #
  103. # Shut down the HTTP BC
  104. #
  105. $JBI_ANT -Djbi.component.name=sun-http-binding shut-down-component > $JV_SVC_BLD/sun-http-binding-shutdown.log
  106. #
  107. # Check for success of both tests
  108. #
  109. echo "Checking MyEngine test result"
  110. echo " "
  111. grep "EchoResult: from httpsoap binding - hello new service engine!!!" $JV_SVC_BLD/MyEngine.test.log 2>&1
  112. echo " "
  113. echo "Checking MyBinding test result"
  114. echo " "
  115. grep "EchoResult: from jmx binding component - hello service engine!!!" $JV_SVC_BLD/MyBinding.test.log 2>&1