You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2018/03/19 15:30:24 UTC

qpid-broker-j git commit: NO-JIRA: [Broker-J][System Tests] Stengthen producer flow control tests

Repository: qpid-broker-j
Updated Branches:
  refs/heads/master 906a84956 -> a1bf40bf2


NO-JIRA: [Broker-J][System Tests] Stengthen producer flow control tests


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/a1bf40bf
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/a1bf40bf
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/a1bf40bf

Branch: refs/heads/master
Commit: a1bf40bf20593e117c1be7a560149174767149c3
Parents: 906a849
Author: Alex Rudyy <or...@apache.org>
Authored: Mon Mar 19 15:29:59 2018 +0000
Committer: Alex Rudyy <or...@apache.org>
Committed: Mon Mar 19 15:30:10 2018 +0000

----------------------------------------------------------------------
 .../queue/ProducerFlowControlTest.java          | 68 +-------------------
 1 file changed, 2 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a1bf40bf/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/ProducerFlowControlTest.java
----------------------------------------------------------------------
diff --git a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/ProducerFlowControlTest.java b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/ProducerFlowControlTest.java
index c7362ff..bd86c6e 100644
--- a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/ProducerFlowControlTest.java
+++ b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/queue/ProducerFlowControlTest.java
@@ -161,66 +161,6 @@ public class ProducerFlowControlTest extends JmsTestBase
     }
 
     @Test
-    public void testFlowControlSoak() throws Exception
-    {
-        final String queueName = getTestName();
-        int messageSize = evaluateMessageSize();
-        int capacity = messageSize * 20;
-        final Queue queue = createAndBindQueueWithFlowControlEnabled(queueName, capacity, capacity / 2);
-
-        final int numProducers = 10;
-        final int numMessages = 100;
-
-        Connection consumerConnection = getConnection();
-        try
-        {
-            Connection[] producerConnections = new Connection[numProducers];
-            for (int i = 0; i < numProducers; i++)
-            {
-                producerConnections[i] = getConnection();
-            }
-            try
-            {
-                AtomicInteger messageCounter = new AtomicInteger();
-                for (int i = 0; i < numProducers; i++)
-                {
-                    producerConnections[i].start();
-                    Session session = producerConnections[i].createSession(false, Session.AUTO_ACKNOWLEDGE);
-                    sendMessagesAsync(session.createProducer(queue), session, numMessages, messageCounter);
-                }
-
-                Session consumerSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-                MessageConsumer consumer = consumerSession.createConsumer(queue);
-                consumerConnection.start();
-
-                for (int j = 0; j < numProducers * numMessages; j++)
-                {
-
-                    Message msg = consumer.receive(getReceiveTimeout());
-                    assertNotNull("Message not received(" + j + "), sent: " + messageCounter.get(), msg);
-                }
-
-                Message msg = consumer.receive(getReceiveTimeout() / 4);
-                assertNull("extra message received", msg);
-            }
-            finally
-            {
-                for (int i = 0; i < numProducers; i++)
-                {
-                    if (producerConnections[i] != null)
-                    {
-                        producerConnections[i].close();
-                    }
-                }
-            }
-        }
-        finally
-        {
-            consumerConnection.close();
-        }
-    }
-
-    @Test
     public void testFlowControlAttributeModificationViaManagement() throws Exception
     {
         final String queueName = getTestName();
@@ -243,18 +183,14 @@ public class ProducerFlowControlTest extends JmsTestBase
             assertTrue("Flow is not stopped", awaitAttributeValue(queueName, "queueFlowStopped", true, 2000));
 
             assertEquals("Incorrect number of message sent before blocking", 1, sender.getNumberOfSentMessages());
-            assertTrue("Queue should be overfull", isFlowStopped(queueName));
 
             int queueDepthBytes = getQueueDepthBytes(queueName);
             //raise the attribute values, causing the queue to become underfull and allow the second message to be sent.
             setFlowLimits(queueName, queueDepthBytes * 2 + queueDepthBytes / 2, queueDepthBytes + queueDepthBytes / 2);
 
             assertTrue("Flow is stopped", awaitAttributeValue(queueName, "queueFlowStopped", false, 2000));
-
-            //check second message was sent
-            assertEquals("Second message was not sent after lifting FlowResumeCapacity",
-                         2,
-                         sender.getNumberOfSentMessages());
+            assertTrue("Second message was not sent after changing limits",
+                       awaitAttributeValue(queueName, "queueDepthMessages", 2, 2000));
             assertFalse("Queue should not be overfull", isFlowStopped(queueName));
 
             // try to send another message to block flow


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