You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2016/11/27 21:48:54 UTC

svn commit: r1771652 - in /qpid/java/trunk: systests/src/test/java/org/apache/qpid/server/queue/ systests/src/test/java/org/apache/qpid/systest/prefetch/ test-profiles/

Author: rgodfrey
Date: Sun Nov 27 21:48:54 2016
New Revision: 1771652

URL: http://svn.apache.org/viewvc?rev=1771652&view=rev
Log:
QPID-7546 : PriorityQueueTest, ZeroPrefetchTest

Modified:
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/PriorityQueueTest.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/prefetch/ZeroPrefetchTest.java
    qpid/java/trunk/test-profiles/Java10Excludes
    qpid/java/trunk/test-profiles/Java10UninvestigatedTestsExcludes

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/PriorityQueueTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/PriorityQueueTest.java?rev=1771652&r1=1771651&r2=1771652&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/PriorityQueueTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/PriorityQueueTest.java Sun Nov 27 21:48:54 2016
@@ -39,10 +39,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.qpid.QpidException;
-import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.configuration.ClientProperties;
+import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 
 public class PriorityQueueTest extends QpidBrokerTestCase
@@ -85,13 +84,8 @@ public class PriorityQueueTest extends Q
 
     public void testPriority() throws JMSException, NamingException, QpidException
     {
-        final Map<String,Object> arguments = new HashMap<String, Object>();
-        arguments.put("x-qpid-priorities",10);
-        ((AMQSession) producerSession).createQueue(QUEUE, true, false, false, arguments);
-        queue = (Queue) producerSession.createQueue("direct://amq.direct/"+QUEUE+"/"+QUEUE+"?durable='false'&autodelete='true'");
-
-        ((AMQSession) producerSession).declareAndBind((AMQDestination)queue);
-        producer = producerSession.createProducer(queue);
+        final int priorities = 10;
+        createPriorityQueue(priorities);
 
         for (int msg = 0; msg < MSG_COUNT; msg++)
         {
@@ -124,15 +118,37 @@ public class PriorityQueueTest extends Q
         assertEquals("Incorrect number of message received", 50, receivedCount);
     }
 
-    public void testOddOrdering() throws QpidException, JMSException
+    private void createPriorityQueue(final int priorities) throws QpidException, JMSException
     {
-        final Map<String,Object> arguments = new HashMap<String, Object>();
-        arguments.put("x-qpid-priorities",3);
-        ((AMQSession) producerSession).createQueue(QUEUE, true, false, false, arguments);
-        queue = producerSession.createQueue("direct://amq.direct/"+QUEUE+"/"+QUEUE+"?durable='false'&autodelete='true'");
+        if(isBroker10())
+        {
+            final Map<String, Object> attributes = new HashMap<>();
+            attributes.put(PriorityQueue.PRIORITIES, priorities);
+            attributes.put(PriorityQueue.DURABLE, false);
+            attributes.put(PriorityQueue.LIFETIME_POLICY, LifetimePolicy.DELETE_ON_NO_OUTBOUND_LINKS.toString());
+            createEntityUsingAmqpManagement(getTestQueueName(), producerSession, "org.apache.qpid.PriorityQueue", attributes);
+            queue = producerSession.createQueue(getTestQueueName());
+        }
+        else
+        {
+
+            final Map<String, Object> arguments = new HashMap<String, Object>();
+            arguments.put("x-qpid-priorities", priorities);
+            ((AMQSession) producerSession).createQueue(getTestQueueName(), true, false, false, arguments);
+            queue = (Queue) producerSession.createQueue("direct://amq.direct/"
+                                                        + getTestQueueName()
+                                                        + "/"
+                                                        + getTestQueueName()
+                                                        + "?durable='false'&autodelete='true'");
 
-        ((AMQSession) producerSession).declareAndBind((AMQDestination)queue);
+            ((AMQSession) producerSession).declareAndBind((AMQDestination) queue);
+        }
         producer = producerSession.createProducer(queue);
+    }
+
+    public void testOddOrdering() throws QpidException, JMSException
+    {
+        createPriorityQueue(3);
 
         // In order ABC
         producer.setPriority(9);
@@ -214,20 +230,12 @@ public class PriorityQueueTest extends Q
      */
     public void testMessageReflectionWithPriorityIncreaseOnTransactedSessionsWithPrefetch1() throws Exception
     {
-        setTestClientSystemProperty(ClientProperties.MAX_PREFETCH_PROP_NAME, "1");
-        Connection conn = getConnection();
+        Connection conn = getConnectionWithPrefetch(1);
         conn.start();
-        assertEquals("Prefetch not reset", 1, ((AMQConnection) conn).getMaxPrefetch());
-
         final Session producerSess = conn.createSession(true, Session.SESSION_TRANSACTED);
         final Session consumerSess = conn.createSession(true, Session.SESSION_TRANSACTED);
 
-        //declare a priority queue with 10 priorities
-        final Map<String,Object> arguments = new HashMap<String, Object>();
-        arguments.put("x-qpid-priorities",10);
-        ((AMQSession<?,?>) producerSess).createQueue(getTestQueueName(), false, true, false, arguments);
-
-        Queue queue = producerSess.createQueue(getTestQueueName());
+        createPriorityQueue(10);
 
         //create the consumer, producer, add message listener
         CountDownLatch latch = new CountDownLatch(5);

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/prefetch/ZeroPrefetchTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/prefetch/ZeroPrefetchTest.java?rev=1771652&r1=1771651&r2=1771652&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/prefetch/ZeroPrefetchTest.java (original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/systest/prefetch/ZeroPrefetchTest.java Sun Nov 27 21:48:54 2016
@@ -29,7 +29,6 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 
-import org.apache.qpid.configuration.ClientProperties;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 
 public class ZeroPrefetchTest extends QpidBrokerTestCase
@@ -42,13 +41,12 @@ public class ZeroPrefetchTest extends Qp
     // if the first connection has no prefetch
     public void testZeroPrefetch() throws Exception
     {
-        setTestClientSystemProperty(ClientProperties.MAX_PREFETCH_PROP_NAME, "0");
-        Connection prefetch1Connection = getConnection();
+        Connection prefetch1Connection = getConnectionWithPrefetch(0);
 
         prefetch1Connection.start();
 
         final Session prefetch1session = prefetch1Connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        Queue queue = prefetch1session.createQueue(getTestQueueName());
+        Queue queue = createTestQueue(prefetch1session);
         MessageConsumer prefetch1consumer = prefetch1session.createConsumer(queue);
 
 
@@ -69,7 +67,7 @@ public class ZeroPrefetchTest extends Qp
         assertNotNull("First message was not received", receivedMessage);
         assertEquals("Message property was not as expected", firstPropertyValue, receivedMessage.getStringProperty(TEST_PROPERTY_NAME));
 
-        Connection prefetch2Connection = getConnection();
+        Connection prefetch2Connection = getConnectionWithPrefetch(0);
 
         prefetch2Connection.start();
         final Session prefetch2session = prefetch2Connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

Modified: qpid/java/trunk/test-profiles/Java10Excludes
URL: http://svn.apache.org/viewvc/qpid/java/trunk/test-profiles/Java10Excludes?rev=1771652&r1=1771651&r2=1771652&view=diff
==============================================================================
--- qpid/java/trunk/test-profiles/Java10Excludes (original)
+++ qpid/java/trunk/test-profiles/Java10Excludes Sun Nov 27 21:48:54 2016
@@ -107,6 +107,18 @@ org.apache.qpid.test.unit.basic.Property
 org.apache.qpid.test.unit.basic.PropertyValueTest#testLargeHeader_08091_HeadersFillContentHeaderFrame
 org.apache.qpid.test.unit.basic.PropertyValueTest#testLargeHeader_010_HeadersFillContentHeaderFrame
 
+// This test concerns 0-8/0-10 bytes limiting flow control
+org.apache.qpid.test.client.FlowControlTest#*
+
+// Failover tests are tests of the 0-x client behaviour
+org.apache.qpid.client.failover.FailoverBehaviourTest#*
+org.apache.qpid.client.failover.MultipleBrokersFailoverTest#*
+org.apache.qpid.test.client.failover.FailoverTest#*
+
+
+// Tests explicit binding using the mechanisms of the 0-x client/protocol
+org.apache.qpid.server.queue.QueueBindTest#*
+
 
 
 

Modified: qpid/java/trunk/test-profiles/Java10UninvestigatedTestsExcludes
URL: http://svn.apache.org/viewvc/qpid/java/trunk/test-profiles/Java10UninvestigatedTestsExcludes?rev=1771652&r1=1771651&r2=1771652&view=diff
==============================================================================
--- qpid/java/trunk/test-profiles/Java10UninvestigatedTestsExcludes (original)
+++ qpid/java/trunk/test-profiles/Java10UninvestigatedTestsExcludes Sun Nov 27 21:48:54 2016
@@ -33,17 +33,13 @@ org.apache.qpid.client.prefetch.Prefetch
 org.apache.qpid.client.redelivered.RedeliveredMessageTest#*
 org.apache.qpid.client.SynchReceiveTest#*
 org.apache.qpid.client.SyncPublishTest#*
-org.apache.qpid.test.client.failover.FailoverTest#*
-org.apache.qpid.systest.prefetch.ZeroPrefetchTest#*
 org.apache.qpid.systest.messageencryption.MessageEncryptionTest#*
 org.apache.qpid.systest.MessageCompressionTest#*
 org.apache.qpid.server.SupportedProtocolVersionsTest#*
 org.apache.qpid.server.stats.StatisticsReportingTest#*
 org.apache.qpid.server.security.acl.ExternalACLTest#*
 org.apache.qpid.server.security.acl.ExhaustiveACLTest#*
-org.apache.qpid.server.queue.QueueBindTest#*
 org.apache.qpid.server.queue.ProducerFlowControlTest#*
-org.apache.qpid.server.queue.PriorityQueueTest#*
 org.apache.qpid.server.queue.MultipleTransactedBatchProducerTest#*
 org.apache.qpid.server.queue.ModelTest#*
 org.apache.qpid.server.queue.LiveQueueOperationsTest#*
@@ -67,13 +63,10 @@ org.apache.qpid.test.unit.basic.InvalidD
 org.apache.qpid.test.unit.basic.close.CloseTest#*
 org.apache.qpid.test.client.queue.LVQTest#*
 org.apache.qpid.test.client.message.JMSDestinationTest#*
-org.apache.qpid.test.client.FlowControlTest#*
 org.apache.qpid.systest.rest.ConnectionRestTest#*
 org.apache.qpid.systest.rest.MessagesRestTest#*
 org.apache.qpid.transport.ConnectionEstablishmentTest#*
 org.apache.qpid.test.unit.transacted.TransactionTimeoutTest#*
-org.apache.qpid.client.failover.FailoverBehaviourTest#*
-org.apache.qpid.client.failover.MultipleBrokersFailoverTest#*
 org.apache.qpid.test.unit.transacted.TransactionTimeoutDisabledTest#*
 org.apache.qpid.test.unit.topic.TopicPublisherTest#*
 org.apache.qpid.test.client.message.JMSXUserIDTest#*



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org