Repository: activemq-artemis Updated Branches: refs/heads/ARTEMIS-780 c84285f26 -> c148f7347
test fixes Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/c148f734 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/c148f734 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/c148f734 Branch: refs/heads/ARTEMIS-780 Commit: c148f73470b9611da4e66a5c16335d602698ec0a Parents: c84285f Author: Andy Taylor <[email protected]> Authored: Thu Dec 8 17:44:30 2016 +0000 Committer: Andy Taylor <[email protected]> Committed: Fri Dec 9 06:13:51 2016 +0000 ---------------------------------------------------------------------- .../amqp/broker/AMQPSessionCallback.java | 6 +- .../amqp/proton/ProtonServerSenderContext.java | 4 ++ .../core/protocol/mqtt/MQTTSessionCallback.java | 2 +- .../core/protocol/openwire/amq/AMQSession.java | 2 +- .../core/protocol/stomp/StompSession.java | 2 +- .../protocol/core/impl/CoreSessionCallback.java | 2 +- .../core/server/impl/QueueFactoryImpl.java | 4 -- .../core/server/impl/ServerConsumerImpl.java | 2 +- .../spi/core/protocol/SessionCallback.java | 2 +- .../integration/client/HangConsumerTest.java | 2 +- .../clientcrash/PendingDeliveriesTest.java | 2 + .../jms/cluster/ReplicatedJMSFailoverTest.java | 61 -------------------- .../integration/paging/PagingCounterTest.java | 15 +++-- .../integration/paging/PagingOrderTest.java | 21 ++++--- .../integration/paging/PagingReceiveTest.java | 5 +- .../integration/paging/PagingSyncTest.java | 5 +- .../tests/integration/paging/PagingTest.java | 11 ++-- .../integration/security/SecurityTest.java | 17 ++++-- 18 files changed, 68 insertions(+), 97 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java index 48c51bd..8f7584b 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java @@ -65,6 +65,7 @@ import org.apache.qpid.proton.amqp.transport.AmqpError; import org.apache.qpid.proton.amqp.transport.ErrorCondition; import org.apache.qpid.proton.codec.WritableBuffer; import org.apache.qpid.proton.engine.Delivery; +import org.apache.qpid.proton.engine.EndpointState; import org.apache.qpid.proton.engine.Receiver; import io.netty.buffer.ByteBuf; import org.jboss.logging.Logger; @@ -108,8 +109,9 @@ public class AMQPSessionCallback implements SessionCallback { } @Override - public boolean isWritable(ReadyListener callback) { - return transportConnection.isWritable(callback); + public boolean isWritable(ReadyListener callback, Object protocolContext) { + ProtonServerSenderContext senderContext = (ProtonServerSenderContext) protocolContext; + return transportConnection.isWritable(callback) && senderContext.getSender().getLocalState() != EndpointState.CLOSED; } public void onFlowConsumer(Object consumer, int credits, final boolean drain) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java index 43de7c4..530d1b9 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java @@ -58,6 +58,7 @@ import org.apache.qpid.proton.amqp.transport.DeliveryState; import org.apache.qpid.proton.amqp.transport.ErrorCondition; import org.apache.qpid.proton.amqp.transport.SenderSettleMode; import org.apache.qpid.proton.engine.Delivery; +import org.apache.qpid.proton.engine.EndpointState; import org.apache.qpid.proton.engine.Sender; import org.jboss.logging.Logger; @@ -580,6 +581,9 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr int size = nettyBuffer.writerIndex(); synchronized (connection.getLock()) { + if (sender.getLocalState() == EndpointState.CLOSED) { + return 0; + } final Delivery delivery; delivery = sender.delivery(tag, 0, tag.length); delivery.setMessageFormat((int) messageFormat); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionCallback.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionCallback.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionCallback.java index d580804..548b62c 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionCallback.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSessionCallback.java @@ -37,7 +37,7 @@ public class MQTTSessionCallback implements SessionCallback { } @Override - public boolean isWritable(ReadyListener callback) { + public boolean isWritable(ReadyListener callback, Object protocolContext) { return connection.isWritable(callback); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java index c73c56b..1e4a54b 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java @@ -209,7 +209,7 @@ public class AMQSession implements SessionCallback { } @Override - public boolean isWritable(ReadyListener callback) { + public boolean isWritable(ReadyListener callback, Object protocolContext) { return connection.isWritable(callback); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java ---------------------------------------------------------------------- diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java index 24db587..11a80fa 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompSession.java @@ -82,7 +82,7 @@ public class StompSession implements SessionCallback { } @Override - public boolean isWritable(ReadyListener callback) { + public boolean isWritable(ReadyListener callback, Object protocolContext) { return connection.isWritable(callback); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreSessionCallback.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreSessionCallback.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreSessionCallback.java index e35771e..a6c73eb 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreSessionCallback.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreSessionCallback.java @@ -55,7 +55,7 @@ public final class CoreSessionCallback implements SessionCallback { } @Override - public boolean isWritable(ReadyListener callback) { + public boolean isWritable(ReadyListener callback, Object protocolContext) { return connection.isWritable(callback); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java index 46beee7..2ac153d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java @@ -69,10 +69,6 @@ public class QueueFactoryImpl implements QueueFactory { @Override public Queue createQueueWith(final QueueConfig config) { - - // Add default address info if one doesn't exist - postOffice.addAddressInfo(new AddressInfo(config.address())); - final AddressSettings addressSettings = addressSettingsRepository.getMatch(config.address().toString()); final Queue queue; if (addressSettings.isLastValueQueue()) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java index 389b07e..3e5b20a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java @@ -326,7 +326,7 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener { // should go back into the // queue for delivery later. // TCP-flow control has to be done first than everything else otherwise we may lose notifications - if (!callback.isWritable(this) || !started || transferring) { + if (!callback.isWritable(this, protocolContext) || !started || transferring) { return HandleStatus.BUSY; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/SessionCallback.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/SessionCallback.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/SessionCallback.java index 891f1ad..ee236c7 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/SessionCallback.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/SessionCallback.java @@ -72,7 +72,7 @@ public interface SessionCallback { void disconnect(ServerConsumer consumerId, String queueName); - boolean isWritable(ReadyListener callback); + boolean isWritable(ReadyListener callback, Object protocolContext); /** * Some protocols (Openwire) needs a special message with the browser is finished. http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java index 00f296e..c53c315 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java @@ -501,7 +501,7 @@ public class HangConsumerTest extends ActiveMQTestBase { } @Override - public boolean isWritable(ReadyListener callback) { + public boolean isWritable(ReadyListener callback, Object protocolContext) { return true; } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/PendingDeliveriesTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/PendingDeliveriesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/PendingDeliveriesTest.java index 0738562..7910cc8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/PendingDeliveriesTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/clientcrash/PendingDeliveriesTest.java @@ -27,6 +27,7 @@ import javax.jms.Session; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.RoutingType; +import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; import org.apache.activemq.artemis.logs.AssertionLoggerHandler; import org.apache.activemq.artemis.tests.util.SpawnedVMSupport; @@ -40,6 +41,7 @@ public class PendingDeliveriesTest extends ClientTestBase { @Before public void createQueue() throws Exception { + server.createAddressInfo(new AddressInfo(SimpleString.toSimpleString("queue1"), RoutingType.ANYCAST)); server.createQueue(SimpleString.toSimpleString("queue1"), RoutingType.ANYCAST, SimpleString.toSimpleString("queue1"), null, true, false); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java deleted file mode 100644 index 0f55271..0000000 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.artemis.tests.integration.jms.cluster; - -import org.apache.activemq.artemis.api.core.TransportConfiguration; -import org.apache.activemq.artemis.core.config.ha.ReplicaPolicyConfiguration; -import org.apache.activemq.artemis.core.config.ha.ReplicatedPolicyConfiguration; -import org.apache.activemq.artemis.core.registry.JndiBindingRegistry; -import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants; -import org.apache.activemq.artemis.core.server.ActiveMQServers; -import org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl; - -public class ReplicatedJMSFailoverTest extends JMSFailoverTest { - - /** - * @throws Exception - */ - @Override - protected void startServers() throws Exception { - backupParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1); - - backupConf = createBasicConfig().setJournalType(getDefaultJournalType()).addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY, backupParams)).setBindingsDirectory(getBindingsDir(0, true)).setJournalMinFiles(2).setJournalDirectory(getJournalDir(0, true)).setPagingDirectory(getPageDir(0, true)).setLargeMessagesDirectory(getLargeMessagesDir(0, true)).setHAPolicyConfiguration(new ReplicaPolicyConfiguration()); - - backupServer = addServer(ActiveMQServers.newActiveMQServer(backupConf, true)); - - backupJMSServer = new JMSServerManagerImpl(backupServer); - - backupJMSServer.setRegistry(new JndiBindingRegistry(ctx2)); - - backupJMSServer.start(); - - liveConf = createBasicConfig().setJournalType(getDefaultJournalType()).addConnectorConfiguration("toBackup", new TransportConfiguration(INVM_CONNECTOR_FACTORY, backupParams)).addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY)).setBindingsDirectory(getBindingsDir(0, false)).setJournalMinFiles(2).setJournalDirectory(getJournalDir(0, false)).setPagingDirectory(getPageDir(0, false)).setLargeMessagesDirectory(getLargeMessagesDir(0, false)).setHAPolicyConfiguration(new ReplicatedPolicyConfiguration()); - - liveServer = addServer(ActiveMQServers.newActiveMQServer(liveConf, true)); - - liveJMSServer = new JMSServerManagerImpl(liveServer); - - liveJMSServer.setRegistry(new JndiBindingRegistry(ctx1)); - - liveJMSServer.start(); - } - - // Private ------------------------------------------------------- - - // Inner classes ------------------------------------------------- - -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingCounterTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingCounterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingCounterTest.java index c938652..dc5750a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingCounterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingCounterTest.java @@ -29,6 +29,8 @@ import org.apache.activemq.artemis.core.persistence.StorageManager; import org.apache.activemq.artemis.core.persistence.impl.journal.OperationContextImpl; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.Queue; +import org.apache.activemq.artemis.core.server.RoutingType; +import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.core.transaction.Transaction; import org.apache.activemq.artemis.core.transaction.impl.TransactionImpl; @@ -78,7 +80,8 @@ public class PagingCounterTest extends ActiveMQTestBase { ClientSession session = sf.createSession(); try { - Queue queue = server.createQueue(new SimpleString("A1"), new SimpleString("A1"), null, true, false); + server.createAddressInfo(new AddressInfo(new SimpleString("A1"), RoutingType.ANYCAST)); + Queue queue = server.createQueue(new SimpleString("A1"), RoutingType.ANYCAST, new SimpleString("A1"), null, true, false); PageSubscriptionCounter counter = locateCounter(queue); @@ -107,7 +110,8 @@ public class PagingCounterTest extends ActiveMQTestBase { ClientSession session = sf.createSession(); try { - Queue queue = server.createQueue(new SimpleString("A1"), new SimpleString("A1"), null, true, false); + server.createAddressInfo(new AddressInfo(new SimpleString("A1"), RoutingType.ANYCAST)); + Queue queue = server.createQueue(new SimpleString("A1"), RoutingType.ANYCAST, new SimpleString("A1"), null, true, false); PageSubscriptionCounter counter = locateCounter(queue); @@ -162,7 +166,9 @@ public class PagingCounterTest extends ActiveMQTestBase { ClientSession session = sf.createSession(); try { - Queue queue = server.createQueue(new SimpleString("A1"), new SimpleString("A1"), null, true, false); + + server.createAddressInfo(new AddressInfo(new SimpleString("A1"), RoutingType.ANYCAST)); + Queue queue = server.createQueue(new SimpleString("A1"), RoutingType.ANYCAST, new SimpleString("A1"), null, true, false); PageSubscriptionCounter counter = locateCounter(queue); @@ -215,7 +221,8 @@ public class PagingCounterTest extends ActiveMQTestBase { @Test public void testRestartCounter() throws Exception { - Queue queue = server.createQueue(new SimpleString("A1"), new SimpleString("A1"), null, true, false); + server.createAddressInfo(new AddressInfo(new SimpleString("A1"), RoutingType.ANYCAST)); + Queue queue = server.createQueue(new SimpleString("A1"), RoutingType.ANYCAST, new SimpleString("A1"), null, true, false); PageSubscriptionCounter counter = locateCounter(queue); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingOrderTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingOrderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingOrderTest.java index 575f9e5..2ed65fa 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingOrderTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingOrderTest.java @@ -46,6 +46,8 @@ import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding; import org.apache.activemq.artemis.core.registry.JndiBindingRegistry; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.Queue; +import org.apache.activemq.artemis.core.server.RoutingType; +import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.server.impl.QueueImpl; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; @@ -93,7 +95,8 @@ public class PagingOrderTest extends ActiveMQTestBase { ClientSession session = sf.createSession(false, false, false); - server.createQueue(ADDRESS, ADDRESS, null, true, false); + server.createAddressInfo(new AddressInfo(ADDRESS, RoutingType.ANYCAST)); + server.createQueue(ADDRESS, RoutingType.ANYCAST, ADDRESS, null, true, false); ClientProducer producer = session.createProducer(PagingTest.ADDRESS); @@ -182,9 +185,10 @@ public class PagingOrderTest extends ActiveMQTestBase { ClientSession session = sf.createSession(false, false, false); - Queue q1 = server.createQueue(ADDRESS, ADDRESS, null, true, false); + server.createAddressInfo(new AddressInfo(ADDRESS, RoutingType.ANYCAST)); + Queue q1 = server.createQueue(ADDRESS, RoutingType.ANYCAST, ADDRESS, null, true, false); - Queue q2 = server.createQueue(ADDRESS, new SimpleString("inactive"), null, true, false); + Queue q2 = server.createQueue(ADDRESS, RoutingType.ANYCAST, new SimpleString("inactive"), null, true, false); ClientProducer producer = session.createProducer(PagingTest.ADDRESS); @@ -311,9 +315,10 @@ public class PagingOrderTest extends ActiveMQTestBase { ClientSession session = sf.createSession(false, false, false); - Queue q1 = server.createQueue(ADDRESS, ADDRESS, null, true, false); + server.createAddressInfo(new AddressInfo(ADDRESS, RoutingType.ANYCAST)); + Queue q1 = server.createQueue(ADDRESS, RoutingType.ANYCAST, ADDRESS, null, true, false); - Queue q2 = server.createQueue(ADDRESS, new SimpleString("inactive"), null, true, false); + Queue q2 = server.createQueue(ADDRESS, RoutingType.ANYCAST, new SimpleString("inactive"), null, true, false); ClientProducer producer = session.createProducer(PagingTest.ADDRESS); @@ -404,7 +409,8 @@ public class PagingOrderTest extends ActiveMQTestBase { ClientSession session = sf.createSession(false, false, false); - server.createQueue(ADDRESS, ADDRESS, null, true, false); + server.createAddressInfo(new AddressInfo(ADDRESS, RoutingType.ANYCAST)); + server.createQueue(ADDRESS, RoutingType.ANYCAST, ADDRESS, null, true, false); ClientProducer producer = session.createProducer(PagingTest.ADDRESS); @@ -488,7 +494,8 @@ public class PagingOrderTest extends ActiveMQTestBase { ClientSession session = sf.createSession(false, false, false); - QueueImpl queue = (QueueImpl) server.createQueue(ADDRESS, ADDRESS, null, true, false); + server.createAddressInfo(new AddressInfo(ADDRESS, RoutingType.ANYCAST)); + QueueImpl queue = (QueueImpl) server.createQueue(ADDRESS, RoutingType.ANYCAST, ADDRESS, null, true, false); ClientProducer producer = session.createProducer(PagingTest.ADDRESS); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingReceiveTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingReceiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingReceiveTest.java index 72ccffd..f1ae10f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingReceiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingReceiveTest.java @@ -25,6 +25,8 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.Queue; +import org.apache.activemq.artemis.core.server.RoutingType; +import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; @@ -57,7 +59,8 @@ public class PagingReceiveTest extends ActiveMQTestBase { super.setUp(); server = internalCreateServer(); - Queue queue = server.createQueue(ADDRESS, ADDRESS, null, true, false); + server.createAddressInfo(new AddressInfo(ADDRESS, RoutingType.ANYCAST)); + Queue queue = server.createQueue(ADDRESS, RoutingType.ANYCAST, ADDRESS, null, true, false); queue.getPageSubscription().getPagingStore().startPaging(); for (int i = 0; i < 10; i++) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSyncTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSyncTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSyncTest.java index d4bc86a..a8b1aa1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSyncTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSyncTest.java @@ -28,6 +28,8 @@ import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.server.ActiveMQServer; +import org.apache.activemq.artemis.core.server.RoutingType; +import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.Test; @@ -69,7 +71,8 @@ public class PagingSyncTest extends ActiveMQTestBase { ClientSession session = sf.createSession(false, false, false); - server.createQueue(ADDRESS, ADDRESS, null, true, false); + server.createAddressInfo(new AddressInfo(ADDRESS, RoutingType.ANYCAST)); + server.createQueue(ADDRESS, RoutingType.ANYCAST, ADDRESS, null, true, false); ClientProducer producer = session.createProducer(PagingTest.ADDRESS); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java index 63097cf..21dd5b6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java @@ -72,7 +72,9 @@ import org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordId import org.apache.activemq.artemis.core.persistence.impl.journal.OperationContextImpl; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.Queue; +import org.apache.activemq.artemis.core.server.RoutingType; import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl; +import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.logs.AssertionLoggerHandler; @@ -356,8 +358,8 @@ public class PagingTest extends ActiveMQTestBase { sf = createSessionFactory(locator); ClientSession session = sf.createSession(false, true, true); - - Queue queue = server.createQueue(ADDRESS, ADDRESS, null, true, false); + server.createAddressInfo(new AddressInfo(PagingTest.ADDRESS, RoutingType.ANYCAST)); + Queue queue = server.createQueue(ADDRESS, RoutingType.ANYCAST, ADDRESS, null, true, false); queue.getPageSubscription().getPagingStore().startPaging(); @@ -3600,7 +3602,8 @@ public class PagingTest extends ActiveMQTestBase { server.start(); try { - server.createQueue(PagingTest.ADDRESS, PagingTest.ADDRESS, null, true, false); + server.createAddressInfo(new AddressInfo(PagingTest.ADDRESS, RoutingType.ANYCAST)); + server.createQueue(PagingTest.ADDRESS, RoutingType.ANYCAST, PagingTest.ADDRESS, null, true, false); final CountDownLatch pageUp = new CountDownLatch(0); final CountDownLatch pageDone = new CountDownLatch(1); @@ -3639,7 +3642,7 @@ public class PagingTest extends ActiveMQTestBase { server = createServer(true, config, PagingTest.PAGE_SIZE, PagingTest.PAGE_MAX); server.start(); - + // server.createAddressInfo(new AddressInfo(PagingTest.ADDRESS, RoutingType.ANYCAST)); server.createQueue(PagingTest.ADDRESS, PagingTest.ADDRESS, null, true, false); final CountDownLatch pageUp = new CountDownLatch(0); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/c148f734/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java index 21b2c6d..9bf7cfa 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java @@ -46,7 +46,9 @@ import org.apache.activemq.artemis.core.security.Role; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.core.server.Queue; +import org.apache.activemq.artemis.core.server.RoutingType; import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl; +import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.settings.HierarchicalRepository; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; @@ -227,8 +229,9 @@ public class SecurityTest extends ActiveMQTestBase { roles.add(new Role("programmers", false, false, false, false, false, false, false, false, false, false)); server.getConfiguration().putSecurityRoles("#", roles); server.start(); - server.createQueue(ADDRESS, DURABLE_QUEUE, null, true, false); - server.createQueue(ADDRESS, NON_DURABLE_QUEUE, null, false, false); + server.createAddressInfo(new AddressInfo(ADDRESS, RoutingType.ANYCAST)); + server.createQueue(ADDRESS, RoutingType.ANYCAST, DURABLE_QUEUE, null, true, false); + server.createQueue(ADDRESS, RoutingType.ANYCAST, NON_DURABLE_QUEUE, null, false, false); ClientSessionFactory cf = createSessionFactory(locator); ClientSession session = addClientSession(cf.createSession("first", "secret", false, true, true, false, 0)); @@ -315,8 +318,9 @@ public class SecurityTest extends ActiveMQTestBase { bRoles.add(new Role(QUEUE_B.toString(), false, true, false, false, false, false, false, false, false, false)); server.getConfiguration().putSecurityRoles(ADDRESS.concat(".").concat(QUEUE_B).toString(), bRoles); server.start(); - server.createQueue(ADDRESS, QUEUE_A, null, true, false); - server.createQueue(ADDRESS, QUEUE_B, null, true, false); + server.createAddressInfo(new AddressInfo(ADDRESS, RoutingType.ANYCAST)); + server.createQueue(ADDRESS, RoutingType.ANYCAST, QUEUE_A, null, true, false); + server.createQueue(ADDRESS, RoutingType.ANYCAST, QUEUE_B, null, true, false); ClientSessionFactory cf = createSessionFactory(locator); ClientSession aSession = addClientSession(cf.createSession("a", "a", false, true, true, false, 0)); @@ -389,8 +393,9 @@ public class SecurityTest extends ActiveMQTestBase { ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc)); ClientSessionFactory cf = createSessionFactory(locator); - server.createQueue(ADDRESS, DURABLE_QUEUE, null, true, false); - server.createQueue(ADDRESS, NON_DURABLE_QUEUE, null, false, false); + server.createAddressInfo(new AddressInfo(ADDRESS, RoutingType.ANYCAST)); + server.createQueue(ADDRESS, RoutingType.ANYCAST, DURABLE_QUEUE, null, true, false); + server.createQueue(ADDRESS, RoutingType.ANYCAST, NON_DURABLE_QUEUE, null, false, false); ClientSession session = addClientSession(cf.createSession());
