[1/2] activemq-artemis git commit: NO-JIRA add user/pass as part of junit rule

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[1/2] activemq-artemis git commit: NO-JIRA add user/pass as part of junit rule

jbertram
Repository: activemq-artemis
Updated Branches:
  refs/heads/master c2c2ce0a4 -> 5ca6418cc


NO-JIRA add user/pass as part of junit rule


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

Branch: refs/heads/master
Commit: 407f63cf3ae0fa5db2b3bc993a79946416850d20
Parents: c2c2ce0
Author: Mohammad Naghavi <[hidden email]>
Authored: Thu Mar 29 23:19:46 2018 +0200
Committer: Justin Bertram <[hidden email]>
Committed: Fri Dec 14 19:47:34 2018 -0600

----------------------------------------------------------------------
 .../junit/AbstractActiveMQClientResource.java   | 16 ++++++++-
 .../artemis/junit/ActiveMQConsumerResource.java | 28 ++++++++++++----
 .../junit/ActiveMQDynamicProducerResource.java  | 16 +++++++++
 .../artemis/junit/ActiveMQProducerResource.java | 34 +++++++++++++++++---
 4 files changed, 82 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/407f63cf/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientResource.java
----------------------------------------------------------------------
diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientResource.java
index 4c62a86..9d2d941 100644
--- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientResource.java
+++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientResource.java
@@ -37,6 +37,14 @@ public abstract class AbstractActiveMQClientResource extends ExternalResource {
    ServerLocator serverLocator;
    ClientSessionFactory sessionFactory;
    ClientSession session;
+   String username;
+   String password;
+
+   public AbstractActiveMQClientResource(String url, String username, String password) {
+      this(url);
+      this.username = username;
+      this.password = password;
+   }
 
    public AbstractActiveMQClientResource(String url) {
       if (url == null) {
@@ -50,6 +58,12 @@ public abstract class AbstractActiveMQClientResource extends ExternalResource {
       }
    }
 
+   public AbstractActiveMQClientResource(ServerLocator serverLocator, String username, String password) {
+      this(serverLocator);
+      this.username = username;
+      this.password = password;
+   }
+
    public AbstractActiveMQClientResource(ServerLocator serverLocator) {
       if (serverLocator == null) {
          throw new IllegalArgumentException(String.format("Error creating %s - ServerLocator cannot be null", this.getClass().getSimpleName()));
@@ -88,7 +102,7 @@ public abstract class AbstractActiveMQClientResource extends ExternalResource {
       log.info("Starting {}", this.getClass().getSimpleName());
       try {
          sessionFactory = serverLocator.createSessionFactory();
-         session = sessionFactory.createSession();
+         session = sessionFactory.createSession(username, password, false, true, true, serverLocator.isPreAcknowledge(), serverLocator.getAckBatchSize());
       } catch (RuntimeException runtimeEx) {
          throw runtimeEx;
       } catch (Exception ex) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/407f63cf/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java
----------------------------------------------------------------------
diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java
index 266d785..34bf67c 100644
--- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java
+++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java
@@ -50,23 +50,39 @@ public class ActiveMQConsumerResource extends AbstractActiveMQClientResource {
    ClientConsumer consumer;
 
    public ActiveMQConsumerResource(String url, String queueName) {
-      this(url, SimpleString.toSimpleString(queueName));
+      this(url, SimpleString.toSimpleString(queueName), null, null);
    }
 
-   public ActiveMQConsumerResource(String url, SimpleString queueName) {
-      super(url);
+   public ActiveMQConsumerResource(String url, String queueName, String username, String password) {
+      this(url, SimpleString.toSimpleString(queueName), username, password);
+   }
+
+   public ActiveMQConsumerResource(String url, SimpleString queueName, String username, String password) {
+      super(url, username, password);
       this.queueName = queueName;
    }
 
+   public ActiveMQConsumerResource(String url, SimpleString queueName) {
+      this(url, queueName, null, null);
+   }
+
+   public ActiveMQConsumerResource(ServerLocator serverLocator, String queueName, String username, String password) {
+      this(serverLocator, SimpleString.toSimpleString(queueName), username, password);
+   }
+
    public ActiveMQConsumerResource(ServerLocator serverLocator, String queueName) {
-      this(serverLocator, SimpleString.toSimpleString(queueName));
+      this(serverLocator, SimpleString.toSimpleString(queueName), null, null);
    }
 
-   public ActiveMQConsumerResource(ServerLocator serverLocator, SimpleString queueName) {
-      super(serverLocator);
+   public ActiveMQConsumerResource(ServerLocator serverLocator, SimpleString queueName, String username, String password) {
+      super(serverLocator, username, password);
       this.queueName = queueName;
    }
 
+   public ActiveMQConsumerResource(ServerLocator serverLocator, SimpleString queueName) {
+      this(serverLocator, queueName, null, null);
+   }
+
    public long getDefaultReceiveTimeout() {
       return defaultReceiveTimeout;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/407f63cf/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java
----------------------------------------------------------------------
diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java
index 03b8c2b..f9c6274 100644
--- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java
+++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java
@@ -44,18 +44,34 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator;
  */
 public class ActiveMQDynamicProducerResource extends ActiveMQProducerResource {
 
+   public ActiveMQDynamicProducerResource(String url, String username, String password) {
+      super(url, username, password);
+   }
+
    public ActiveMQDynamicProducerResource(String url) {
       super(url);
    }
 
+   public ActiveMQDynamicProducerResource(ServerLocator serverLocator, String username, String password) {
+      super(serverLocator, username, password);
+   }
+
    public ActiveMQDynamicProducerResource(ServerLocator serverLocator) {
       super(serverLocator);
    }
 
+   public ActiveMQDynamicProducerResource(String url, SimpleString address, String username, String password) {
+      super(url, address, username, password);
+   }
+
    public ActiveMQDynamicProducerResource(String url, SimpleString address) {
       super(url, address);
    }
 
+   public ActiveMQDynamicProducerResource(ServerLocator serverLocator, SimpleString address, String username, String password) {
+      super(serverLocator, address, username, password);
+   }
+
    public ActiveMQDynamicProducerResource(ServerLocator serverLocator, SimpleString address) {
       super(serverLocator, address);
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/407f63cf/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java
----------------------------------------------------------------------
diff --git a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java
index 478bf8c..102a087 100644
--- a/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java
+++ b/artemis-junit/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java
@@ -49,38 +49,62 @@ public class ActiveMQProducerResource extends AbstractActiveMQClientResource {
    SimpleString address = null;
    ClientProducer producer;
 
+   protected ActiveMQProducerResource(String url, String username, String password) {
+      super(url, username, password);
+   }
+
    protected ActiveMQProducerResource(String url) {
       super(url);
    }
 
+   protected ActiveMQProducerResource(ServerLocator serverLocator, String username, String password) {
+      super(serverLocator, username, password);
+   }
+
    protected ActiveMQProducerResource(ServerLocator serverLocator) {
       super(serverLocator);
    }
 
+   public ActiveMQProducerResource(String url, String address, String username, String password) {
+      this(url, SimpleString.toSimpleString(address), username, password);
+   }
+
    public ActiveMQProducerResource(String url, String address) {
-      this(url, SimpleString.toSimpleString(address));
+      this(url, address, null, null);
    }
 
-   public ActiveMQProducerResource(String url, SimpleString address) {
-      super(url);
+   public ActiveMQProducerResource(String url, SimpleString address, String username, String password) {
+      super(url, username, password);
       if (address == null) {
          throw new IllegalArgumentException(String.format("%s construction error - address cannot be null", this.getClass().getSimpleName()));
       }
       this.address = address;
    }
 
+   public ActiveMQProducerResource(String url, SimpleString address) {
+      this(url, address, null, null);
+   }
+
+   public ActiveMQProducerResource(ServerLocator serverLocator, String address, String username, String password) {
+      this(serverLocator, SimpleString.toSimpleString(address), username, password);
+   }
+
    public ActiveMQProducerResource(ServerLocator serverLocator, String address) {
       this(serverLocator, SimpleString.toSimpleString(address));
    }
 
-   public ActiveMQProducerResource(ServerLocator serverLocator, SimpleString address) {
-      super(serverLocator);
+   public ActiveMQProducerResource(ServerLocator serverLocator, SimpleString address, String username, String password) {
+      super(serverLocator, username, password);
       if (address == null) {
          throw new IllegalArgumentException(String.format("%s construction error - address cannot be null", this.getClass().getSimpleName()));
       }
       this.address = address;
    }
 
+   public ActiveMQProducerResource(ServerLocator serverLocator, SimpleString address) {
+      this(serverLocator, address, null, null);
+   }
+
    public boolean isUseDurableMessage() {
       return useDurableMessage;
    }

Reply | Threaded
Open this post in threaded view
|

[2/2] activemq-artemis git commit: This closes #1982

jbertram
This closes #1982


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

Branch: refs/heads/master
Commit: 5ca6418ccaeaf900edec85910f6501d86cecd1ef
Parents: c2c2ce0 407f63c
Author: Justin Bertram <[hidden email]>
Authored: Fri Dec 14 20:02:30 2018 -0600
Committer: Justin Bertram <[hidden email]>
Committed: Fri Dec 14 20:02:30 2018 -0600

----------------------------------------------------------------------
 .../junit/AbstractActiveMQClientResource.java   | 16 ++++++++-
 .../artemis/junit/ActiveMQConsumerResource.java | 28 ++++++++++++----
 .../junit/ActiveMQDynamicProducerResource.java  | 16 +++++++++
 .../artemis/junit/ActiveMQProducerResource.java | 34 +++++++++++++++++---
 4 files changed, 82 insertions(+), 12 deletions(-)
----------------------------------------------------------------------