summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-10-10 17:44:52 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-10-10 17:44:52 +0000
commit92cda1886a5823fda4c043ade181ebde426611f4 (patch)
treef4b64a965f5bfa541eae2cb5f3e9e7cf557c8dbb
parent7faf99208ff1c2578db48d2770b1611a90bedf68 (diff)
downloadqpid-python-92cda1886a5823fda4c043ade181ebde426611f4.tar.gz
Merged revisions 573738-573739,573741-574077,574079-574236,574238-574265,574267-574503,574505-574554,574556-574584,574586-574873,574875-574901,574903-575737,575739-575787,575789-575810,575812-577772,577774-577940,577942-578057,578059-578732,578734,578736-578744,578746-578827,578829-578844,578846-579114,579116-579146,579148-579197,579199-579228,579230-579573,579575-579576,579579-579601,579603-579613,579615-579708,579710-580021,580023-580039,580042-580060,580062-580065,580067-580080,580082-580257,580259-580264,580266-580350,580352-580984,580986-580991,580994-581001,581003-581170,581172-581188,581190-581206,581208-581245,581247-581292,581294-581539,581541-581565,581567-581620,581622-581626,581628-581646,581648-581967,581969-582197,582199-582200,582203-582204,582206-582262,582264,582267-583084,583087,583089-583104,583106-583146,583148-583153,583155-583169,583171-583172,583174-583398,583400-583414,583416-583417,583419-583437,583439-583482,583484-583517,583519-583550 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1 ........ r583546 | ritchiem | 2007-10-10 18:14:53 +0100 (Wed, 10 Oct 2007) | 1 line QPID-631 : Patch provided by Aidan Skinner to address the errors in the MessageRequeueTest. ........ r583548 | ritchiem | 2007-10-10 18:15:59 +0100 (Wed, 10 Oct 2007) | 2 lines QPID-632 : The lack of AMQNoConsumersException on the connection may be due to the exception list in ExceptionMonitor not being thread safe. Synchronized method calls to ensure atomic access. ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@583554 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java4
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java16
2 files changed, 10 insertions, 10 deletions
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
index 03db3c5cca..bf8802c803 100644
--- a/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
+++ b/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
@@ -234,7 +234,7 @@ public class MessageRequeueTest extends TestCase
{
if ((b == 0) && (index != 0)) // delivery tag of zero shouldn't exist (and we don't have msg 0)
{
- _logger.error("Index: " + index + " was not received.");
+ fail("Index: " + index + " was not received.");
list.append(" ");
list.append(index);
list.append(":");
@@ -246,7 +246,7 @@ public class MessageRequeueTest extends TestCase
}
assertEquals(list.toString() + "-" + numTestMessages + "-" + totalConsumed, 0, failed);
- assertEquals("number of consumed messages does not match initial data", numTestMessages, totalConsumed);
+ assertTrue("number of consumed messages does not match initial data: " + totalConsumed, numTestMessages <= totalConsumed);
}
diff --git a/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java b/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java
index 34274c827c..9f1207202e 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java
@@ -52,7 +52,7 @@ public class ExceptionMonitor implements ExceptionListener
*
* @param e The exception to record.
*/
- public void onException(JMSException e)
+ public synchronized void onException(JMSException e)
{
log.debug("public void onException(JMSException e): called", e);
@@ -64,7 +64,7 @@ public class ExceptionMonitor implements ExceptionListener
*
* @return <tt>true</tt> if no exceptions have been received, <tt>false</tt> otherwise.
*/
- public boolean assertNoExceptions()
+ public synchronized boolean assertNoExceptions()
{
return exceptions.isEmpty();
}
@@ -74,7 +74,7 @@ public class ExceptionMonitor implements ExceptionListener
*
* @return <tt>true</tt> if exactly one exception been received, <tt>false</tt> otherwise.
*/
- public boolean assertOneJMSException()
+ public synchronized boolean assertOneJMSException()
{
return exceptions.size() == 1;
}
@@ -85,7 +85,7 @@ public class ExceptionMonitor implements ExceptionListener
* @return <tt>true</tt> if exactly one exception, with a linked cause of the specified type, been received,
* <tt>false</tt> otherwise.
*/
- public boolean assertOneJMSExceptionWithLinkedCause(Class aClass)
+ public synchronized boolean assertOneJMSExceptionWithLinkedCause(Class aClass)
{
if (exceptions.size() == 1)
{
@@ -107,7 +107,7 @@ public class ExceptionMonitor implements ExceptionListener
*
* @return The number of exceptions held by this monitor.
*/
- public int size()
+ public synchronized int size()
{
return exceptions.size();
}
@@ -115,9 +115,9 @@ public class ExceptionMonitor implements ExceptionListener
/**
* Clears the record of received exceptions.
*/
- public void reset()
+ public synchronized void reset()
{
- exceptions = new ArrayList();
+ exceptions = new ArrayList<JMSException>();
}
/**
@@ -126,7 +126,7 @@ public class ExceptionMonitor implements ExceptionListener
*
* @return A string containing a dump of the stack traces of all exceptions.
*/
- public String toString()
+ public synchronized String toString()
{
String result = "ExceptionMonitor: holds " + exceptions.size() + " exceptions.\n\n";