Repository: activemq
Updated Branches:
  refs/heads/activemq-5.15.x 9683ae3f5 -> 929483906


AMQ-6930 add test case

(cherry picked from commit 6bb56decf881328f5595692ca17c1899f7f86a7b)


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/92948390
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/92948390
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/92948390

Branch: refs/heads/activemq-5.15.x
Commit: 929483906bd4838ede4ab7f8e07758fc52d2cfce
Parents: 9683ae3
Author: Alvin Lin <alvin...@amazon.com>
Authored: Mon Apr 9 19:04:55 2018 -0700
Committer: Jeff Genender <jgenen...@savoirtech.com>
Committed: Tue Apr 10 16:26:09 2018 -0600

----------------------------------------------------------------------
 assembly/src/test/scripts/init-script-testsuite | 36 +++++++++++++-------
 1 file changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/92948390/assembly/src/test/scripts/init-script-testsuite
----------------------------------------------------------------------
diff --git a/assembly/src/test/scripts/init-script-testsuite 
b/assembly/src/test/scripts/init-script-testsuite
index 9b7bafc..81ee22f 100755
--- a/assembly/src/test/scripts/init-script-testsuite
+++ b/assembly/src/test/scripts/init-script-testsuite
@@ -19,7 +19,7 @@
 # This script tests the activemq init script
 #
 # Authors:
-# Marc Schoechlin <m...@256bit.org>  
+# Marc Schoechlin <m...@256bit.org>
 
 STATUS_OVERVIEW=""
 OVERALL_STATUS="0"
@@ -97,7 +97,7 @@ echo "Setting HOME to $TESTDIR"
 export HOME="$TESTDIR"
 
 case "`uname`" in
-  CYGWIN*) 
+  CYGWIN*)
     echo "Set init script"
     SCRIPT="$PWD/activemq"
     CONFIG="$HOME/.activemqrc"
@@ -124,17 +124,17 @@ sleep 2
 assert ${STRATEGY} successful "${SCRIPT} stop"
 assert ${STRATEGY}     failed "${SCRIPT}"
 assert ${STRATEGY}     failed "${SCRIPT} status"
-assert ${STRATEGY} successful "${SCRIPT} browse|grep -q 'Activemq is not 
running.'"
-assert ${STRATEGY} successful "${SCRIPT} browse FOOBAR111111111 2>&1|grep -q 
'Activemq is not running.'"
-assert ${STRATEGY} successful "${SCRIPT} browse --amqurl tcp://localhost:11111 
FOOOOO 2>&1|grep -q 'java.net.ConnectException'"
+assert ${STRATEGY} successful "${SCRIPT} browse|grep -q 'No JMS destination 
specified.'"
+assert ${STRATEGY} successful "${SCRIPT} browse FOOBAR111111111 2>&1|grep -q 
'Broker not available at:'"
+assert ${STRATEGY} successful "${SCRIPT} browse --amqurl tcp://localhost:11111 
FOOOOO 2>&1|grep -q 'Broker not available at:'"
 assert ${STRATEGY} successful "${SCRIPT} encrypt --password TESTPASSWORD 
--input FOOBAR|grep -q 'Encrypted text: '"
 assert ${STRATEGY} successful "${SCRIPT} decrypt --input 
'BkiT42A0CZfL1SanJIgxvQ==' --password asdasdasdasd|grep -q 'Decrypted text:'"
-assert ${STRATEGY} successful "${SCRIPT} bstat 2>&1|grep -q 'Activemq is not 
running.'"
-assert ${STRATEGY} successful "${SCRIPT} bstat --jmxurl 
service:jmx:rmi:///jndi/rmi://127.0.0.1:11098/jmxrmi --jmxuser controlRole 
--jmxpassword abcd1234 2>&1|grep -q 'java.net.ConnectException'"
-assert ${STRATEGY} successful "${SCRIPT} dstat 2>&1|grep -q 'Activemq is not 
running.'"
-assert ${STRATEGY} successful "${SCRIPT} dstat --jmxurl 
service:jmx:rmi:///jndi/rmi://127.0.0.1:11098/jmxrmi --jmxuser controlRole 
--jmxpassword abcd1234 2>&1|grep -q 'java.net.ConnectException'"
-assert ${STRATEGY} successful "${SCRIPT} query 2>&1|grep -q 'Activemq is not 
running.'"
-assert ${STRATEGY} successful "${SCRIPT} query --jmxurl 
service:jmx:rmi:///jndi/rmi://127.0.0.1:11098/jmxrmi --jmxuser controlRole 
--jmxpassword abcd1234 2>&1|grep -q 'java.net.ConnectException'"
+assert ${STRATEGY} successful "${SCRIPT} bstat 2>&1|grep -q 'Broker not 
available at:'"
+assert ${STRATEGY} successful "${SCRIPT} bstat --jmxurl 
service:jmx:rmi:///jndi/rmi://127.0.0.1:11098/jmxrmi --jmxuser controlRole 
--jmxpassword abcd1234 2>&1|grep -q 'Broker not available at:'"
+assert ${STRATEGY} successful "${SCRIPT} dstat 2>&1|grep -q 'Broker not 
available at:'"
+assert ${STRATEGY} successful "${SCRIPT} dstat --jmxurl 
service:jmx:rmi:///jndi/rmi://127.0.0.1:11098/jmxrmi --jmxuser controlRole 
--jmxpassword abcd1234 2>&1|grep -q 'Broker not available at:'"
+assert ${STRATEGY} successful "${SCRIPT} query 2>&1|grep -q 'Broker not 
available at:'"
+assert ${STRATEGY} successful "${SCRIPT} query --jmxurl 
service:jmx:rmi:///jndi/rmi://127.0.0.1:11098/jmxrmi --jmxuser controlRole 
--jmxpassword abcd1234 2>&1|grep -q 'Broker not available at:'"
 assert ${STRATEGY} successful "${SCRIPT} restart"
 assert ${STRATEGY} successful "${SCRIPT} stop"
 
@@ -170,8 +170,18 @@ assert ${STRATEGY} successful "${SCRIPT} query|grep 
brokerName"
 # assert ${STRATEGY} successful "${SCRIPT} create"
 # assert ${STRATEGY} successful "${SCRIPT} export"
 
-echo 
-echo 
+#ActiveMQ start with custom ACTIVEMQ_OUT
+TEST_ACTIVEMQ_OUT=$TESTDIR/activemq.out
+export ACTIVEMQ_OUT=$TEST_ACTIVEMQ_OUT
+assert ${STRATEGY} successful "${SCRIPT} restart && test -f $TEST_ACTIVEMQ_OUT"
+assert ${STRATEGY} successful "${SCRIPT} stop"
+rm $TEST_ACTIVEMQ_OUT
+unset ACTIVEMQ_OUT
+assert ${STRATEGY} successful "${SCRIPT} restart && test ! -f 
$TEST_ACTIVEMQ_OUT"
+assert ${STRATEGY} successful "${SCRIPT} stop"
+
+echo
+echo
 
 trap "" INT TERM
 finalize

Reply via email to