diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2007-05-03 13:41:35 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2007-05-03 13:41:35 +0000 |
| commit | 49c6109ef7370409c93bc35b6a9ddf58e6fca465 (patch) | |
| tree | 4e3c1d0a7ef8dcb518de078244f946230bfbc88b /java/systests/src | |
| parent | b2d3708cb018e4746a1aed79d5089eea5afbb43f (diff) | |
| download | qpid-python-49c6109ef7370409c93bc35b6a9ddf58e6fca465.tar.gz | |
Merged revisions 533704-533720,533722-533763,533766-533818,533820-533839,533841-533859,533862-534112,534114-534117 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2
........
r533704 | bhupendrab | 2007-04-30 12:37:59 +0100 (Mon, 30 Apr 2007) | 1 line
Added time-out for secure server connection.
........
r534036 | ritchiem | 2007-05-01 13:28:03 +0100 (Tue, 01 May 2007) | 1 line
QPID-461 Update to CommitRollbackTest. Ensuring messages received have the correct redelivered value, regardless of order. Different test case also was problematic.
........
r534117 | ritchiem | 2007-05-01 16:22:17 +0100 (Tue, 01 May 2007) | 4 lines
Comments and Test changes
VirtualHost Added comments
HeapExhaustion - Updated to send transient messages.
QpidClientConnection - Allowed specification of type of message to send.
........
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@534856 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests/src')
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java | 15 | ||||
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnection.java | 5 |
2 files changed, 12 insertions, 8 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java b/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java index 228bd1ec6f..c6cbac0ba8 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java +++ b/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java @@ -8,6 +8,7 @@ import org.apache.qpid.protocol.AMQConstant; import org.apache.log4j.Logger; import javax.jms.JMSException; +import javax.jms.DeliveryMode; import java.io.IOException; @@ -16,7 +17,7 @@ public class HeapExhaustion extends TestCase { private static final Logger _logger = Logger.getLogger(HeapExhaustion.class); - protected QpidClientConnection conn; + protected QpidClientConnection conn; protected final String BROKER = "localhost"; protected final String vhost = "/test"; protected final String queue = "direct://amq.direct//queue"; @@ -54,7 +55,7 @@ public class HeapExhaustion extends TestCase * * @throws Exception on error */ - public void testUntilFailure() throws Exception + public void testUntilFailureTransient() throws Exception { int copies = 0; int total = 0; @@ -62,7 +63,7 @@ public class HeapExhaustion extends TestCase int size = payload.getBytes().length; while (true) { - conn.put(queue, payload, 1); + conn.put(queue, payload, 1, DeliveryMode.NON_PERSISTENT); copies++; total += size; System.out.println("put copy " + copies + " OK for total bytes: " + total); @@ -74,7 +75,7 @@ public class HeapExhaustion extends TestCase * * @throws Exception on error */ - public void testUntilFailureWithDelays() throws Exception + public void testUntilFailureWithDelaysTransient() throws Exception { int copies = 0; int total = 0; @@ -82,7 +83,7 @@ public class HeapExhaustion extends TestCase int size = payload.getBytes().length; while (true) { - conn.put(queue, payload, 1); + conn.put(queue, payload, 1, DeliveryMode.NON_PERSISTENT); copies++; total += size; System.out.println("put copy " + copies + " OK for total bytes: " + total); @@ -109,7 +110,7 @@ public class HeapExhaustion extends TestCase _logger.info("Running testUntilFailure"); try { - he.testUntilFailure(); + he.testUntilFailureTransient(); } catch (FailoverException fe) { @@ -158,7 +159,7 @@ public class HeapExhaustion extends TestCase _logger.info("Running testUntilFailure"); try { - he.testUntilFailureWithDelays(); + he.testUntilFailureWithDelaysTransient(); } catch (FailoverException fe) { diff --git a/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnection.java b/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnection.java index 80773c102d..d3f064293e 100644 --- a/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnection.java +++ b/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnection.java @@ -16,6 +16,7 @@ import javax.jms.MessageProducer; import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.TextMessage; +import javax.jms.DeliveryMode; public class QpidClientConnection implements ExceptionListener { @@ -150,7 +151,7 @@ public class QpidClientConnection implements ExceptionListener * * @throws javax.jms.JMSException any exception that occurs */ - public void put(String queueName, String payload, int copies) throws JMSException + public void put(String queueName, String payload, int copies, int deliveryMode) throws JMSException { if (!connected) { @@ -162,6 +163,8 @@ public class QpidClientConnection implements ExceptionListener final MessageProducer sender = session.createProducer(queue); + sender.setDeliveryMode(deliveryMode); + for (int i = 0; i < copies; i++) { Message m = session.createTextMessage(payload + i); |
