You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2011/03/14 17:44:16 UTC

svn commit: r1081460 - in /qpid/trunk/qpid/java: client/src/main/java/org/apache/qpid/client/AMQSession.java systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java

Author: rajith
Date: Mon Mar 14 16:44:15 2011
New Revision: 1081460

URL: http://svn.apache.org/viewvc?rev=1081460&view=rev
Log:
QPID-3143
Removed the line which sets the create option to 'always'. Please note that the default create option is set to 'never'.
Therefore if just a queue name is specified the client will throw an exception if that queue is not present in the broker.
However this check will only be performed when a producer or consumer is created using that destination.

Also modified the existing test case to verify the default and the explicit create case.

Modified:
    qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java

Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?rev=1081460&r1=1081459&r2=1081460&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java (original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java Mon Mar 14 16:44:15 2011
@@ -1225,7 +1225,6 @@ public abstract class AMQSession<C exten
                 else
                 {
                     AMQQueue queue = new AMQQueue(queueName);
-                    queue.setCreate(AddressOption.ALWAYS);
                     return queue;
                     
                 }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java?rev=1081460&r1=1081459&r2=1081460&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java Mon Mar 14 16:44:15 2011
@@ -527,7 +527,22 @@ public class AddressBasedDestinationTest
         cons.close();
         
         // Using the ADDR method
+        // default case
         queue = ssn.createQueue("ADDR:my-queue2");
+        try
+        {
+        	prod = ssn.createProducer(queue);
+        	fail("The client should throw an exception, since there is no queue present in the broker");
+        }
+        catch(Exception e)
+        {
+        	String s = "The name 'my-queue2' supplied in the address " +
+        			"doesn't resolve to an exchange or a queue";
+        	assertEquals(s,e.getCause().getCause().getMessage());
+        }
+        
+        // explicit create case
+        queue = ssn.createQueue("ADDR:my-queue2; {create: sender}");
         prod = ssn.createProducer(queue); 
         cons = ssn.createConsumer(queue);
         assertTrue("my-queue2 was not created as expected",(



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org