You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2015/01/06 18:37:46 UTC
[1/2] qpid-proton git commit: PROTON-792: Revert "PROTON-711: add
support (disabled by default) for using a byte value for destination type
annotations during outbound transformation"
Repository: qpid-proton
Updated Branches:
refs/heads/master 3b66b87cc -> 4191590ec
PROTON-792: Revert "PROTON-711: add support (disabled by default) for using a byte value for destination type annotations during outbound transformation"
This reverts commit 72b7beba08f6eda64f9ce7d46d04f8d4e05f99c5.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/7ecef798
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/7ecef798
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/7ecef798
Branch: refs/heads/master
Commit: 7ecef798d79cf045242d95702030ba6e03ff1f4f
Parents: 3b66b87
Author: Robert Gemmell <ro...@apache.org>
Authored: Tue Jan 6 14:57:27 2015 +0000
Committer: Robert Gemmell <ro...@apache.org>
Committed: Tue Jan 6 17:31:25 2015 +0000
----------------------------------------------------------------------
.../proton/jms/AutoOutboundTransformer.java | 6 -
.../jms/JMSMappingOutboundTransformer.java | 44 ++----
.../org/apache/qpid/proton/jms/JMSVendor.java | 16 +-
.../qpid/proton/jms/OutboundTransformer.java | 14 +-
.../jms/JMSMappingOutboundTransformerTest.java | 149 ++-----------------
5 files changed, 32 insertions(+), 197 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7ecef798/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AutoOutboundTransformer.java
----------------------------------------------------------------------
diff --git a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AutoOutboundTransformer.java b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AutoOutboundTransformer.java
index 0440709..f62760b 100644
--- a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AutoOutboundTransformer.java
+++ b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/AutoOutboundTransformer.java
@@ -46,10 +46,4 @@ public class AutoOutboundTransformer extends JMSMappingOutboundTransformer {
}
}
- @Override
- public void setUseByteDestinationTypeAnnotations(boolean useByteDestinationTypeAnnotations)
- {
- super.setUseByteDestinationTypeAnnotations(useByteDestinationTypeAnnotations);
- transformer.setUseByteDestinationTypeAnnotations(useByteDestinationTypeAnnotations);
- }
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7ecef798/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformer.java
----------------------------------------------------------------------
diff --git a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformer.java b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformer.java
index 38c9aac..ba91f0a 100644
--- a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformer.java
+++ b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformer.java
@@ -224,39 +224,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;
- }
- }
- 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";
- }
+ 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 "temporary,topic";
- } else {
- return "topic";
- }
+ }
+ if( destination instanceof Topic ) {
+ if( destination instanceof TemporaryTopic ) {
+ return "temporary,topic";
+ } else {
+ return "topic";
}
- return "";
}
+ return "";
}
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7ecef798/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSVendor.java
----------------------------------------------------------------------
diff --git a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSVendor.java b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSVendor.java
index b1a9b25..5d02069 100644
--- a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSVendor.java
+++ b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/JMSVendor.java
@@ -1,23 +1,15 @@
package org.apache.qpid.proton.jms;
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
+import javax.jms.*;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
/**
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
*/
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();
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7ecef798/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/OutboundTransformer.java
----------------------------------------------------------------------
diff --git a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/OutboundTransformer.java b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/OutboundTransformer.java
index 596a4ed..09a6e15 100644
--- a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/OutboundTransformer.java
+++ b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/OutboundTransformer.java
@@ -16,6 +16,8 @@
*/
package org.apache.qpid.proton.jms;
+import org.apache.qpid.proton.engine.Delivery;
+
import javax.jms.Message;
/**
@@ -41,7 +43,7 @@ public abstract class OutboundTransformer {
String replyToGroupIDKey;
String prefixFooterKey;
- private boolean useByteDestinationTypeAnnotations;
+
public OutboundTransformer(JMSVendor vendor) {
this.vendor = vendor;
@@ -50,16 +52,6 @@ public abstract class OutboundTransformer {
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;
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/7ecef798/contrib/proton-jms/src/test/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformerTest.java
----------------------------------------------------------------------
diff --git a/contrib/proton-jms/src/test/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformerTest.java b/contrib/proton-jms/src/test/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformerTest.java
index c9d472b..98dae5f 100644
--- a/contrib/proton-jms/src/test/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformerTest.java
+++ b/contrib/proton-jms/src/test/java/org/apache/qpid/proton/jms/JMSMappingOutboundTransformerTest.java
@@ -54,34 +54,13 @@ 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
@@ -89,7 +68,7 @@ public class JMSMappingOutboundTransformerTest
{
Queue mockDest = Mockito.mock(Queue.class);
- doTestConvertMessageWithJMSDestination(mockDest, "queue", false);
+ doTestConvertMessageWithJMSDestination(mockDest, "queue");
}
@Test
@@ -97,7 +76,7 @@ public class JMSMappingOutboundTransformerTest
{
TemporaryQueue mockDest = Mockito.mock(TemporaryQueue.class);
- doTestConvertMessageWithJMSDestination(mockDest, "temporary,queue", false);
+ doTestConvertMessageWithJMSDestination(mockDest, "temporary,queue");
}
@Test
@@ -105,7 +84,7 @@ public class JMSMappingOutboundTransformerTest
{
Topic mockDest = Mockito.mock(Topic.class);
- doTestConvertMessageWithJMSDestination(mockDest, "topic", false);
+ doTestConvertMessageWithJMSDestination(mockDest, "topic");
}
@Test
@@ -113,58 +92,10 @@ public class JMSMappingOutboundTransformerTest
{
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");
@@ -178,10 +109,6 @@ public class JMSMappingOutboundTransformerTest
}
JMSMappingOutboundTransformer transformer = new JMSMappingOutboundTransformer(mockVendor);
- if(byteType)
- {
- transformer.setUseByteDestinationTypeAnnotations(true);
- }
Message amqp = transformer.convert(mockTextMessage);
@@ -206,11 +133,10 @@ public class JMSMappingOutboundTransformerTest
// ======= JMSReplyTo Handling =========
// =====================================
- // --- String type annotation ---
@Test
public void testConvertMessageWithJMSReplyToNull() throws Exception
{
- doTestConvertMessageWithJMSReplyTo(null, null, false);
+ doTestConvertMessageWithJMSReplyTo(null, null);
}
@Test
@@ -218,7 +144,7 @@ public class JMSMappingOutboundTransformerTest
{
Queue mockDest = Mockito.mock(Queue.class);
- doTestConvertMessageWithJMSReplyTo(mockDest, "queue", false);
+ doTestConvertMessageWithJMSReplyTo(mockDest, "queue");
}
@Test
@@ -226,7 +152,7 @@ public class JMSMappingOutboundTransformerTest
{
TemporaryQueue mockDest = Mockito.mock(TemporaryQueue.class);
- doTestConvertMessageWithJMSReplyTo(mockDest, "temporary,queue", false);
+ doTestConvertMessageWithJMSReplyTo(mockDest, "temporary,queue");
}
@Test
@@ -234,7 +160,7 @@ public class JMSMappingOutboundTransformerTest
{
Topic mockDest = Mockito.mock(Topic.class);
- doTestConvertMessageWithJMSReplyTo(mockDest, "topic", false);
+ doTestConvertMessageWithJMSReplyTo(mockDest, "topic");
}
@Test
@@ -242,57 +168,10 @@ public class JMSMappingOutboundTransformerTest
{
TemporaryTopic mockDest = Mockito.mock(TemporaryTopic.class);
- doTestConvertMessageWithJMSReplyTo(mockDest, "temporary,topic", false);
- }
-
- // --- 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);
+ doTestConvertMessageWithJMSReplyTo(mockDest, "temporary,topic");
}
- 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");
@@ -306,10 +185,6 @@ public class JMSMappingOutboundTransformerTest
}
JMSMappingOutboundTransformer transformer = new JMSMappingOutboundTransformer(mockVendor);
- if(byteType)
- {
- transformer.setUseByteDestinationTypeAnnotations(true);
- }
Message amqp = transformer.convert(mockTextMessage);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/2] qpid-proton git commit: PROTON-792: Revert "PROTON-711: add
support (disabled by default) for using a byte value for destination type
annotations during inbound transformation"
Posted by ro...@apache.org.
PROTON-792: Revert "PROTON-711: add support (disabled by default) for using a byte value for destination type annotations during inbound transformation"
This reverts commit 960eeff9eefa5b8dc52de356d1118ae0b017a319.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/4191590e
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/4191590e
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/4191590e
Branch: refs/heads/master
Commit: 4191590ec121027b0590242a42bdae2032b3126d
Parents: 7ecef79
Author: Robert Gemmell <ro...@apache.org>
Authored: Tue Jan 6 17:09:36 2015 +0000
Committer: Robert Gemmell <ro...@apache.org>
Committed: Tue Jan 6 17:31:57 2015 +0000
----------------------------------------------------------------------
.../qpid/proton/jms/InboundTransformer.java | 84 +++++------------
.../jms/JMSMappingInboundTransformerTest.java | 97 +++-----------------
2 files changed, 35 insertions(+), 146 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4191590e/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/InboundTransformer.java
----------------------------------------------------------------------
diff --git a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/InboundTransformer.java b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/InboundTransformer.java
index cef10c4..0374e6a 100644
--- a/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/InboundTransformer.java
+++ b/contrib/proton-jms/src/main/java/org/apache/qpid/proton/jms/InboundTransformer.java
@@ -53,22 +53,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;
}
@@ -140,16 +130,8 @@ public abstract class InboundTransformer {
}
}
- Class<? extends Destination> toAttributes = null;
- Class<? extends Destination> replyToAttributes = null;
-
- if (isUseByteDestinationTypeAnnotations()){
- toAttributes = Queue.class;
- replyToAttributes = Queue.class;
- } else {
- toAttributes = Destination.class;
- replyToAttributes = Destination.class;
- }
+ Class<? extends Destination> toAttributes = Destination.class;
+ Class<? extends Destination> replyToAttributes = Destination.class;
final MessageAnnotations ma = amqp.getMessageAnnotations();
if( ma!=null ) {
@@ -158,9 +140,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());
}
@@ -264,49 +246,29 @@ public abstract class InboundTransformer {
return Collections.unmodifiableSet(s);
}
- Class<? extends Destination> toClassFromAttributes(Object value)
+ Class<? extends Destination> toClassFromAttributes(String 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;
- }
- }
+ if( value ==null ) {
+ return null;
+ }
+ HashSet<String> attributes = new HashSet<String>();
+ for( String x: value.split("\\s*,\\s*") ) {
+ attributes.add(x);
+ }
+ if( QUEUE_ATTRIBUTES.equals(attributes) ) {
return Queue.class;
- } else {
- if( value == null ) {
- return null;
- }
- String valueString = value.toString();
- HashSet<String> attributes = new HashSet<String>();
- 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;
}
+ 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;
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4191590e/contrib/proton-jms/src/test/java/org/apache/qpid/proton/jms/JMSMappingInboundTransformerTest.java
----------------------------------------------------------------------
diff --git a/contrib/proton-jms/src/test/java/org/apache/qpid/proton/jms/JMSMappingInboundTransformerTest.java b/contrib/proton-jms/src/test/java/org/apache/qpid/proton/jms/JMSMappingInboundTransformerTest.java
index 2413310..42a99ca 100644
--- a/contrib/proton-jms/src/test/java/org/apache/qpid/proton/jms/JMSMappingInboundTransformerTest.java
+++ b/contrib/proton-jms/src/test/java/org/apache/qpid/proton/jms/JMSMappingInboundTransformerTest.java
@@ -60,78 +60,41 @@ 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<? extends Destination> expectedClass, boolean byteType) throws Exception
+ private void doTransformWithToTypeDestinationTypeAnnotationTestImpl(Object toTypeAnnotationValue, Class<? extends Destination> 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();
@@ -157,77 +120,41 @@ 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<? extends Destination> expectedClass, boolean byteType) throws Exception
+ private void doTransformWithReplyToTypeDestinationTypeAnnotationTestImpl(Object replyToTypeAnnotationValue, Class<? extends Destination> 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();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org