activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-887 Fix some OpenWire test failures
Date Tue, 13 Dec 2016 20:57:39 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 47f46501e -> 656eee79e


ARTEMIS-887 Fix some OpenWire test failures


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/16f19daa
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/16f19daa
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/16f19daa

Branch: refs/heads/master
Commit: 16f19daa97b078f3329c965a7ac78980d845e441
Parents: 47f4650
Author: Howard Gao <howard.gao@gmail.com>
Authored: Tue Dec 13 23:49:11 2016 +0800
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Dec 13 15:57:31 2016 -0500

----------------------------------------------------------------------
 .../apache/activemq/ActiveMQConnectionFactory.java   | 15 +++++++++++++++
 .../broker/artemiswrapper/ArtemisBrokerWrapper.java  |  3 ++-
 .../java/org/apache/activemq/JMSConsumerTest.java    |  3 ++-
 .../activemq/JmsQueueCompositeSendReceiveTest.java   |  5 +++++
 4 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/16f19daa/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
----------------------------------------------------------------------
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 c86ffb9..0b1453a 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<String> 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<String> getTrustedPackages() {
+      return trustedPackages;
+   }
+
+   public boolean isTrustAllPackages() {
+      return trustAllPackages;
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/16f19daa/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java
----------------------------------------------------------------------
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 05e08ff..2dd6530 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");

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/16f19daa/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java
----------------------------------------------------------------------
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 3845afd..2e27fc9 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);
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/16f19daa/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java
----------------------------------------------------------------------
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 11b1372..d6272b7 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);
    }
 
    /**


Mime
View raw message