qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1779941 - in /qpid/java/trunk: systests/src/test/java/org/apache/qpid/server/store/ systests/src/test/java/org/apache/qpid/test/unit/ack/ test-profiles/
Date Mon, 23 Jan 2017 15:18:58 GMT
Author: kwall
Date: Mon Jan 23 15:18:58 2017
New Revision: 1779941

URL: http://svn.apache.org/viewvc?rev=1779941&view=rev
Log:
QPID-7546: [System Tests] Fix MultipleAuthenticationManagersTest, PersistentStoreTest, SplitStoreTest
and ClientAcknowledgeTest on AMQP 1.0 persistent profiles

Modified:
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/PersistentStoreTest.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/SplitStoreTest.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/ack/ClientAcknowledgeTest.java
    qpid/java/trunk/test-profiles/CPPTransientExcludes
    qpid/java/trunk/test-profiles/Java10Excludes
    qpid/java/trunk/test-profiles/JavaTransientExcludes

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/PersistentStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/PersistentStoreTest.java?rev=1779941&r1=1779940&r2=1779941&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/PersistentStoreTest.java
(original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/PersistentStoreTest.java
Mon Jan 23 15:18:58 2017
@@ -33,7 +33,6 @@ import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 
-import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 
 public class PersistentStoreTest extends QpidBrokerTestCase
@@ -43,6 +42,7 @@ public class PersistentStoreTest extends
     private Session _session;
     private Destination _destination;
 
+    @Override
     public void setUp() throws Exception
     {
         super.setUp();
@@ -94,10 +94,12 @@ public class PersistentStoreTest extends
 
     public void testHeaderPersistence() throws Exception
     {
+        String testQueueName = getTestQueueName();
+        String replyToQueue = testQueueName + "_reply";
         _con.start();
         _session = _con.createSession(true, Session.SESSION_TRANSACTED);
-        _destination = _session.createQueue(getTestQueueName());
-        Destination replyTo = _session.createQueue(getTestQueueName() + "_reply");
+        _destination = createTestQueue(_session, testQueueName);
+        Destination replyTo = createTestQueue(_session, replyToQueue);
         MessageConsumer consumer = _session.createConsumer(_destination);
         MessageProducer producer = _session.createProducer(_destination);
 
@@ -116,7 +118,7 @@ public class PersistentStoreTest extends
 
         final String sentMessageId = msg.getJMSMessageID();
 
-        Message receivedMessage = consumer.receive(1000);
+        Message receivedMessage = consumer.receive(getReceiveTimeout());
         long receivedJmsExpiration = receivedMessage.getJMSExpiration();
         assertEquals("Unexpected JMS message id", sentMessageId, receivedMessage.getJMSMessageID());
         assertEquals("Unexpected JMS replyto", replyTo, receivedMessage.getJMSReplyTo());
@@ -134,7 +136,7 @@ public class PersistentStoreTest extends
         _session = _con.createSession(true, Session.SESSION_TRANSACTED);
         consumer = _session.createConsumer(_destination);
 
-        Message rereceivedMessage = consumer.receive(1000);
+        Message rereceivedMessage = consumer.receive(getReceiveTimeout());
         assertEquals("Unexpected JMS message id", sentMessageId, rereceivedMessage.getJMSMessageID());
         assertEquals("Unexpected JMS replyto", replyTo, rereceivedMessage.getJMSReplyTo());
         assertEquals("Unexpected JMS priority", priority, rereceivedMessage.getJMSPriority());
@@ -147,9 +149,7 @@ public class PersistentStoreTest extends
     private void sendAndCommitMessages() throws Exception
     {
         _session = _con.createSession(true, Session.SESSION_TRANSACTED);
-        _destination = _session.createQueue(getTestQueueName());
-        // Create queue by consumer side-effect
-        _session.createConsumer(_destination).close();
+        _destination = createTestQueue(_session);
 
         sendMessage(_session, _destination, NUM_MESSAGES);
         _session.commit();
@@ -157,9 +157,7 @@ public class PersistentStoreTest extends
 
     private void sendMoreMessagesWithoutCommitting() throws Exception
     {
-        sendMessage(_session, _destination, 5);
-        // sync to ensure that messages have reached the broker
-        ((AMQSession<?,?>) _session).sync();
+        sendMessage(_session, _destination, NUM_MESSAGES);
     }
 
     private void confirmBrokerStillHasCommittedMessages() throws Exception
@@ -171,12 +169,12 @@ public class PersistentStoreTest extends
         MessageConsumer consumer = session.createConsumer(destination);
         for (int i = 1; i <= NUM_MESSAGES; i++)
         {
-            Message msg = consumer.receive(RECEIVE_TIMEOUT);
+            Message msg = consumer.receive(getReceiveTimeout());
             assertNotNull("Message " + i + " not received", msg);
             assertEquals("Did not receive the expected message", i, msg.getIntProperty(INDEX));
         }
 
-        Message msg = consumer.receive(100);
+        Message msg = consumer.receive(getShortReceiveTimeout());
         if(msg != null)
         {
             fail("No more messages should be received, but received additional message with
index: " + msg.getIntProperty(INDEX));
@@ -199,11 +197,11 @@ public class PersistentStoreTest extends
     public List<Message> sendMessage(Session session, Destination destination,
                                      int count) throws Exception
     {
-        List<Message> messages = new ArrayList<Message>(count);
+        List<Message> messages = new ArrayList<>(count);
 
         MessageProducer producer = session.createProducer(destination);
 
-        for (int i = 1;i <= (count); i++)
+        for (int i = 1; i <= count; i++)
         {
             Message next = createNextMessage(session, i);
 

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/SplitStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/SplitStoreTest.java?rev=1779941&r1=1779940&r2=1779941&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/SplitStoreTest.java
(original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/store/SplitStoreTest.java
Mon Jan 23 15:18:58 2017
@@ -89,8 +89,7 @@ public class SplitStoreTest extends Qpid
 
         Connection connection = getConnection();
         Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
-        Queue queue = session.createQueue(getTestQueueName());
-        session.createConsumer(queue).close(); // Create durable queue by side effect
+        Queue queue = createTestQueue(session);
         sendMessage(session, queue, 1);
         connection.close();
 

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/ack/ClientAcknowledgeTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/ack/ClientAcknowledgeTest.java?rev=1779941&r1=1779940&r2=1779941&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/ack/ClientAcknowledgeTest.java
(original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/test/unit/ack/ClientAcknowledgeTest.java
Mon Jan 23 15:18:58 2017
@@ -31,7 +31,6 @@ public class ClientAcknowledgeTest exten
 {
     private static final long ONE_DAY_MS = 1000l * 60 * 60 * 24;
     private Connection _connection;
-    private Queue _queue;
     private Session _consumerSession;
     private MessageConsumer _consumer;
     private MessageProducer _producer;
@@ -40,7 +39,6 @@ public class ClientAcknowledgeTest exten
     protected void setUp() throws Exception
     {
         super.setUp();
-        _queue = getTestQueue();
         _connection = getConnection();
     }
 
@@ -52,30 +50,36 @@ public class ClientAcknowledgeTest exten
      */
     public void testClientAckWithLargeFlusherPeriod() throws Exception
     {
-        setTestClientSystemProperty("qpid.session.max_ack_delay", Long.toString(ONE_DAY_MS));
+        if (isBroker010())
+        {
+            setTestClientSystemProperty("qpid.session.max_ack_delay", Long.toString(ONE_DAY_MS));
+        }
+
         _consumerSession = _connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-        _consumer = _consumerSession.createConsumer(_queue);
+        Queue queue = createTestQueue(_consumerSession);
+        _consumer = _consumerSession.createConsumer(queue);
         _connection.start();
 
-        _producer = _consumerSession.createProducer(_queue);
+        _producer = _consumerSession.createProducer(queue);
         _producer.send(createNextMessage(_consumerSession, 1));
         _producer.send(createNextMessage(_consumerSession, 2));
 
-        Message message = _consumer.receive(1000l);
+        Message message = _consumer.receive(getReceiveTimeout());
         assertNotNull("Message has not been received", message);
         assertEquals("Unexpected message is received", 1, message.getIntProperty(INDEX));
         message.acknowledge();
 
         //restart broker to allow verification of the acks
         //without explicitly closing connection (which acks)
+        //Seems to be contrary to the JMS spec " Closing a connection does NOT force an acknowledgment
of client-acknowledged sessions."
         restartDefaultBroker();
 
         // try to receive the message again, which should fail (as it was ackd)
         _connection = getConnection();
         _connection.start();
         _consumerSession = _connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-        _consumer = _consumerSession.createConsumer(_queue);
-        message = _consumer.receive(1000l);
+        _consumer = _consumerSession.createConsumer(queue);
+        message = _consumer.receive(getReceiveTimeout());
         assertNotNull("Message has not been received", message);
         assertEquals("Unexpected message is received", 2, message.getIntProperty(INDEX));
     }

Modified: qpid/java/trunk/test-profiles/CPPTransientExcludes
URL: http://svn.apache.org/viewvc/qpid/java/trunk/test-profiles/CPPTransientExcludes?rev=1779941&r1=1779940&r2=1779941&view=diff
==============================================================================
--- qpid/java/trunk/test-profiles/CPPTransientExcludes (original)
+++ qpid/java/trunk/test-profiles/CPPTransientExcludes Mon Jan 23 15:18:58 2017
@@ -29,4 +29,4 @@ org.apache.qpid.test.unit.xa.QueueTest#t
 org.apache.qpid.test.unit.xa.QueueTest#testSendAndRecover
 
 // test requires a persistent store
-org.apache.qpid.test.unit.ack.ClientAcknowledgeTest#testClientAckWithLargeFlusherPeriod
+org.apache.qpid.test.unit.ack.ClientAcknowledgeTest#testClientAckWithRestart

Modified: qpid/java/trunk/test-profiles/Java10Excludes
URL: http://svn.apache.org/viewvc/qpid/java/trunk/test-profiles/Java10Excludes?rev=1779941&r1=1779940&r2=1779941&view=diff
==============================================================================
--- qpid/java/trunk/test-profiles/Java10Excludes (original)
+++ qpid/java/trunk/test-profiles/Java10Excludes Mon Jan 23 15:18:58 2017
@@ -184,6 +184,7 @@ org.apache.qpid.client.ssl.SSLTest#testC
 org.apache.qpid.client.ssl.SSLTest#testCreateSSLConnectionUsingSystemProperties
 org.apache.qpid.client.ssl.SSLTest#testSslConnectionOption
 org.apache.qpid.client.ssl.SSLTest#testVerifyLocalHost
+org.apache.qpid.server.security.auth.manager.MultipleAuthenticationManagersTest#testMultipleAuthenticationManagers
 // Test framework does not allow us to override hostname
 org.apache.qpid.client.ssl.SSLTest#testHostVerificationIsOnByDefault
 org.apache.qpid.client.ssl.SSLTest#testVerifyHostNameWithIncorrectHostname

Modified: qpid/java/trunk/test-profiles/JavaTransientExcludes
URL: http://svn.apache.org/viewvc/qpid/java/trunk/test-profiles/JavaTransientExcludes?rev=1779941&r1=1779940&r2=1779941&view=diff
==============================================================================
--- qpid/java/trunk/test-profiles/JavaTransientExcludes (original)
+++ qpid/java/trunk/test-profiles/JavaTransientExcludes Mon Jan 23 15:18:58 2017
@@ -23,7 +23,7 @@ org.apache.qpid.server.store.PersistentS
 org.apache.qpid.server.store.SplitStoreTest#*
 org.apache.qpid.server.logging.AlertingTest#testAlertingReallyWorksWithRestart
 org.apache.qpid.server.logging.AlertingTest#testAlertingReallyWorksWithChanges
-org.apache.qpid.test.unit.ack.ClientAcknowledgeTest#testClientAckWithLargeFlusherPeriod
+org.apache.qpid.test.unit.ack.ClientAcknowledgeTest#testClientAckWithRestart
 
 org.apache.qpid.test.unit.ct.DurableSubscriberTest#*
 



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


Mime
View raw message