diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java index c86ffb94da..0b1453a8fc 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java @@ -29,8 +29,10 @@ import java.net.URI; import java.net.URISyntaxException; import java.security.AccessController; import java.security.PrivilegedAction; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Properties; import java.util.concurrent.RejectedExecutionHandler; @@ -45,6 +47,7 @@ import org.apache.activemq.thread.TaskRunnerFactory; import org.apache.activemq.transport.Transport; import org.apache.activemq.transport.TransportFactory; import org.apache.activemq.transport.TransportListener; +import org.apache.activemq.util.ClassLoadingAwareObjectInputStream; import org.apache.activemq.util.IdGenerator; import org.apache.activemq.util.IntrospectionSupport; import org.apache.activemq.util.JMSExceptionSupport; @@ -184,6 +187,8 @@ public class ActiveMQConnectionFactory extends JNDIBaseStorable implements Conne protected int xaAckMode = -1; // ensure default init before setting via brokerUrl introspection in sub class private boolean rmIdFromConnectionId = false; private boolean consumerExpiryCheckEnabled = true; + private List trustedPackages = Arrays.asList(ClassLoadingAwareObjectInputStream.serializablePackages); + private boolean trustAllPackages = false; // ///////////////////////////////////////////// // @@ -393,6 +398,8 @@ public class ActiveMQConnectionFactory extends JNDIBaseStorable implements Conne connection.setNestedMapAndListEnabled(isNestedMapAndListEnabled()); connection.setRmIdFromConnectionId(isRmIdFromConnectionId()); connection.setConsumerExpiryCheckEnabled(isConsumerExpiryCheckEnabled()); + connection.setTrustedPackages(getTrustedPackages()); + connection.setTrustAllPackages(isTrustAllPackages()); if (transportListener != null) { connection.addTransportListener(transportListener); } @@ -980,4 +987,12 @@ public class ActiveMQConnectionFactory extends JNDIBaseStorable implements Conne public void setConsumerExpiryCheckEnabled(boolean consumerExpiryCheckEnabled) { this.consumerExpiryCheckEnabled = consumerExpiryCheckEnabled; } + + public List getTrustedPackages() { + return trustedPackages; + } + + public boolean isTrustAllPackages() { + return trustAllPackages; + } } diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java index 05e08ff0a8..2dd65306c2 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java @@ -89,7 +89,8 @@ public class ArtemisBrokerWrapper extends ArtemisBrokerBase { } SimpleString dla = new SimpleString("ActiveMQ.DLQ"); commonSettings.setDeadLetterAddress(dla); - commonSettings.setAutoCreateJmsQueues(true); + commonSettings.setAutoCreateQueues(true); + commonSettings.setAutoCreateAddresses(true); if (bservice.extraConnectors.size() == 0) { serverConfig.addAcceptorConfiguration("home", "tcp://localhost:61616"); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java index 3845afdf93..2e27fc9321 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java @@ -43,6 +43,7 @@ import junit.framework.Test; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder; import org.apache.activemq.artemis.api.core.management.QueueControl; +import org.apache.activemq.artemis.core.server.RoutingType; import org.apache.activemq.broker.artemiswrapper.ArtemisBrokerWrapper; import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.ActiveMQQueue; @@ -909,7 +910,7 @@ public class JMSConsumerTest extends JmsTestSupport { ArtemisBrokerWrapper wrapper = (ArtemisBrokerWrapper) broker.getBroker(); MBeanServer beanServer = wrapper.getMbeanServer(); SimpleString address = new SimpleString(destName); - ObjectName objName = ObjectNameBuilder.DEFAULT.getQueueObjectName(address, address); + ObjectName objName = ObjectNameBuilder.DEFAULT.getQueueObjectName(address, address, RoutingType.ANYCAST); return MBeanServerInvocationHandler.newProxyInstance(beanServer, objName, QueueControl.class, false); } } diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java index 11b1372962..d6272b7716 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java @@ -27,6 +27,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl; +import org.apache.activemq.artemiswrapper.ArtemisBrokerHelper; import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.test.JmsTopicSendReceiveTest; @@ -47,6 +48,10 @@ public class JmsQueueCompositeSendReceiveTest extends JmsTopicSendReceiveTest { topic = false; deliveryMode = DeliveryMode.NON_PERSISTENT; super.setUp(); + ActiveMQDestination dest1 = (ActiveMQDestination) session.createQueue("FOO.BAR.HUMBUG2"); + ActiveMQDestination dest2 = (ActiveMQDestination) session.createQueue("TEST"); + ArtemisBrokerHelper.makeSureDestinationExists(dest1); + ArtemisBrokerHelper.makeSureDestinationExists(dest2); } /**