qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject svn commit: r1477979 - in /qpid/trunk/qpid/cpp/src/tests: CMakeLists.txt queue_flow_limit_tests.py run_queue_flow_limit_tests
Date Wed, 01 May 2013 13:07:23 GMT
Author: kgiusti
Date: Wed May  1 13:07:22 2013
New Revision: 1477979

URL: http://svn.apache.org/r1477979
Log:
QPID-4790: replace old client queue.delete api with QMF call

Modified:
    qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt
    qpid/trunk/qpid/cpp/src/tests/queue_flow_limit_tests.py
    qpid/trunk/qpid/cpp/src/tests/run_queue_flow_limit_tests

Modified: qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt?rev=1477979&r1=1477978&r2=1477979&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/tests/CMakeLists.txt Wed May  1 13:07:22 2013
@@ -340,6 +340,7 @@ if (PYTHON_EXECUTABLE)
   add_test (ipv6_test ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/ipv6_test${test_script_suffix})
   add_test (federation_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_federation_tests${test_script_suffix})
   add_test (federation_sys_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_federation_sys_tests${test_script_suffix})
+  add_test (queue_flow_limit_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_queue_flow_limit_tests${test_script_suffix})
 if (BUILD_ACL)
   add_test (acl_tests ${shell} ${CMAKE_CURRENT_SOURCE_DIR}/run_acl_tests${test_script_suffix})
 endif (BUILD_ACL)

Modified: qpid/trunk/qpid/cpp/src/tests/queue_flow_limit_tests.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/queue_flow_limit_tests.py?rev=1477979&r1=1477978&r2=1477979&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/queue_flow_limit_tests.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/queue_flow_limit_tests.py Wed May  1 13:07:22 2013
@@ -7,9 +7,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -20,10 +20,8 @@
 
 import sys
 from qpid.testlib import TestBase010
-from qpid import datatypes, messaging
-from qpid.messaging import Message, Empty
-from threading import Thread, Lock
-from logging import getLogger
+from qpid.messaging import Connection
+from threading import Thread
 from time import sleep, time
 from os import environ, popen
 
@@ -56,8 +54,9 @@ class QueueFlowLimitTests(TestBase010):
         if (max_count is not None):
             args["qpid.max_count"] = max_count;
 
-
-        self.session.queue_declare(queue=name, arguments=args)
+        broker = self.qmf.getObjects(_class="broker")[0]
+        rc = broker.create( "queue", name, args, True )
+        self.assertEqual(rc.status, 0, rc)
 
         qs = self.qmf.getObjects(_class="queue")
         for i in qs:
@@ -84,7 +83,9 @@ class QueueFlowLimitTests(TestBase010):
     def _delete_queue(self, name):
         """ Delete a named queue
         """
-        self.session.queue_delete(queue=name)
+        broker = self.qmf.getObjects(_class="broker")[0]
+        rc = broker.delete( "queue", name, {} )
+        self.assertEqual(rc.status, 0, rc)
 
 
     def _start_qpid_send(self, queue, count, content="X", capacity=100):
@@ -287,6 +288,7 @@ class QueueFlowLimitTests(TestBase010):
                 self.sendCount = 1000
                 self.consumeCount = 301 # (send - resume) + 1 to reenable flow
                 self.content = "X"
+                self.mgmt = None
             def verifyStopped(self):
                 self.mgmt.update()
                 return self.mgmt.flowStopped and (self.mgmt.msgDepth > 800)
@@ -313,6 +315,7 @@ class QueueFlowLimitTests(TestBase010):
                 self.sendCount = 2000
                 self.consumeCount = 601 # (send - resume) + 1 to reenable flow
                 self.content = "XXXXX"  # 5 bytes per message sent.
+                self.mgmt = None
             def verifyStopped(self):
                 self.mgmt.update()
                 return self.mgmt.flowStopped and (self.mgmt.byteDepth > 8000)

Modified: qpid/trunk/qpid/cpp/src/tests/run_queue_flow_limit_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_queue_flow_limit_tests?rev=1477979&r1=1477978&r2=1477979&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_queue_flow_limit_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_queue_flow_limit_tests Wed May  1 13:07:22 2013
@@ -24,8 +24,7 @@
 source ./test_env.sh
 test -d $PYTHON_DIR || { echo "Skipping queue flow control tests, no python dir."; exit 0;
}
 
-LOG_FILE=queue_flow_limit_test.log
-PORT=""
+LOG_FILE=qpidd.log
 
 trap stop_broker INT TERM QUIT
 
@@ -34,22 +33,17 @@ error() {
     exit 1;
 }
 
-start_broker() {
-    # Note: if you change the DEFAULT_THRESHOLDS, you will need to update queue_flow_limit_tests.py
-    DEFAULT_THRESHOLDS="--default-flow-stop-threshold=80 --default-flow-resume-threshold=70"
-    rm -rf $LOG_FILE
-    PORT=$($QPIDD_EXEC $DEFAULT_THRESHOLDS --auth=no --no-module-dir --daemon --port=0 -t
--log-to-file $LOG_FILE) || error "Could not start broker"
-}
-
-stop_broker() {
-    test -n "$PORT" && $QPIDD_EXEC --no-module-dir --quit --port $PORT
-}
+#set -x
 
-start_broker
-echo "Running Queue flow limit tests using broker on port $PORT"
-$QPID_PYTHON_TEST -m queue_flow_limit_tests $SKIPTESTS -b localhost:$PORT $@
+rm -rf $LOG_FILE
+# Note: if you change the DEFAULT_THRESHOLDS, you will need to update queue_flow_limit_tests.py
+DEFAULT_THRESHOLDS="--default-flow-stop-threshold=80 --default-flow-resume-threshold=70"
+start_broker $DEFAULT_THRESHOLDS -t --log-to-stderr=no --log-to-stdout=no || error "Could
not start broker"
+QPID_PORT=`cat qpidd.port`
+echo "Running Queue flow limit tests using broker on port $QPID_PORT"
+$QPID_PYTHON_TEST -m queue_flow_limit_tests $SKIPTESTS -b localhost:$QPID_PORT $@
 RETCODE=$?
-stop_broker
+stop_broker || error "Could not stop broker"
 if test x$RETCODE != x0; then
     echo "FAIL queue flow limit tests"; exit 1;
 fi



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message