qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lqu...@apache.org
Subject svn commit: r1791672 - in /qpid/java/trunk/systests/protocol-tests-amqp-1-0/src: main/java/org/apache/qpid/tests/protocol/v1_0/ test/java/org/apache/qpid/tests/protocol/v1_0/messaging/ test/java/org/apache/qpid/tests/protocol/v1_0/transport/connection/...
Date Mon, 17 Apr 2017 09:49:30 GMT
Author: lquack
Date: Mon Apr 17 09:49:30 2017
New Revision: 1791672

URL: http://svn.apache.org/viewvc?rev=1791672&view=rev
Log:
QPID-7665: [Java Broker] speed up AMQP 1.0 protocol tests

Close connection after test instead of asserting that
there are no more incoming performatives.

Modified:
    qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java
    qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/FrameTransport.java
    qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java
    qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/connection/OpenTest.java
    qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/session/BeginTest.java

Modified: qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java?rev=1791672&r1=1791671&r2=1791672&view=diff
==============================================================================
--- qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java
(original)
+++ qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/EmbeddedBrokerPerClassAdminImpl.java
Mon Apr 17 09:49:30 2017
@@ -85,6 +85,7 @@ public class EmbeddedBrokerPerClassAdmin
             systemConfigAttributes.put(SystemConfig.INITIAL_CONFIGURATION_LOCATION, "classpath:config-protocol-tests.json");
             systemConfigAttributes.put(ConfiguredObject.CONTEXT, context);
             systemConfigAttributes.put(ConfiguredObject.TYPE, System.getProperty("broker.config-store-type",
"JSON"));
+            systemConfigAttributes.put(SystemConfig.STARTUP_LOGGED_TO_SYSTEM_OUT, Boolean.FALSE);
 
             if (Thread.getDefaultUncaughtExceptionHandler() == null)
             {

Modified: qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/FrameTransport.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/FrameTransport.java?rev=1791672&r1=1791671&r2=1791672&view=diff
==============================================================================
--- qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/FrameTransport.java
(original)
+++ qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/FrameTransport.java
Mon Apr 17 09:49:30 2017
@@ -62,6 +62,7 @@ import org.apache.qpid.server.protocol.v
 import org.apache.qpid.server.protocol.v1_0.type.messaging.Target;
 import org.apache.qpid.server.protocol.v1_0.type.transport.Attach;
 import org.apache.qpid.server.protocol.v1_0.type.transport.Begin;
+import org.apache.qpid.server.protocol.v1_0.type.transport.Close;
 import org.apache.qpid.server.protocol.v1_0.type.transport.Flow;
 import org.apache.qpid.server.protocol.v1_0.type.transport.Open;
 import org.apache.qpid.server.protocol.v1_0.type.transport.Role;
@@ -112,6 +113,7 @@ public class FrameTransport implements A
     {
         try
         {
+            _channel.disconnect().sync();
             _channel.close().sync();
         }
         finally
@@ -198,6 +200,18 @@ public class FrameTransport implements A
         }
     }
 
+    public void doCloseConnection() throws Exception
+    {
+        Close close = new Close();
+
+        sendPerformative(close, UnsignedShort.valueOf((short) 0));
+        PerformativeResponse response = (PerformativeResponse) getNextResponse();
+        if (!(response.getFrameBody() instanceof Close))
+        {
+            throw new IllegalStateException("Unexpected response to connection Close");
+        }
+    }
+
     public void doBeginSession() throws Exception
     {
         doOpenConnection();

Modified: qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java?rev=1791672&r1=1791671&r2=1791672&view=diff
==============================================================================
--- qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java
(original)
+++ qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java
Mon Apr 17 09:49:30 2017
@@ -195,7 +195,6 @@ public class TransferTest extends Protoc
             final PerformativeResponse closeResponse = (PerformativeResponse) transport.getNextResponse();
             assertThat(closeResponse, is(notNullValue()));
             assertThat(closeResponse.getFrameBody(), is(instanceOf(Close.class)));
-            transport.assertNoMoreResponses();
         }
     }
 }

Modified: qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/connection/OpenTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/connection/OpenTest.java?rev=1791672&r1=1791671&r2=1791672&view=diff
==============================================================================
--- qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/connection/OpenTest.java
(original)
+++ qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/connection/OpenTest.java
Mon Apr 17 09:49:30 2017
@@ -92,7 +92,8 @@ public class OpenTest extends ProtocolTe
                        is(both(greaterThanOrEqualTo(0L)).and(lessThan(UnsignedInteger.MAX_VALUE.longValue()))));
             assertThat(responseOpen.getChannelMax().intValue(),
                        is(both(greaterThanOrEqualTo(0)).and(lessThan(UnsignedShort.MAX_VALUE.intValue()))));
-            transport.assertNoMoreResponses();
+
+            transport.doCloseConnection();
         }
     }
 

Modified: qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/session/BeginTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/session/BeginTest.java?rev=1791672&r1=1791671&r2=1791672&view=diff
==============================================================================
--- qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/session/BeginTest.java
(original)
+++ qpid/java/trunk/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/session/BeginTest.java
Mon Apr 17 09:49:30 2017
@@ -89,7 +89,8 @@ public class BeginTest extends ProtocolT
             assertThat(responseBegin.getIncomingWindow(), is(instanceOf(UnsignedInteger.class)));
             assertThat(responseBegin.getOutgoingWindow(), is(instanceOf(UnsignedInteger.class)));
             assertThat(responseBegin.getNextOutgoingId(), is(instanceOf(UnsignedInteger.class)));
-            transport.assertNoMoreResponses();
+
+            transport.doCloseConnection();
         }
     }
 }



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


Mime
View raw message