summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-06-18 18:08:09 +0000
committerAlan Conway <aconway@apache.org>2012-06-18 18:08:09 +0000
commit349691966a7fc366cd5b907f40dd56a994ca5a96 (patch)
tree164f9e8111c0c01e33fcc1dd9db754cc249a82e1 /cpp/src/tests
parent09a79fda3f455e49474649c836fa6f87e2f7a525 (diff)
downloadqpid-python-349691966a7fc366cd5b907f40dd56a994ca5a96.tar.gz
QPID-3603: Minor cleanup and test improvements in HA code.
- Enabled 10 queue failover test - Minor cleanup in types.h - Rewording, adding comments. - Detect and reject invalid replication values. - Cleaned up some unnecessary #includes git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1351434 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/brokertest.py4
-rwxr-xr-xcpp/src/tests/ha_tests.py14
2 files changed, 10 insertions, 8 deletions
diff --git a/cpp/src/tests/brokertest.py b/cpp/src/tests/brokertest.py
index 1dac3d579c..93b3868907 100644
--- a/cpp/src/tests/brokertest.py
+++ b/cpp/src/tests/brokertest.py
@@ -76,7 +76,7 @@ def error_line(filename, n=1):
except: return ""
return ":\n" + "".join(result)
-def retry(function, timeout=3, delay=.01):
+def retry(function, timeout=10, delay=.01):
"""Call function until it returns a true value or timeout expires.
Double the delay for each retry. Returns what function returns if
true, None if timeout expires."""
@@ -243,7 +243,7 @@ class Broker(Popen):
_broker_count = 0
_log_count = 0
- def __str__(self): return "Broker<%s %s :%d>"%(self.name, self.pname, self.port())
+ def __str__(self): return "Broker<%s %s :%d>"%(self.log, self.pname, self.port())
def find_log(self):
self.log = "%03d:%s.log" % (Broker._log_count, self.name)
diff --git a/cpp/src/tests/ha_tests.py b/cpp/src/tests/ha_tests.py
index 06b2aec3cd..0f9efdf80a 100755
--- a/cpp/src/tests/ha_tests.py
+++ b/cpp/src/tests/ha_tests.py
@@ -610,11 +610,13 @@ class ReplicationTests(BrokerTest):
self.fail("Excpected no-such-queue exception")
except NotFound: pass
- def test_invalid_default(self):
- """Verify that a queue with an invalid qpid.replicate gets default treatment"""
- cluster = HaCluster(self, 2, ha_replicate="all")
- c = cluster[0].connect().session().sender("q;{create:always, node:{x-declare:{arguments:{'qpid.replicate':XXinvalidXX}}}}")
- cluster[1].wait_backup("q")
+ def test_invalid_replication(self):
+ """Verify that we reject an attempt to declare a queue with invalid replication value."""
+ cluster = HaCluster(self, 1, ha_replicate="all")
+ try:
+ c = cluster[0].connect().session().sender("q;{create:always, node:{x-declare:{arguments:{'qpid.replicate':XXinvalidXX}}}}")
+ self.fail("Expected ConnectionError")
+ except ConnectionError: pass
def test_exclusive_queue(self):
"""Ensure that we can back-up exclusive queues, i.e. the replicating
@@ -720,7 +722,7 @@ class LongTests(BrokerTest):
brokers = HaCluster(self, 3)
# Start sender and receiver threads
- n = 1; # FIXME aconway 2012-06-10: n = 10
+ n = 10;
senders = [NumberedSender(brokers[0], max_depth=1024, failover_updates=False,
queue="test%s"%(i)) for i in xrange(n)]
receivers = [NumberedReceiver(brokers[0], sender=senders[i],