diff options
| author | Alan Conway <aconway@apache.org> | 2012-06-18 18:08:09 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-06-18 18:08:09 +0000 |
| commit | 81c4f3d48f66fddfb6b0b74f1f768cd7ee245ef7 (patch) | |
| tree | 59f0b06393891e199efa667c552eb62152fa9c20 /qpid/cpp/src/tests | |
| parent | 97596a0be663c723c69a525b2cd40aa3ea9bfde4 (diff) | |
| download | qpid-python-81c4f3d48f66fddfb6b0b74f1f768cd7ee245ef7.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@1351434 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
| -rw-r--r-- | qpid/cpp/src/tests/brokertest.py | 4 | ||||
| -rwxr-xr-x | qpid/cpp/src/tests/ha_tests.py | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/qpid/cpp/src/tests/brokertest.py b/qpid/cpp/src/tests/brokertest.py index 1dac3d579c..93b3868907 100644 --- a/qpid/cpp/src/tests/brokertest.py +++ b/qpid/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/qpid/cpp/src/tests/ha_tests.py b/qpid/cpp/src/tests/ha_tests.py index 06b2aec3cd..0f9efdf80a 100755 --- a/qpid/cpp/src/tests/ha_tests.py +++ b/qpid/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], |
