Repository: qpid-jms Updated Branches: refs/heads/master db729434d -> 71422525c
remove now-unused methods to simplify coming changes Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/bf2f51e5 Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/bf2f51e5 Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/bf2f51e5 Branch: refs/heads/master Commit: bf2f51e52357fed1c4592eb85cfd73e81c3a5ea2 Parents: db72943 Author: Robert Gemmell <[email protected]> Authored: Tue Dec 16 10:23:47 2014 +0000 Committer: Robert Gemmell <[email protected]> Committed: Tue Dec 16 10:23:47 2014 +0000 ---------------------------------------------------------------------- .../jms/message/facade/JmsMessageFacade.java | 16 ---- .../amqp/message/AmqpDestinationHelper.java | 32 ------- .../amqp/message/AmqpJmsMessageFacade.java | 10 -- .../defaults/JmsDefaultMessageFacade.java | 11 --- .../amqp/message/AmqpDestinationHelperTest.java | 99 -------------------- 5 files changed, 168 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/bf2f51e5/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java index 78130fb..ea5a413 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/message/facade/JmsMessageFacade.java @@ -345,14 +345,6 @@ public interface JmsMessageFacade { void setDestination(JmsDestination destination); /** - * Sets the Destination that this message is being sent to via a string. - * - * @param destination - * the string destination name that this message is being sent to. - */ - void setDestinationFromString(String destination); - - /** * Gets the Destination where replies for this Message are to be sent to. * * @return the reply to destination for this message or null if none set. @@ -368,14 +360,6 @@ public interface JmsMessageFacade { void setReplyTo(JmsDestination replyTo); /** - * Sets the Destination where replies to this Message are to be sent via a string. - * - * @param destination - * the string Destination name where replies should be sent, or null to clear. - */ - void setReplyToFromString(String destination); - - /** * Returns the ID of the user that sent this message if available. * * @return the user ID that was in use when this message was sent or null if not set. http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/bf2f51e5/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java index b3654a5..0a4833a 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java @@ -24,7 +24,6 @@ import org.apache.qpid.jms.JmsQueue; import org.apache.qpid.jms.JmsTemporaryQueue; import org.apache.qpid.jms.JmsTemporaryTopic; import org.apache.qpid.jms.JmsTopic; -import org.apache.qpid.jms.provider.amqp.AmqpConnection; /** * A set of static utility method useful when mapping JmsDestination types to / from the AMQP @@ -54,37 +53,6 @@ public class AmqpDestinationHelper { public static final String TEMP_TOPIC_ATTRIBUTES_STRING = TOPIC_ATTRIBUTE + "," + TEMPORARY_ATTRIBUTE; /** - * Given a destination name string, create a JmsDestination object based on the - * configured destination prefix values. If no prefix values are configured or the - * name has no matching prefix we create a Queue instance by default. - * - * @param destinationName - * the name to use to construct the new JmsDestination instance. - * @param connection - * the connection where this destination will be handled. - * - * @throws NullPointerException if destinationName or connection is null. - */ - public JmsDestination createDestination(String destinationName, AmqpConnection connection) { - - JmsDestination result = null; - - if (connection.getQueuePrefix() != null && destinationName.startsWith(connection.getQueuePrefix())) { - result = new JmsQueue(destinationName.substring(connection.getQueuePrefix().length())); - } else if (connection.getTopicPrefix() != null && destinationName.startsWith(connection.getTopicPrefix())) { - result = new JmsTopic(destinationName.substring(connection.getTopicPrefix().length())); - } else if (connection.getTempQueuePrefix() != null && destinationName.startsWith(connection.getTempQueuePrefix())) { - result = new JmsTemporaryQueue(destinationName.substring(connection.getTempQueuePrefix().length())); - } else if (connection.getTempTopicPrefix() != null && destinationName.startsWith(connection.getTempTopicPrefix())) { - result = new JmsTemporaryTopic(destinationName.substring(connection.getTempTopicPrefix().length())); - } else { - result = new JmsQueue(destinationName); - } - - return result; - } - - /** * Decode the provided To address, type description, and consumer destination * information such that an appropriate Destination object can be returned. * http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/bf2f51e5/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java index 5a75ede..4fc0132 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java @@ -659,11 +659,6 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade { } @Override - public void setDestinationFromString(String destination) { - setDestination(AmqpDestinationHelper.INSTANCE.createDestination(destination, connection)); - } - - @Override public JmsDestination getReplyTo() { if (replyTo == null) { replyTo = AmqpDestinationHelper.INSTANCE.getJmsReplyTo(this, consumerDestination); @@ -679,11 +674,6 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade { AmqpDestinationHelper.INSTANCE.setReplyToAddressFromDestination(this, replyTo, connection.isUseByteDestinationTypeAnnotation()); } - @Override - public void setReplyToFromString(String destination) { - setReplyTo(AmqpDestinationHelper.INSTANCE.createDestination(destination, connection)); - } - public void setReplyToGroupId(String replyToGroupId) { message.setReplyToGroupId(replyToGroupId); } http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/bf2f51e5/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java index 1e56517..66f0321 100644 --- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java +++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/message/facade/defaults/JmsDefaultMessageFacade.java @@ -25,7 +25,6 @@ import java.util.Set; import javax.jms.JMSException; import org.apache.qpid.jms.JmsDestination; -import org.apache.qpid.jms.JmsQueue; import org.apache.qpid.jms.message.facade.JmsMessageFacade; /** @@ -294,11 +293,6 @@ public class JmsDefaultMessageFacade implements JmsMessageFacade { } @Override - public void setDestinationFromString(String destination) { - this.destination = new JmsQueue(destination); - } - - @Override public JmsDestination getReplyTo() { return this.replyTo; } @@ -309,11 +303,6 @@ public class JmsDefaultMessageFacade implements JmsMessageFacade { } @Override - public void setReplyToFromString(String destination) { - this.replyTo = new JmsQueue(destination); - } - - @Override public String getUserId() { return this.userId; } http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/bf2f51e5/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelperTest.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelperTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelperTest.java index 4d851a0..7f6a698 100644 --- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelperTest.java +++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelperTest.java @@ -37,7 +37,6 @@ import org.apache.qpid.jms.JmsQueue; import org.apache.qpid.jms.JmsTemporaryQueue; import org.apache.qpid.jms.JmsTemporaryTopic; import org.apache.qpid.jms.JmsTopic; -import org.apache.qpid.jms.provider.amqp.AmqpConnection; import org.junit.Test; import org.mockito.Mockito; @@ -45,104 +44,6 @@ public class AmqpDestinationHelperTest { private final AmqpDestinationHelper helper = AmqpDestinationHelper.INSTANCE; - private static final String QUEUE_PREFIX = "queue://"; - private static final String TOPIC_PREFIX = "topic://"; - private static final String TEMP_QUEUE_PREFIX = "temp-queue://"; - private static final String TEMP_TOPIC_PREFIX = "temp-topic://"; - - private AmqpConnection createConnectionWithDestinationPrefixValues() { - AmqpConnection connection = Mockito.mock(AmqpConnection.class); - Mockito.when(connection.getQueuePrefix()).thenReturn(QUEUE_PREFIX); - Mockito.when(connection.getTopicPrefix()).thenReturn(TOPIC_PREFIX); - Mockito.when(connection.getTempQueuePrefix()).thenReturn(TEMP_QUEUE_PREFIX); - Mockito.when(connection.getTempTopicPrefix()).thenReturn(TEMP_TOPIC_PREFIX); - - return connection; - } - - //--------------- Test createDestination method --------------------------// - - @Test(expected=NullPointerException.class) - public void testCreateDestinationFromStringWithNullConnection() { - helper.createDestination("testName", null); - } - - @Test(expected=NullPointerException.class) - public void testCreateDestinationFromNullStringWithConnection() { - helper.createDestination(null, createConnectionWithDestinationPrefixValues()); - } - - @Test(expected=NullPointerException.class) - public void testCreateDestinationFromNullStringAndConnection() { - helper.createDestination(null, null); - } - - @Test - public void testCreateDestinationFromStringNoPrefixReturnsQueue() { - String destinationName = "testDestinationName"; - AmqpConnection connection = createConnectionWithDestinationPrefixValues(); - JmsDestination result = helper.createDestination(destinationName, connection); - assertNotNull(result); - assertTrue(result.isQueue()); - assertFalse(result.isTemporary()); - assertEquals(destinationName, result.getName()); - } - - @Test - public void testCreateDestinationFromStringNoConnectionSetPrefixReturnsQueue() { - String destinationName = "testDestinationName"; - AmqpConnection connection = Mockito.mock(AmqpConnection.class); - JmsDestination result = helper.createDestination(destinationName, connection); - assertNotNull(result); - assertTrue(result.isQueue()); - assertFalse(result.isTemporary()); - assertEquals(destinationName, result.getName()); - } - - @Test - public void testCreateDestinationFromQeueuePrefixedString() { - String destinationName = "testDestinationName"; - AmqpConnection connection = createConnectionWithDestinationPrefixValues(); - JmsDestination result = helper.createDestination(QUEUE_PREFIX + destinationName, connection); - assertNotNull(result); - assertTrue(result.isQueue()); - assertFalse(result.isTemporary()); - assertEquals(destinationName, result.getName()); - } - - @Test - public void testCreateDestinationFromTopicPrefixedString() { - String destinationName = "testDestinationName"; - AmqpConnection connection = createConnectionWithDestinationPrefixValues(); - JmsDestination result = helper.createDestination(TOPIC_PREFIX + destinationName, connection); - assertNotNull(result); - assertTrue(result.isTopic()); - assertFalse(result.isTemporary()); - assertEquals(destinationName, result.getName()); - } - - @Test - public void testCreateDestinationFromTempQueuePrefixedString() { - String destinationName = "testDestinationName"; - AmqpConnection connection = createConnectionWithDestinationPrefixValues(); - JmsDestination result = helper.createDestination(TEMP_QUEUE_PREFIX + destinationName, connection); - assertNotNull(result); - assertTrue(result.isQueue()); - assertTrue(result.isTemporary()); - assertEquals(destinationName, result.getName()); - } - - @Test - public void testCreateDestinationFromTempTopicPrefixedString() { - String destinationName = "testDestinationName"; - AmqpConnection connection = createConnectionWithDestinationPrefixValues(); - JmsDestination result = helper.createDestination(TEMP_TOPIC_PREFIX + destinationName, connection); - assertNotNull(result); - assertTrue(result.isTopic()); - assertTrue(result.isTemporary()); - assertEquals(destinationName, result.getName()); - } - //--------------- Test getJmsDestination method --------------------------// @Test --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
