You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2007/05/01 17:22:18 UTC

svn commit: r534117 - in /incubator/qpid/branches/M2/java: broker/src/main/java/org/apache/qpid/server/virtualhost/ systests/src/main/java/org/apache/qpid/server/failure/ systests/src/main/java/org/apache/qpid/testutil/

Author: ritchiem
Date: Tue May  1 08:22:17 2007
New Revision: 534117

URL: http://svn.apache.org/viewvc?view=rev&rev=534117
Log:
Comments and Test changes
VirtualHost Added comments
HeapExhaustion - Updated to send transient messages.
QpidClientConnection - Allowed specification of type of message to send. 

Modified:
    incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
    incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java
    incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnection.java

Modified: incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java?view=diff&rev=534117&r1=534116&r2=534117
==============================================================================
--- incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java (original)
+++ incubator/qpid/branches/M2/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java Tue May  1 08:22:17 2007
@@ -107,12 +107,23 @@
 
     } // 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);

Modified: incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java?view=diff&rev=534117&r1=534116&r2=534117
==============================================================================
--- incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java (original)
+++ incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java Tue May  1 08:22:17 2007
@@ -8,6 +8,7 @@
 import org.apache.log4j.Logger;
 
 import javax.jms.JMSException;
+import javax.jms.DeliveryMode;
 import java.io.IOException;
 
 
@@ -16,7 +17,7 @@
 {
     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 @@
      *
      * @throws Exception on error
      */
-    public void testUntilFailure() throws Exception
+    public void testUntilFailureTransient() throws Exception
     {
         int copies = 0;
         int total = 0;
@@ -62,7 +63,7 @@
         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 @@
      *
      * @throws Exception on error
      */
-    public void testUntilFailureWithDelays() throws Exception
+    public void testUntilFailureWithDelaysTransient() throws Exception
     {
         int copies = 0;
         int total = 0;
@@ -82,7 +83,7 @@
         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 @@
             _logger.info("Running testUntilFailure");
             try
             {
-                he.testUntilFailure();
+                he.testUntilFailureTransient();
             }
             catch (FailoverException fe)
             {
@@ -158,7 +159,7 @@
             _logger.info("Running testUntilFailure");
             try
             {
-                he.testUntilFailureWithDelays();
+                he.testUntilFailureWithDelaysTransient();
             }
             catch (FailoverException fe)
             {

Modified: incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnection.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnection.java?view=diff&rev=534117&r1=534116&r2=534117
==============================================================================
--- incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnection.java (original)
+++ incubator/qpid/branches/M2/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnection.java Tue May  1 08:22:17 2007
@@ -16,6 +16,7 @@
 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 @@
      *
      * @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)
         {
@@ -161,6 +162,8 @@
         Queue queue = session.createQueue(queueName);
 
         final MessageProducer sender = session.createProducer(queue);
+
+        sender.setDeliveryMode(deliveryMode);
 
         for (int i = 0; i < copies; i++)
         {