Repository: activemq-artemis Updated Branches: refs/heads/master dc9cee2f7 -> 9d5d2d534
ARTEMIS-1207: Align when setClientId can be called Update ActiveMQConnection to change/alighn behaviour for addtional methods: - getMetaData - stop Adding test to avoid regression. This is aligning with qpid-jms and openwire clients Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/e8fa02bf Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/e8fa02bf Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/e8fa02bf Branch: refs/heads/master Commit: e8fa02bf80118738c52489c4bf2511aa0d1ef5b8 Parents: dc9cee2 Author: Michael Andre Pearce <[email protected]> Authored: Tue Jun 6 16:09:58 2017 +0100 Committer: Clebert Suconic <[email protected]> Committed: Wed Jun 7 10:18:15 2017 -0400 ---------------------------------------------------------------------- .../artemis/jms/client/ActiveMQConnection.java | 3 --- .../activemq/artemis/jms/tests/ConnectionTest.java | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e8fa02bf/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java ---------------------------------------------------------------------- diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java index 51a89e3..0ff0a21 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java @@ -267,8 +267,6 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme public ConnectionMetaData getMetaData() throws JMSException { checkClosed(); - justCreated = false; - if (metaData == null) { metaData = new ActiveMQConnectionMetaData(thisVersion); } @@ -323,7 +321,6 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme session.stop(); } - justCreated = false; started = false; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e8fa02bf/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionTest.java ---------------------------------------------------------------------- diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionTest.java index 2d89713..8aac280 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ConnectionTest.java @@ -98,6 +98,15 @@ public class ConnectionTest extends JMSTestCase { } @Test + public void testSetClientIdAfterStop() throws Exception { + try (Connection connection = createConnection()) { + connection.stop(); + connection.setClientID("clientId"); + } + } + + + @Test public void testSetClientAfterStart() throws Exception { Connection connection = null; try { @@ -174,6 +183,14 @@ public class ConnectionTest extends JMSTestCase { connection.close(); } + @Test + public void testSetClientIdAfterGetMetadata() throws Exception { + try (Connection connection = createConnection()) { + connection.getMetaData(); + connection.setClientID("clientId"); + } + } + /** * Test creation of QueueSession */
