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 2016/09/01 16:46:56 UTC
qpid-jms git commit: QPIDJMS-187: remove support for some previously
deprecated options
Repository: qpid-jms
Updated Branches:
refs/heads/master 443a54d6c -> 8bdc6ee8b
QPIDJMS-187: remove support for some previously deprecated options
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/8bdc6ee8
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/8bdc6ee8
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/8bdc6ee8
Branch: refs/heads/master
Commit: 8bdc6ee8bc1f9414e599032359a210fe0f7a72a4
Parents: 443a54d
Author: Robert Gemmell <ro...@apache.org>
Authored: Thu Sep 1 17:38:26 2016 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Thu Sep 1 17:38:26 2016 +0100
----------------------------------------------------------------------
.../apache/qpid/jms/JmsConnectionFactory.java | 55 ----------
.../ConnectionFactoryIntegrationTest.java | 65 -----------
.../integration/ProducerIntegrationTest.java | 108 -------------------
3 files changed, 228 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/8bdc6ee8/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionFactory.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionFactory.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionFactory.java
index 0f2c1ba..6c99166 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionFactory.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnectionFactory.java
@@ -727,61 +727,6 @@ public class JmsConnectionFactory extends JNDIStorable implements ConnectionFact
this.localMessageExpiry = localMessageExpiry;
}
- /**
- * Sets the type of the Message IDs used to populate the outgoing Messages
- *
- * @deprecated use the jms.messageIDPolicy.messageIDType URI setting instead.
- *
- * @param type
- * The name of the Message type to use when sending a message.
- */
- @Deprecated
- public void setMessageIDType(String type) {
- if (messageIDPolicy instanceof JmsDefaultMessageIDPolicy) {
- ((JmsDefaultMessageIDPolicy) messageIDPolicy).setMessageIDType(type);
- }
- }
-
- @Deprecated
- public String getMessageIDType() {
- if (messageIDPolicy instanceof JmsDefaultMessageIDPolicy) {
- return ((JmsDefaultMessageIDPolicy) this.messageIDPolicy).getMessageIDType();
- }
-
- return null;
- }
-
- /**
- * @return the messageIDBuilder currently configured.
- *
- * @deprecated Create a custom JmsMessageIDPolicy to control the JmsMessageIDBuilder
- */
- @Deprecated
- public JmsMessageIDBuilder getMessageIDBuilder() {
- if (messageIDPolicy instanceof JmsDefaultMessageIDPolicy) {
- return ((JmsDefaultMessageIDPolicy) this.messageIDPolicy).getMessageIDBuilder();
- }
-
- return null;
- }
-
- /**
- * Allows the owner of this factory to configure a custom Message ID Builder
- * instance that will be used to create the Message ID values set in outgoing
- * Messages sent from MessageProducer instances.
- *
- * @param messageIDBuilder
- * The custom JmsMessageIDBuilder to use to create outgoing Message IDs.
- *
- * @deprecated Create a custom JmsMessageIDPolicy to control the JmsMessageIDBuilder
- */
- @Deprecated
- public void setMessageIDBuilder(JmsMessageIDBuilder messageIDBuilder) {
- if (messageIDPolicy instanceof JmsDefaultMessageIDPolicy) {
- ((JmsDefaultMessageIDPolicy) this.messageIDPolicy).setMessageIDBuilder(messageIDBuilder);
- }
- }
-
public boolean isReceiveLocalOnly() {
return receiveLocalOnly;
}
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/8bdc6ee8/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionFactoryIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionFactoryIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionFactoryIntegrationTest.java
index cccb05e..b247015 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionFactoryIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionFactoryIntegrationTest.java
@@ -146,51 +146,6 @@ public class ConnectionFactoryIntegrationTest extends QpidJmsTestCase {
}
}
- // TODO - Remove once the deprecated methods are removed.
- @Test(timeout=20000)
- public void testSetMessageIDFormatOptionAlteredCaseLegacy() throws Exception {
- try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
- // DONT create a test fixture, we will drive everything directly.
- try {
- String uri = "amqp://127.0.0.1:" + testPeer.getServerPort() + "?jms.messageIDType=uuid";
- JmsConnectionFactory factory = new JmsConnectionFactory(uri);
- JmsDefaultMessageIDPolicy policy = (JmsDefaultMessageIDPolicy) factory.getMessageIDPolicy();
- assertEquals(JmsMessageIDBuilder.BUILTIN.UUID.name(), policy.getMessageIDType());
- } catch (Exception ex) {
- fail("Should have succeeded in creating factory");
- }
-
- try {
- String uri = "amqp://127.0.0.1:" + testPeer.getServerPort() + "?jms.messageIDType=Uuid";
- JmsConnectionFactory factory = new JmsConnectionFactory(uri);
- JmsDefaultMessageIDPolicy policy = (JmsDefaultMessageIDPolicy) factory.getMessageIDPolicy();
- assertEquals(JmsMessageIDBuilder.BUILTIN.UUID.name(), policy.getMessageIDType());
- } catch (Exception ex) {
- fail("Should have succeeded in creating factory");
- }
- }
- }
-
- // TODO - Remove once the deprecated methods are removed.
- @Test(timeout=20000)
- public void testMessageIDFormatOptionAppliedLegacy() throws Exception {
- BUILTIN[] formatters = JmsMessageIDBuilder.BUILTIN.values();
-
- for (BUILTIN formatter : formatters) {
- LOG.info("Testing application of Message ID Format: {}", formatter.name());
- try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
- // DONT create a test fixture, we will drive everything directly.
- String uri = "amqp://127.0.0.1:" + testPeer.getServerPort() + "?jms.messageIDType=" + formatter.name();
- JmsConnectionFactory factory = new JmsConnectionFactory(uri);
- assertEquals(formatter.name(), ((JmsDefaultMessageIDPolicy) factory.getMessageIDPolicy()).getMessageIDType());
-
- JmsConnection connection = (JmsConnection) factory.createConnection();
- assertEquals(formatter.name(), ((JmsDefaultMessageIDPolicy) connection.getMessageIDPolicy()).getMessageIDBuilder().toString());
- connection.close();
- }
- }
- }
-
@Test(timeout=20000)
public void testSetMessageIDFormatOptionAlteredCase() throws Exception {
try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
@@ -234,26 +189,6 @@ public class ConnectionFactoryIntegrationTest extends QpidJmsTestCase {
}
}
- // TODO - Remove once the deprecated methods are removed.
- @SuppressWarnings("deprecation")
- @Test(timeout=20000)
- public void testSetCustomMessageIDBuilderLegacy() throws Exception {
- CustomJmsMessageIdBuilder custom = new CustomJmsMessageIdBuilder();
-
- try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
- // DONT create a test fixture, we will drive everything directly.
- String uri = "amqp://127.0.0.1:" + testPeer.getServerPort();
-
- JmsConnectionFactory factory = new JmsConnectionFactory(uri);
- factory.setMessageIDBuilder(custom);
- assertEquals(custom.toString(), factory.getMessageIDType());
-
- JmsConnection connection = (JmsConnection) factory.createConnection();
- assertEquals(custom.toString(), ((JmsDefaultMessageIDPolicy) connection.getMessageIDPolicy()).getMessageIDBuilder().toString());
- connection.close();
- }
- }
-
@Test(timeout=20000)
public void testSetCustomMessageIDBuilder() throws Exception {
CustomJmsMessageIdBuilder custom = new CustomJmsMessageIdBuilder();
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/8bdc6ee8/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
index 9c2d2bf..c334be0 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ProducerIntegrationTest.java
@@ -623,60 +623,6 @@ public class ProducerIntegrationTest extends QpidJmsTestCase {
}
}
- // TODO - Remove when the deprecated methods are removed.
- @Test(timeout=20000)
- public void testSendingMessageWithUUIDStringMessageFormatLegacy() throws Exception {
- try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
- // DONT create a test fixture, we will drive everything directly.
- String uri = "amqp://127.0.0.1:" + testPeer.getServerPort() + "?jms.messageIDType=UUID_STRING";
- JmsConnectionFactory factory = new JmsConnectionFactory(uri);
-
- Connection connection = factory.createConnection();
- testPeer.expectSaslAnonymousConnect();
- testPeer.expectBegin();
-
- testPeer.expectBegin();
- testPeer.expectSenderAttach();
-
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- String queueName = "myQueue";
- Queue queue = session.createQueue(queueName);
- MessageProducer producer = session.createProducer(queue);
-
- String text = "myMessage";
- MessageHeaderSectionMatcher headersMatcher = new MessageHeaderSectionMatcher(true).withDurable(equalTo(true));
- MessageAnnotationsSectionMatcher msgAnnotationsMatcher = new MessageAnnotationsSectionMatcher(true);
- MessagePropertiesSectionMatcher propsMatcher = new MessagePropertiesSectionMatcher(true).withMessageId(isA(String.class));
- TransferPayloadCompositeMatcher messageMatcher = new TransferPayloadCompositeMatcher();
- messageMatcher.setHeadersMatcher(headersMatcher);
- messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
- messageMatcher.setPropertiesMatcher(propsMatcher);
- messageMatcher.setMessageContentMatcher(new EncodedAmqpValueMatcher(text));
- testPeer.expectTransfer(messageMatcher);
- testPeer.expectClose();
-
- Message message = session.createTextMessage(text);
-
- assertNull("JMSMessageID should not yet be set", message.getJMSMessageID());
-
- producer.send(message);
-
- String jmsMessageID = message.getJMSMessageID();
- assertNotNull("JMSMessageID should be set", jmsMessageID);
- assertTrue("JMS 'ID:' prefix not found", jmsMessageID.startsWith("ID:"));
-
- connection.close();
-
- // Get the value that was actually transmitted/received, verify it is a String, compare to what we have locally
- testPeer.waitForAllHandlersToComplete(1000);
-
- Object receivedMessageId = propsMatcher.getReceivedMessageId();
-
- assertTrue("Expected UUID message id to be sent", receivedMessageId instanceof String);
- assertTrue("Expected JMSMessageId value to be present in AMQP message", jmsMessageID.endsWith(receivedMessageId.toString()));
- }
- }
-
@Test(timeout=20000)
public void testSendingMessageWithUUIDStringMessageIdFormat() throws Exception {
try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
@@ -735,60 +681,6 @@ public class ProducerIntegrationTest extends QpidJmsTestCase {
}
}
- // TODO - Remove when the deprecated methods are removed.
- @Test(timeout=20000)
- public void testSendingMessageWithUUIDMessageFormatLegacy() throws Exception {
- try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
- // DONT create a test fixture, we will drive everything directly.
- String uri = "amqp://127.0.0.1:" + testPeer.getServerPort() + "?jms.messageIDType=UUID";
- JmsConnectionFactory factory = new JmsConnectionFactory(uri);
-
- Connection connection = factory.createConnection();
- testPeer.expectSaslAnonymousConnect();
- testPeer.expectBegin();
-
- testPeer.expectBegin();
- testPeer.expectSenderAttach();
-
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- String queueName = "myQueue";
- Queue queue = session.createQueue(queueName);
- MessageProducer producer = session.createProducer(queue);
-
- String text = "myMessage";
- MessageHeaderSectionMatcher headersMatcher = new MessageHeaderSectionMatcher(true).withDurable(equalTo(true));
- MessageAnnotationsSectionMatcher msgAnnotationsMatcher = new MessageAnnotationsSectionMatcher(true);
- MessagePropertiesSectionMatcher propsMatcher = new MessagePropertiesSectionMatcher(true).withMessageId(isA(UUID.class));
- TransferPayloadCompositeMatcher messageMatcher = new TransferPayloadCompositeMatcher();
- messageMatcher.setHeadersMatcher(headersMatcher);
- messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
- messageMatcher.setPropertiesMatcher(propsMatcher);
- messageMatcher.setMessageContentMatcher(new EncodedAmqpValueMatcher(text));
- testPeer.expectTransfer(messageMatcher);
- testPeer.expectClose();
-
- Message message = session.createTextMessage(text);
-
- assertNull("JMSMessageID should not yet be set", message.getJMSMessageID());
-
- producer.send(message);
-
- String jmsMessageID = message.getJMSMessageID();
- assertNotNull("JMSMessageID should be set", jmsMessageID);
- assertTrue("JMS 'ID:' prefix not found", jmsMessageID.startsWith("ID:"));
-
- connection.close();
-
- // Get the value that was actually transmitted/received, verify it is a UUID, compare to what we have locally
- testPeer.waitForAllHandlersToComplete(1000);
-
- Object receivedMessageId = propsMatcher.getReceivedMessageId();
-
- assertTrue("Expected UUID message id to be sent", receivedMessageId instanceof UUID);
- assertTrue("Expected JMSMessageId value to be present in AMQP message", jmsMessageID.endsWith(receivedMessageId.toString()));
- }
- }
-
@Test(timeout=20000)
public void testSendingMessageWithUUIDMessageIdFormat() throws Exception {
try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org