summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-05-01 15:22:17 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-05-01 15:22:17 +0000
commit3739a1e857f826d6530ca234a9ac22fe13ca04e8 (patch)
tree7c4d202e1edc4589b9b5e984da047d5c63ad2453
parentd2c07ddac5ab260e835cd79faeabc44cb58e972f (diff)
downloadqpid-python-3739a1e857f826d6530ca234a9ac22fe13ca04e8.tar.gz
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/branches/M2@534117 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java13
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java15
-rw-r--r--java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnection.java5
3 files changed, 24 insertions, 9 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java b/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
index b5c59dbbb7..36a4fa5307 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
@@ -107,12 +107,23 @@ public class VirtualHost implements Accessable
} // End of MBean class
-
+ /**
+ * Used for testing only
+ * @param name
+ * @param store
+ * @throws Exception
+ */
public VirtualHost(String name, MessageStore store) throws Exception
{
this(name, null, store);
}
+ /**
+ * Normal Constructor
+ * @param name
+ * @param hostConfig
+ * @throws Exception
+ */
public VirtualHost(String name, Configuration hostConfig) throws Exception
{
this(name, hostConfig, null);
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);