summaryrefslogtreecommitdiff
path: root/qpid/java/tools/src/main/java/org/apache/qpid/tools/TestParams.java
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/tools/src/main/java/org/apache/qpid/tools/TestParams.java')
-rw-r--r--qpid/java/tools/src/main/java/org/apache/qpid/tools/TestParams.java58
1 files changed, 30 insertions, 28 deletions
diff --git a/qpid/java/tools/src/main/java/org/apache/qpid/tools/TestParams.java b/qpid/java/tools/src/main/java/org/apache/qpid/tools/TestParams.java
index f1b682ff32..89d6462a39 100644
--- a/qpid/java/tools/src/main/java/org/apache/qpid/tools/TestParams.java
+++ b/qpid/java/tools/src/main/java/org/apache/qpid/tools/TestParams.java
@@ -24,15 +24,22 @@ import javax.jms.Session;
public class TestParams
{
- private String initialContextFactory = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
-
- private String providerURL = System.getenv("QPID_TEST_HOME") + "/etc/jndi.properties";
-
- private String connectionFactory = "connectionFactory";
-
- private String transientDest = "transientQueue";
+ /*
+ * By default the connection URL is used.
+ * This allows a user to easily specify a fully fledged URL any given property.
+ * Ex. SSL parameters
+ *
+ * By providing a host & port allows a user to simply override the URL.
+ * This allows to create multiple clients in test scripts easily,
+ * without having to deal with the long URL format.
+ */
+ private String url = "amqp://guest:guest@clientid/testpath?brokerlist='tcp://localhost:5672'";
+
+ private String host = "";
+
+ private int port = -1;
- private String durableDest = "durableQueue";
+ private String address = "queue; {create : always}";
private int msg_size = 1024;
@@ -60,11 +67,11 @@ public class TestParams
public TestParams()
{
- initialContextFactory = System.getProperty("java.naming.factory.initial",initialContextFactory);
- providerURL = System.getProperty("java.naming.provider.url",providerURL);
-
- transientDest = System.getProperty("transDest",transientDest);
- durableDest = System.getProperty("durableDest",durableDest);
+
+ url = System.getProperty("url",url);
+ host = System.getProperty("host","");
+ port = Integer.getInteger("port", -1);
+ address = System.getProperty("address","queue");
msg_size = Integer.getInteger("msg_size", 1024);
msg_type = Integer.getInteger("msg_type",1);
@@ -80,29 +87,29 @@ public class TestParams
random_msg_size = Boolean.getBoolean("random_msg_size");
}
- public int getAckMode()
+ public String getUrl()
{
- return ack_mode;
+ return url;
}
- public String getConnectionFactory()
+ public String getHost()
{
- return connectionFactory;
+ return host;
}
- public String getTransientDestination()
+ public int getPort()
{
- return transientDest;
+ return port;
}
- public String getDurableDestination()
+ public String getAddress()
{
- return durableDest;
+ return address;
}
- public String getInitialContextFactory()
+ public int getAckMode()
{
- return initialContextFactory;
+ return ack_mode;
}
public int getMsgCount()
@@ -125,11 +132,6 @@ public class TestParams
return durable;
}
- public String getProviderURL()
- {
- return providerURL;
- }
-
public boolean isTransacted()
{
return transacted;