PageRenderTime 36ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/runtime/websphere_framework/regress/framework00006.ksh

https://bitbucket.org/openesb/openesb-core
Korn Shell | 135 lines | 60 code | 20 blank | 55 comment | 4 complexity | 4bf2d2b40b1d2efe39e07351e760ae6f 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. # @(#)framework00006.ksh
  25. # Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
  26. #
  27. # END_HEADER - DO NOT EDIT
  28. #
  29. # This test covers component and service unit startup logic in the JBI framework.
  30. # Two components, test-fast-binding and test-slow-engine, are installed and
  31. # and started. Two apps (one with a service connection and one without) are
  32. # deployed to the components and started. The test then bounces the server and
  33. # queries the state of the components and service assemblies. The SUs deployed
  34. # to test-fast-binding will fail in start() if corresponding endpoints have not
  35. # been activated during service unit init() in SlowEngine. SlowEngine contains
  36. # a sleep timer which should expose race conditions between init() and start()
  37. # timing across components.
  38. #regress setup
  39. my_test_domain=domain1
  40. . ./regress_defs.ksh
  41. # package components
  42. ant -emacs -q -f framework00006.xml package
  43. # start our test domain
  44. start_domain
  45. status=$?
  46. if [ $status -ne 0 ]; then
  47. bldmsg -status $status -p $0 -error "cannot start domain $mytestdomain"
  48. exit 1
  49. fi
  50. # install components
  51. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.install.file=$JV_FRAMEWORK_BLD_DIR/dist/slow-engine.jar install-component
  52. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.install.file=$JV_FRAMEWORK_BLD_DIR/dist/fast-binding.jar install-component
  53. installComponentDelay
  54. # start components
  55. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.component.name="test-slow-engine" start-component
  56. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.component.name="test-fast-binding" start-component
  57. startComponentDelay
  58. # deploy service assemblies
  59. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.deploy.file=$JV_FRAMEWORK_BLD_DIR/dist/restart-sa-1.jar deploy-service-assembly
  60. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.deploy.file=$JV_FRAMEWORK_BLD_DIR/dist/restart-sa-2.jar deploy-service-assembly
  61. deploySaDelay
  62. # start service assemblies
  63. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.service.assembly.name="restart-sa-1" start-service-assembly
  64. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.service.assembly.name="restart-sa-2" start-service-assembly
  65. startSaDelay
  66. # Query the state of our components and service assemblies before restart
  67. $JBI_ANT -Djbi.binding.component.name="test-fast-binding" list-binding-components
  68. $JBI_ANT -Djbi.service.engine.name="test-slow-engine" list-service-engines
  69. $JBI_ANT -Djbi.service.assembly.name="restart-sa-1" list-service-assemblies
  70. $JBI_ANT -Djbi.service.assembly.name="restart-sa-2" list-service-assemblies
  71. #shutdown the test domain
  72. shutdown_domain
  73. status=$?
  74. if [ $status -ne 0 ]; then
  75. bldmsg -status $status -p $0 -error "cannot shutdown domain $mytestdomain to restart"
  76. exit 1
  77. fi
  78. #restart the test domain
  79. start_domain
  80. status=$?
  81. if [ $status -ne 0 ]; then
  82. bldmsg -status $status -p $0 -error "cannot restart domain $mytestdomain"
  83. exit 1
  84. fi
  85. # wait a bit longer for autostart processing to complete
  86. syncInstanceDelay
  87. # Query the state of our components and service assemblies after restart
  88. $JBI_ANT -Djbi.binding.component.name="test-fast-binding" list-binding-components
  89. $JBI_ANT -Djbi.service.engine.name="test-slow-engine" list-service-engines
  90. $JBI_ANT -Djbi.service.assembly.name="restart-sa-1" list-service-assemblies
  91. $JBI_ANT -Djbi.service.assembly.name="restart-sa-2" list-service-assemblies
  92. # shut down service assemblies
  93. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.service.assembly.name="restart-sa-1" shut-down-service-assembly
  94. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.service.assembly.name="restart-sa-2" shut-down-service-assembly
  95. stopSaDelay
  96. # undeploy service assemblies
  97. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.service.assembly.name="restart-sa-1" undeploy-service-assembly
  98. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.service.assembly.name="restart-sa-2" undeploy-service-assembly
  99. undeploySaDelay
  100. # shutdown components
  101. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.component.name="test-slow-engine" shut-down-component
  102. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.component.name="test-fast-binding" shut-down-component
  103. stopComponentDelay
  104. # uninstall components
  105. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.component.name="test-slow-engine" uninstall-component
  106. $JBI_ANT -Djbi.task.fail.on.error=false -Djbi.component.name="test-fast-binding" uninstall-component
  107. uninstallComponentDelay
  108. #shutdown the test domain
  109. shutdown_domain
  110. status=$?
  111. if [ $status -ne 0 ]; then
  112. bldmsg -status $status -p $0 -error "cannot shutdown domain $mytestdomain"
  113. exit 1
  114. fi
  115. # ### END