activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-6438
Date Fri, 30 Sep 2016 19:54:39 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 02082b1ae -> ee9f316c2


https://issues.apache.org/jira/browse/AMQ-6438

Add an additional test that accounts for the fallback transformer case.

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

Branch: refs/heads/master
Commit: ee9f316c20a991fcb3dcf3d89ef6e4011f708c72
Parents: 02082b1
Author: Timothy Bish <tabish121@gmail.com>
Authored: Fri Sep 30 15:54:09 2016 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Fri Sep 30 15:54:33 2016 -0400

----------------------------------------------------------------------
 .../amqp/message/MessageTransformationTest.java | 33 +++++++++++++++-----
 1 file changed, 26 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/ee9f316c/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/MessageTransformationTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/MessageTransformationTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/MessageTransformationTest.java
index c92e9ea..b2ab646 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/MessageTransformationTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/MessageTransformationTest.java
@@ -35,6 +35,7 @@ import org.apache.qpid.proton.amqp.Symbol;
 import org.apache.qpid.proton.amqp.messaging.AmqpValue;
 import org.apache.qpid.proton.amqp.messaging.ApplicationProperties;
 import org.apache.qpid.proton.amqp.messaging.MessageAnnotations;
+import org.apache.qpid.proton.amqp.messaging.Section;
 import org.apache.qpid.proton.codec.CompositeWritableBuffer;
 import org.apache.qpid.proton.codec.DroppingWritableBuffer;
 import org.apache.qpid.proton.codec.WritableBuffer;
@@ -87,13 +88,7 @@ public class MessageTransformationTest {
     }
 
     private OutboundTransformer getOutboundTransformer() {
-        switch (transformer) {
-            case "raw":
-            case "native":
-                return new AMQPNativeOutboundTransformer();
-            default:
-                return new JMSMappingOutboundTransformer();
-        }
+        return new AutoOutboundTransformer();
     }
 
     @Test
@@ -217,6 +212,30 @@ public class MessageTransformationTest {
     }
 
     @Test
+    public void testMessageWithAmqpValueThatFailsJMSConversion() throws Exception {
+
+        Message incomingMessage = Proton.message();
+
+        incomingMessage.setBody(new AmqpValue(new Boolean(true)));
+
+        EncodedMessage encoded = encode(incomingMessage);
+        InboundTransformer inboundTransformer = getInboundTransformer();
+        OutboundTransformer outboundTransformer = getOutboundTransformer();
+
+        ActiveMQMessage intermediate = inboundTransformer.transform(encoded);
+        intermediate.onSend();
+        Message outboudMessage = outboundTransformer.transform(intermediate).decode();
+
+        Section section = outboudMessage.getBody();
+        assertNotNull(section);
+        assertTrue(section instanceof AmqpValue);
+        AmqpValue amqpValue = (AmqpValue) section;
+        assertNotNull(amqpValue.getValue());
+        assertTrue(amqpValue.getValue() instanceof Boolean);
+        assertEquals(true, amqpValue.getValue());
+    }
+
+    @Test
     public void testComplexQpidJMSMessageEncodeDecode() throws Exception {
 
         Map<String, Object> applicationProperties = new HashMap<String, Object>();


Mime
View raw message