activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From artnas...@apache.org
Subject [2/2] activemq git commit: AMQ-6930 add test case
Date Tue, 10 Apr 2018 19:49:01 GMT
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/246899bb
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/246899bb
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/246899bb

Branch: refs/heads/master
Commit: 246899bb268345bd1b6c7aab484ebb28005bf6b0
Parents: 73d90b1
Author: Alvin Lin <alvinlin@amazon.com>
Authored: Mon Apr 9 19:04:55 2018 -0700
Committer: artnaseef <artnaseef@apache.org>
Committed: Tue Apr 10 12:13:36 2018 -0700

----------------------------------------------------------------------
 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/246899bb/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 <ms@256bit.org>  
+# Marc Schoechlin <ms@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


Mime
View raw message