activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: Add a negative validation test.
Date Fri, 12 Jun 2015 19:39:52 GMT
Repository: activemq
Updated Branches:
  refs/heads/master d723d14ac -> d74c08713


Add a negative validation test. 

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/d74c0871
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/d74c0871
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/d74c0871

Branch: refs/heads/master
Commit: d74c0871347b509a610d585188f61142e3d06b50
Parents: d723d14
Author: Timothy Bish <tabish121@gmail.com>
Authored: Fri Jun 12 15:39:17 2015 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Fri Jun 12 15:39:17 2015 -0400

----------------------------------------------------------------------
 .../amqp/interop/AmqpSendReceiveTest.java          | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/d74c0871/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
index 29ff954..906febf 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
@@ -19,6 +19,7 @@ package org.apache.activemq.transport.amqp.interop;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
 import java.util.concurrent.TimeUnit;
@@ -86,23 +87,29 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
         AmqpConnection connection = client.connect();
         AmqpSession session = connection.createSession();
 
-        AmqpMessage message = new AmqpMessage();
+        AmqpMessage message1 = new AmqpMessage();
+        message1.setGroupId("abcdefg");
+        message1.setApplicationProperty("sn", 100);
 
-        message.setGroupId("abcdefg");
-        message.setApplicationProperty("sn", 100);
+        AmqpMessage message2 = new AmqpMessage();
+        message2.setGroupId("hijklm");
+        message2.setApplicationProperty("sn", 200);
 
         AmqpSender sender = session.createSender("queue://" + getTestName());
-        sender.send(message);
+        sender.send(message1);
+        sender.send(message2);
         sender.close();
 
         AmqpReceiver receiver = session.createReceiver("queue://" + getTestName(), "sn =
100");
-        receiver.flow(1);
+        receiver.flow(2);
         AmqpMessage received = receiver.receive(5, TimeUnit.SECONDS);
         assertNotNull(received);
         assertEquals(100, received.getApplicationProperty("sn"));
         assertEquals("abcdefg", received.getGroupId());
         received.accept();
 
+        assertNull(receiver.receive(1, TimeUnit.SECONDS));
+
         receiver.close();
     }
 


Mime
View raw message