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 Tue, 27 Sep 2016 21:08:37 GMT
Repository: activemq
Updated Branches:
  refs/heads/master b1a9a9382 -> 45f60e413


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

Remove redundant tests and clean up a few small nits.

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

Branch: refs/heads/master
Commit: 45f60e4133f64603d5f1a5161c363eb185d2804d
Parents: b1a9a93
Author: Timothy Bish <tabish121@gmail.com>
Authored: Tue Sep 27 17:08:28 2016 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Tue Sep 27 17:08:28 2016 -0400

----------------------------------------------------------------------
 .../message/JMSMappingOutboundTransformer.java  |  5 +-
 .../JMSTransformationSpeedComparisonTest.java   | 65 --------------------
 2 files changed, 2 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/45f60e41/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformer.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformer.java
b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformer.java
index fa915e8..69039ea 100644
--- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformer.java
+++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformer.java
@@ -220,7 +220,7 @@ public class JMSMappingOutboundTransformer implements OutboundTransformer
{
             if (header == null) {
                 header = new Header();
             }
-            header.setDeliveryCount(new UnsignedInteger(deliveryCount));
+            header.setDeliveryCount(UnsignedInteger.valueOf(deliveryCount));
         }
         String userId = message.getUserID();
         if (userId != null) {
@@ -238,11 +238,10 @@ public class JMSMappingOutboundTransformer implements OutboundTransformer
{
         }
         int groupSequence = message.getGroupSequence();
         if (groupSequence > 0) {
-            UnsignedInteger value = new UnsignedInteger(groupSequence);
             if (properties == null) {
                 properties = new Properties();
             }
-            properties.setGroupSequence(value);
+            properties.setGroupSequence(UnsignedInteger.valueOf(groupSequence));
         }
 
         final Map<String, Object> entries;

http://git-wip-us.apache.org/repos/asf/activemq/blob/45f60e41/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSTransformationSpeedComparisonTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSTransformationSpeedComparisonTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSTransformationSpeedComparisonTest.java
index 204c652..cd93af7 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSTransformationSpeedComparisonTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSTransformationSpeedComparisonTest.java
@@ -16,10 +16,6 @@
  */
 package org.apache.activemq.transport.amqp.message;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
@@ -277,67 +273,6 @@ public class JMSTransformationSpeedComparisonTest {
             transformer, PROFILE_CYCLES, TimeUnit.NANOSECONDS.toMillis(totalDuration), test.getMethodName());
     }
 
-    @Test
-    public void testEncodeDecodeIsWorking() throws Exception {
-        Message incomingMessage = createTypicalQpidJMSMessage();
-        EncodedMessage encoded = encode(incomingMessage);
-        InboundTransformer inboundTransformer = getInboundTransformer();
-        OutboundTransformer outboundTransformer = getOutboundTransformer();
-
-        ActiveMQMessage outbound = inboundTransformer.transform(encoded);
-        outbound.onSend();
-        Message outboudMessage = outboundTransformer.transform(outbound).decode();
-
-        // Test that message details are equal
-        assertEquals(incomingMessage.getAddress(), outboudMessage.getAddress());
-        assertEquals(incomingMessage.getDeliveryCount(), outboudMessage.getDeliveryCount());
-        assertEquals(incomingMessage.getCreationTime(), outboudMessage.getCreationTime());
-        assertEquals(incomingMessage.getContentType(), outboudMessage.getContentType());
-
-        // Test Message annotations
-        ApplicationProperties incomingApplicationProperties = incomingMessage.getApplicationProperties();
-        ApplicationProperties outgoingApplicationProperties = outboudMessage.getApplicationProperties();
-
-        assertEquals(incomingApplicationProperties.getValue(), outgoingApplicationProperties.getValue());
-
-        // Test Message properties
-        MessageAnnotations incomingMessageAnnotations = incomingMessage.getMessageAnnotations();
-        MessageAnnotations outgoingMessageAnnotations = outboudMessage.getMessageAnnotations();
-
-        assertEquals(incomingMessageAnnotations.getValue(), outgoingMessageAnnotations.getValue());
-
-        // Test that bodies are equal
-        assertTrue(incomingMessage.getBody() instanceof AmqpValue);
-        assertTrue(outboudMessage.getBody() instanceof AmqpValue);
-
-        AmqpValue incomingBody = (AmqpValue) incomingMessage.getBody();
-        AmqpValue outgoingBody = (AmqpValue) outboudMessage.getBody();
-
-        assertTrue(incomingBody.getValue() instanceof String);
-        assertTrue(outgoingBody.getValue() instanceof String);
-
-        assertEquals(incomingBody.getValue(), outgoingBody.getValue());
-    }
-
-    @Test
-    public void testBodyOnlyEncodeDecode() throws Exception {
-
-        Message incomingMessage = Proton.message();
-
-        incomingMessage.setBody(new AmqpValue("String payload for AMQP message conversion
performance testing."));
-
-        EncodedMessage encoded = encode(incomingMessage);
-        InboundTransformer inboundTransformer = getInboundTransformer();
-        OutboundTransformer outboundTransformer = getOutboundTransformer();
-
-        ActiveMQMessage intermediate = inboundTransformer.transform(encoded);
-        intermediate.onSend();
-        Message outboudMessage = outboundTransformer.transform(intermediate).decode();
-
-        assertNull(outboudMessage.getHeader());
-        assertNull(outboudMessage.getProperties());
-    }
-
     private Message createTypicalQpidJMSMessage() {
         Map<String, Object> applicationProperties = new HashMap<String, Object>();
         Map<Symbol, Object> messageAnnotations = new HashMap<Symbol, Object>();


Mime
View raw message