You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2018/08/13 22:23:23 UTC

activemq-artemis git commit: NO-JIRA fixing broken test

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 8d0338ebc -> 4dd116ee0


NO-JIRA fixing broken test


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

Branch: refs/heads/master
Commit: 4dd116ee04400c2e24f0e5737f4cfa5b97cb05a5
Parents: 8d0338e
Author: Clebert Suconic <cl...@apache.org>
Authored: Mon Aug 13 18:10:24 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Mon Aug 13 18:10:24 2018 -0400

----------------------------------------------------------------------
 .../integration/jms/jms2client/BodyTest.java    | 27 +++++++-------------
 1 file changed, 9 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4dd116ee/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/BodyTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/BodyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/BodyTest.java
index 3409ee0..826a4c6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/BodyTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/BodyTest.java
@@ -20,12 +20,12 @@ import javax.jms.BytesMessage;
 import javax.jms.Connection;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
+import javax.jms.MessageFormatException;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
-import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -48,6 +48,7 @@ public class BodyTest extends JMSTestBase {
       try (
          Connection conn = cf.createConnection();
       ) {
+
          Session sess = conn.createSession();
          MessageProducer producer = sess.createProducer(queue);
 
@@ -55,27 +56,17 @@ public class BodyTest extends JMSTestBase {
          conn.start();
 
          BytesMessage bytesMessage = sess.createBytesMessage();
-         BytesMessage bytesMessage2 = sess.createBytesMessage();
-         bytesMessage2.writeInt(42);
-         bytesMessage2.reset();
-
          producer.send(bytesMessage);
-         Message msg = cons.receiveNoWait();
-
-         producer.send(bytesMessage2);
-         Message msg2 = cons.receiveNoWait();
 
+         Message msg = cons.receiveNoWait();
          assertNotNull(msg);
-         assertNotNull(msg2);
-
-         // message body is empty. getBody parameter may be set to any type
-         Assert.assertNull(msg.getBody(java.lang.Object.class));
-         Assert.assertNull(msg.getBody(byte[].class));
-         Assert.assertNull(msg.getBody(String.class));
 
-         // message body is not empty. getBody parameter must be set to byte[].class (or java.lang.Object.class)
-         Assert.assertNotNull(msg2.getBody(byte[].class));
-         Assert.assertNotNull(msg2.getBody(java.lang.Object.class));
+         try {
+            msg.getBody(String.class);
+            fail("Exception expected");
+         } catch (MessageFormatException e) {
+         }
       }
+
    }
 }