From 37b1b6a211b75a376014620624ca6fe046d3f7a6 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Thu, 19 Feb 2015 19:43:11 +0000 Subject: [PATCH] AMQ-5592: remove some unused stale functionlity, bring into line with latest missed commits from current almost-0.9 codebase. https://issues.apache.org/jira/browse/AMQ-5592 --- .../amqp/message/AutoOutboundTransformer.java | 7 - .../amqp/message/InboundTransformer.java | 87 ++++-------- .../JMSMappingOutboundTransformer.java | 46 ++---- .../transport/amqp/message/JMSVendor.java | 5 - .../amqp/message/OutboundTransformer.java | 14 +- .../JMSMappingInboundTransformerTest.java | 87 ++---------- .../JMSMappingOutboundTransformerTest.java | 133 ++---------------- 7 files changed, 63 insertions(+), 316 deletions(-) diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/AutoOutboundTransformer.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/AutoOutboundTransformer.java index 0f0d7b2047..f30d4c4c5a 100644 --- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/AutoOutboundTransformer.java +++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/AutoOutboundTransformer.java @@ -42,11 +42,4 @@ public class AutoOutboundTransformer extends JMSMappingOutboundTransformer { return transformer.transform(msg); } } - - @Override - public void setUseByteDestinationTypeAnnotations(boolean useByteDestinationTypeAnnotations) - { - super.setUseByteDestinationTypeAnnotations(useByteDestinationTypeAnnotations); - transformer.setUseByteDestinationTypeAnnotations(useByteDestinationTypeAnnotations); - } } diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java index 9e5758cde8..a346899bf5 100644 --- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java +++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java @@ -63,22 +63,12 @@ public abstract class InboundTransformer { int defaultPriority = javax.jms.Message.DEFAULT_PRIORITY; long defaultTtl = javax.jms.Message.DEFAULT_TIME_TO_LIVE; - private boolean useByteDestinationTypeAnnotations = false; - public InboundTransformer(JMSVendor vendor) { this.vendor = vendor; } abstract public Message transform(EncodedMessage amqpMessage) throws Exception; - public boolean isUseByteDestinationTypeAnnotations() { - return useByteDestinationTypeAnnotations; - } - - public void setUseByteDestinationTypeAnnotations(boolean useByteDestinationTypeAnnotations) { - this.useByteDestinationTypeAnnotations = useByteDestinationTypeAnnotations; - } - public int getDefaultDeliveryMode() { return defaultDeliveryMode; } @@ -151,16 +141,8 @@ public abstract class InboundTransformer { } } - Class toAttributes = null; - Class replyToAttributes = null; - - if (isUseByteDestinationTypeAnnotations()) { - toAttributes = Queue.class; - replyToAttributes = Queue.class; - } else { - toAttributes = Destination.class; - replyToAttributes = Destination.class; - } + Class toAttributes = Destination.class; + Class replyToAttributes = Destination.class; final MessageAnnotations ma = amqp.getMessageAnnotations(); if (ma != null) { @@ -169,9 +151,9 @@ public abstract class InboundTransformer { if ("x-opt-jms-type".equals(key.toString()) && entry.getValue() != null) { jms.setJMSType(entry.getValue().toString()); } else if ("x-opt-to-type".equals(key.toString())) { - toAttributes = toClassFromAttributes(entry.getValue()); + toAttributes = toClassFromAttributes(entry.getValue().toString()); } else if ("x-opt-reply-type".equals(key.toString())) { - replyToAttributes = toClassFromAttributes(entry.getValue()); + replyToAttributes = toClassFromAttributes(entry.getValue().toString()); } else { setProperty(jms, prefixVendor + prefixMessageAnnotations + key, entry.getValue()); } @@ -274,48 +256,27 @@ public abstract class InboundTransformer { return Collections.unmodifiableSet(s); } - Class toClassFromAttributes(Object value) { - if (isUseByteDestinationTypeAnnotations()) { - if (value instanceof Byte) { - switch ((Byte) value) { - case JMSVendor.QUEUE_TYPE: - return Queue.class; - case JMSVendor.TOPIC_TYPE: - return Topic.class; - case JMSVendor.TEMP_QUEUE_TYPE: - return TemporaryQueue.class; - case JMSVendor.TEMP_TOPIC_TYPE: - return TemporaryTopic.class; - default: - return Queue.class; - } - } - - return Queue.class; - } else { - if (value == null) { - return null; - } - String valueString = value.toString(); - HashSet attributes = new HashSet(); - for (String x : valueString.split("\\s*,\\s*")) { - attributes.add(x); - } - - if (QUEUE_ATTRIBUTES.equals(attributes)) { - return Queue.class; - } - if (TOPIC_ATTRIBUTES.equals(attributes)) { - return Topic.class; - } - if (TEMP_QUEUE_ATTRIBUTES.equals(attributes)) { - return TemporaryQueue.class; - } - if (TEMP_TOPIC_ATTRIBUTES.equals(attributes)) { - return TemporaryTopic.class; - } - return Destination.class; + Class toClassFromAttributes(String value) { + if( value ==null ) { + return null; } + HashSet attributes = new HashSet(); + for( String x: value.split("\\s*,\\s*") ) { + attributes.add(x); + } + if( QUEUE_ATTRIBUTES.equals(attributes) ) { + return Queue.class; + } + if( TOPIC_ATTRIBUTES.equals(attributes) ) { + return Topic.class; + } + if( TEMP_QUEUE_ATTRIBUTES.equals(attributes) ) { + return TemporaryQueue.class; + } + if( TEMP_TOPIC_ATTRIBUTES.equals(attributes) ) { + return TemporaryTopic.class; + } + return Destination.class; } private void setProperty(Message msg, String key, Object value) throws JMSException { 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 768bb24a93..1a837aed80 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 @@ -276,39 +276,21 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer { return (ProtonJMessage) org.apache.qpid.proton.message.Message.Factory.create(header, da, ma, props, ap, body, footer); } - private Object destinationAttributes(Destination destination) { - if (isUseByteDestinationTypeAnnotations()) { - if (destination instanceof Queue) { - if (destination instanceof TemporaryQueue) { - return JMSVendor.TEMP_QUEUE_TYPE; - } else { - return JMSVendor.QUEUE_TYPE; - } + private static String destinationAttributes(Destination destination) { + if (destination instanceof Queue) { + if (destination instanceof TemporaryQueue) { + return "temporary,queue"; + } else { + return "queue"; } - if (destination instanceof Topic) { - if (destination instanceof TemporaryTopic) { - return JMSVendor.TEMP_TOPIC_TYPE; - } else { - return JMSVendor.TOPIC_TYPE; - } - } - return JMSVendor.QUEUE_TYPE; - } else { - if (destination instanceof Queue) { - if (destination instanceof TemporaryQueue) { - return "temporary,queue"; - } else { - return "queue"; - } - } - if (destination instanceof Topic) { - if (destination instanceof TemporaryTopic) { - return "temporary,topic"; - } else { - return "topic"; - } - } - return ""; } + if (destination instanceof Topic) { + if (destination instanceof TemporaryTopic) { + return "temporary,topic"; + } else { + return "topic"; + } + } + return ""; } } diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSVendor.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSVendor.java index 33d77c40ce..0fdee0d1c0 100644 --- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSVendor.java +++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/JMSVendor.java @@ -26,11 +26,6 @@ import javax.jms.TextMessage; abstract public class JMSVendor { - public static final byte QUEUE_TYPE = 0x00; - public static final byte TOPIC_TYPE = 0x01; - public static final byte TEMP_QUEUE_TYPE = 0x02; - public static final byte TEMP_TOPIC_TYPE = 0x03; - public abstract BytesMessage createBytesMessage(); public abstract StreamMessage createStreamMessage(); diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/OutboundTransformer.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/OutboundTransformer.java index 6c7d8adcb8..61749d15e8 100644 --- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/OutboundTransformer.java +++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/OutboundTransformer.java @@ -38,25 +38,13 @@ public abstract class OutboundTransformer { String replyToGroupIDKey; String prefixFooterKey; - private boolean useByteDestinationTypeAnnotations; - - public OutboundTransformer(JMSVendor vendor) { + public OutboundTransformer(JMSVendor vendor) { this.vendor = vendor; this.setPrefixVendor("JMS_AMQP_"); } public abstract EncodedMessage transform(Message jms) throws Exception; - public boolean isUseByteDestinationTypeAnnotations() - { - return useByteDestinationTypeAnnotations; - } - - public void setUseByteDestinationTypeAnnotations(boolean useByteDestinationTypeAnnotations) - { - this.useByteDestinationTypeAnnotations = useByteDestinationTypeAnnotations; - } - public String getPrefixVendor() { return prefixVendor; } diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSMappingInboundTransformerTest.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSMappingInboundTransformerTest.java index 576c06ef23..1d66a4017d 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSMappingInboundTransformerTest.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSMappingInboundTransformerTest.java @@ -59,67 +59,35 @@ public class JMSMappingInboundTransformerTest { // ======= JMSDestination Handling ========= - // --- String type annotation --- @Test public void testTransformWithNoToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithToTypeDestinationTypeAnnotationTestImpl(null, Destination.class, false); + doTransformWithToTypeDestinationTypeAnnotationTestImpl(null, Destination.class); } @Test public void testTransformWithQueueStringToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithToTypeDestinationTypeAnnotationTestImpl("queue", Queue.class, false); + doTransformWithToTypeDestinationTypeAnnotationTestImpl("queue", Queue.class); } @Test public void testTransformWithTemporaryQueueStringToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithToTypeDestinationTypeAnnotationTestImpl("queue,temporary", TemporaryQueue.class, false); + doTransformWithToTypeDestinationTypeAnnotationTestImpl("queue,temporary", TemporaryQueue.class); } @Test public void testTransformWithTopicStringToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithToTypeDestinationTypeAnnotationTestImpl("topic", Topic.class, false); + doTransformWithToTypeDestinationTypeAnnotationTestImpl("topic", Topic.class); } @Test public void testTransformWithTemporaryTopicStringToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithToTypeDestinationTypeAnnotationTestImpl("topic,temporary", TemporaryTopic.class, false); + doTransformWithToTypeDestinationTypeAnnotationTestImpl("topic,temporary", TemporaryTopic.class); } - // --- byte type annotation --- - - @Test - public void testTransformWithNoToTypeDestinationTypeAnnotationUsingByteAnnotation() throws Exception { - doTransformWithToTypeDestinationTypeAnnotationTestImpl(null, Queue.class, true); - } - - @Test - public void testTransformWithQueueByteToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithToTypeDestinationTypeAnnotationTestImpl(JMSVendor.QUEUE_TYPE, Queue.class, true); - } - - @Test - public void testTransformWithTemporaryQueueByteToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithToTypeDestinationTypeAnnotationTestImpl(JMSVendor.TEMP_QUEUE_TYPE, TemporaryQueue.class, true); - } - - @Test - public void testTransformWithTopicByteToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithToTypeDestinationTypeAnnotationTestImpl(JMSVendor.TOPIC_TYPE, Topic.class, true); - } - - @Test - public void testTransformWithTemporaryTopicByteToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithToTypeDestinationTypeAnnotationTestImpl(JMSVendor.TEMP_TOPIC_TYPE, TemporaryTopic.class, true); - } - - private void doTransformWithToTypeDestinationTypeAnnotationTestImpl(Object toTypeAnnotationValue, Class expectedClass, - boolean byteType) throws Exception { + private void doTransformWithToTypeDestinationTypeAnnotationTestImpl(Object toTypeAnnotationValue, Class expectedClass) throws Exception { TextMessage mockTextMessage = createMockTextMessage(); JMSVendor mockVendor = createMockVendor(mockTextMessage); JMSMappingInboundTransformer transformer = new JMSMappingInboundTransformer(mockVendor); - if (byteType) { - transformer.setUseByteDestinationTypeAnnotations(true); - } String toAddress = "toAddress"; Message amqp = Message.Factory.create(); @@ -144,66 +112,35 @@ public class JMSMappingInboundTransformerTest { // ======= JMSReplyTo Handling ========= - // --- String type annotation --- @Test public void testTransformWithNoReplyToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl(null, Destination.class, false); + doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl(null, Destination.class); } @Test public void testTransformWithQueueStringReplyToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl("queue", Queue.class, false); + doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl("queue", Queue.class); } @Test public void testTransformWithTemporaryQueueStringReplyToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl("queue,temporary", TemporaryQueue.class, false); + doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl("queue,temporary", TemporaryQueue.class); } @Test public void testTransformWithTopicStringReplyToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl("topic", Topic.class, false); + doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl("topic", Topic.class); } @Test public void testTransformWithTemporaryTopicStringReplyToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl("topic,temporary", TemporaryTopic.class, false); + doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl("topic,temporary", TemporaryTopic.class); } - // --- byte type annotation --- - @Test - public void testTransformWithNoReplyToTypeDestinationTypeAnnotationUsingByteAnnotation() throws Exception { - doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl(null, Queue.class, true); - } - - @Test - public void testTransformWithQueueByteReplyToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl(JMSVendor.QUEUE_TYPE, Queue.class, true); - } - - @Test - public void testTransformWithTemporaryQueueByteReplyToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl(JMSVendor.TEMP_QUEUE_TYPE, TemporaryQueue.class, true); - } - - @Test - public void testTransformWithTopicByteReplyToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl(JMSVendor.TOPIC_TYPE, Topic.class, true); - } - - @Test - public void testTransformWithTemporaryTopicByteReplyToTypeDestinationTypeAnnotation() throws Exception { - doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl(JMSVendor.TEMP_TOPIC_TYPE, TemporaryTopic.class, true); - } - - private void doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl(Object replyToTypeAnnotationValue, Class expectedClass, - boolean byteType) throws Exception { + private void doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl(Object replyToTypeAnnotationValue, Class expectedClass) throws Exception { TextMessage mockTextMessage = createMockTextMessage(); JMSVendor mockVendor = createMockVendor(mockTextMessage); JMSMappingInboundTransformer transformer = new JMSMappingInboundTransformer(mockVendor); - if (byteType) { - transformer.setUseByteDestinationTypeAnnotations(true); - } String replyToAddress = "replyToAddress"; Message amqp = Message.Factory.create(); diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformerTest.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformerTest.java index 0c4a9c2fb2..ac92d8f9d9 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformerTest.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/JMSMappingOutboundTransformerTest.java @@ -57,103 +57,42 @@ public class JMSMappingOutboundTransformerTest { assertEquals(contentString, ((AmqpValue) amqp.getBody()).getValue()); } - @Test - public void testDefaultsTolStringDestinationTypeAnnotationValues() { - JMSVendor mockVendor = createMockVendor(); - JMSMappingOutboundTransformer transformer = new JMSMappingOutboundTransformer(mockVendor); - - assertFalse("Expected the older string style annotation values to be used by default", transformer.isUseByteDestinationTypeAnnotations()); - } - - @Test - public void testSetGetIsUseByteDestinationTypeAnnotations() { - JMSVendor mockVendor = createMockVendor(); - JMSMappingOutboundTransformer transformer = new JMSMappingOutboundTransformer(mockVendor); - - assertFalse(transformer.isUseByteDestinationTypeAnnotations()); - transformer.setUseByteDestinationTypeAnnotations(true); - assertTrue(transformer.isUseByteDestinationTypeAnnotations()); - } - // ======= JMSDestination Handling ========= - // --- String type annotation --- @Test public void testConvertMessageWithJMSDestinationNull() throws Exception { - doTestConvertMessageWithJMSDestination(null, null, false); + doTestConvertMessageWithJMSDestination(null, null); } @Test public void testConvertMessageWithJMSDestinationQueue() throws Exception { Queue mockDest = Mockito.mock(Queue.class); - doTestConvertMessageWithJMSDestination(mockDest, "queue", false); + doTestConvertMessageWithJMSDestination(mockDest, "queue"); } @Test public void testConvertMessageWithJMSDestinationTemporaryQueue() throws Exception { TemporaryQueue mockDest = Mockito.mock(TemporaryQueue.class); - doTestConvertMessageWithJMSDestination(mockDest, "temporary,queue", false); + doTestConvertMessageWithJMSDestination(mockDest, "temporary,queue"); } @Test public void testConvertMessageWithJMSDestinationTopic() throws Exception { Topic mockDest = Mockito.mock(Topic.class); - doTestConvertMessageWithJMSDestination(mockDest, "topic", false); + doTestConvertMessageWithJMSDestination(mockDest, "topic"); } @Test public void testConvertMessageWithJMSDestinationTemporaryTopic() throws Exception { TemporaryTopic mockDest = Mockito.mock(TemporaryTopic.class); - doTestConvertMessageWithJMSDestination(mockDest, "temporary,topic", false); + doTestConvertMessageWithJMSDestination(mockDest, "temporary,topic"); } - // --- byte type annotation --- - - @Test - public void testConvertMessageWithJMSDestinationNullUsingByteAnnotation() throws Exception { - doTestConvertMessageWithJMSDestination(null, null, true); - } - - @Test - public void testConvertMessageWithJMSDestinationQueueUsingByteAnnotation() throws Exception { - Queue mockDest = Mockito.mock(Queue.class); - - doTestConvertMessageWithJMSDestination(mockDest, JMSVendor.QUEUE_TYPE, true); - } - - @Test - public void testConvertMessageWithJMSDestinationTemporaryQueueUsingByteAnnotation() throws Exception { - TemporaryQueue mockDest = Mockito.mock(TemporaryQueue.class); - - doTestConvertMessageWithJMSDestination(mockDest, JMSVendor.TEMP_QUEUE_TYPE, true); - } - - @Test - public void testConvertMessageWithJMSDestinationTopicUsingByteAnnotation() throws Exception { - Topic mockDest = Mockito.mock(Topic.class); - - doTestConvertMessageWithJMSDestination(mockDest, JMSVendor.TOPIC_TYPE, true); - } - - @Test - public void testConvertMessageWithJMSDestinationTemporaryTopicUsingByteAnnotation() throws Exception { - TemporaryTopic mockDest = Mockito.mock(TemporaryTopic.class); - - doTestConvertMessageWithJMSDestination(mockDest, JMSVendor.TEMP_TOPIC_TYPE, true); - } - - @Test - public void testConvertMessageWithJMSDestinationUnkownUsingByteAnnotation() throws Exception { - Destination mockDest = Mockito.mock(Destination.class); - - doTestConvertMessageWithJMSDestination(mockDest, JMSVendor.QUEUE_TYPE, true); - } - - private void doTestConvertMessageWithJMSDestination(Destination jmsDestination, Object expectedAnnotationValue, boolean byteType) throws Exception { + private void doTestConvertMessageWithJMSDestination(Destination jmsDestination, Object expectedAnnotationValue) throws Exception { TextMessage mockTextMessage = createMockTextMessage(); Mockito.when(mockTextMessage.getText()).thenReturn("myTextMessageContent"); Mockito.when(mockTextMessage.getJMSDestination()).thenReturn(jmsDestination); @@ -164,9 +103,6 @@ public class JMSMappingOutboundTransformerTest { } JMSMappingOutboundTransformer transformer = new JMSMappingOutboundTransformer(mockVendor); - if (byteType) { - transformer.setUseByteDestinationTypeAnnotations(true); - } Message amqp = transformer.convert(mockTextMessage); @@ -186,82 +122,40 @@ public class JMSMappingOutboundTransformerTest { // ======= JMSReplyTo Handling ========= - // --- String type annotation --- @Test public void testConvertMessageWithJMSReplyToNull() throws Exception { - doTestConvertMessageWithJMSReplyTo(null, null, false); + doTestConvertMessageWithJMSReplyTo(null, null); } @Test public void testConvertMessageWithJMSReplyToQueue() throws Exception { Queue mockDest = Mockito.mock(Queue.class); - doTestConvertMessageWithJMSReplyTo(mockDest, "queue", false); + doTestConvertMessageWithJMSReplyTo(mockDest, "queue"); } @Test public void testConvertMessageWithJMSReplyToTemporaryQueue() throws Exception { TemporaryQueue mockDest = Mockito.mock(TemporaryQueue.class); - doTestConvertMessageWithJMSReplyTo(mockDest, "temporary,queue", false); + doTestConvertMessageWithJMSReplyTo(mockDest, "temporary,queue"); } @Test public void testConvertMessageWithJMSReplyToTopic() throws Exception { Topic mockDest = Mockito.mock(Topic.class); - doTestConvertMessageWithJMSReplyTo(mockDest, "topic", false); + doTestConvertMessageWithJMSReplyTo(mockDest, "topic"); } @Test public void testConvertMessageWithJMSReplyToTemporaryTopic() throws Exception { TemporaryTopic mockDest = Mockito.mock(TemporaryTopic.class); - doTestConvertMessageWithJMSReplyTo(mockDest, "temporary,topic", false); + doTestConvertMessageWithJMSReplyTo(mockDest, "temporary,topic"); } - // --- byte type annotation --- - @Test - public void testConvertMessageWithJMSReplyToNullUsingByteAnnotation() throws Exception { - doTestConvertMessageWithJMSReplyTo(null, null, true); - } - - @Test - public void testConvertMessageWithJMSReplyToQueueUsingByteAnnotation() throws Exception { - Queue mockDest = Mockito.mock(Queue.class); - - doTestConvertMessageWithJMSReplyTo(mockDest, JMSVendor.QUEUE_TYPE, true); - } - - @Test - public void testConvertMessageWithJMSReplyToTemporaryQueueUsingByteAnnotation() throws Exception { - TemporaryQueue mockDest = Mockito.mock(TemporaryQueue.class); - - doTestConvertMessageWithJMSReplyTo(mockDest, JMSVendor.TEMP_QUEUE_TYPE, true); - } - - @Test - public void testConvertMessageWithJMSReplyToTopicUsingByteAnnotation() throws Exception { - Topic mockDest = Mockito.mock(Topic.class); - - doTestConvertMessageWithJMSReplyTo(mockDest, JMSVendor.TOPIC_TYPE, true); - } - - @Test - public void testConvertMessageWithJMSReplyToTemporaryTopicUsingByteAnnotation() throws Exception { - TemporaryTopic mockDest = Mockito.mock(TemporaryTopic.class); - - doTestConvertMessageWithJMSReplyTo(mockDest, JMSVendor.TEMP_TOPIC_TYPE, true); - } - - @Test - public void testConvertMessageWithJMSReplyToUnkownUsingByteAnnotation() throws Exception { - Destination mockDest = Mockito.mock(Destination.class); - - doTestConvertMessageWithJMSReplyTo(mockDest, JMSVendor.QUEUE_TYPE, true); - } - - private void doTestConvertMessageWithJMSReplyTo(Destination jmsReplyTo, Object expectedAnnotationValue, boolean byteType) throws Exception { + private void doTestConvertMessageWithJMSReplyTo(Destination jmsReplyTo, Object expectedAnnotationValue) throws Exception { TextMessage mockTextMessage = createMockTextMessage(); Mockito.when(mockTextMessage.getText()).thenReturn("myTextMessageContent"); Mockito.when(mockTextMessage.getJMSReplyTo()).thenReturn(jmsReplyTo); @@ -272,9 +166,6 @@ public class JMSMappingOutboundTransformerTest { } JMSMappingOutboundTransformer transformer = new JMSMappingOutboundTransformer(mockVendor); - if (byteType) { - transformer.setUseByteDestinationTypeAnnotations(true); - } Message amqp = transformer.convert(mockTextMessage);