summaryrefslogtreecommitdiff
path: root/java/perftests/src/test
diff options
context:
space:
mode:
authorBhupendra Bhusman Bhardwaj <bhupendrab@apache.org>2007-01-22 16:41:23 +0000
committerBhupendra Bhusman Bhardwaj <bhupendrab@apache.org>2007-01-22 16:41:23 +0000
commitecf56d8f28474ef8609a2b815fd1a8e46458b6b6 (patch)
tree5fb29e4e8ce38b0bd2642ce05e6010ed645a2d73 /java/perftests/src/test
parent5e917022e13106523006bd222cec58bea3225608 (diff)
downloadqpid-python-ecf56d8f28474ef8609a2b815fd1a8e46458b6b6.tar.gz
performance Ping tests modified for scalability test. Now tests with multiple queues can be performed.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@498687 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/perftests/src/test')
-rw-r--r--java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java b/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java
index 7cdfd29120..af3accf530 100644
--- a/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java
+++ b/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java
@@ -46,6 +46,9 @@ public class PingTestPerf extends AsymptoticTestCase //implements TimingControll
/** Holds the name of the property to get the ping queue name from. */
private static final String PING_QUEUE_NAME_PROPNAME = "pingQueue";
+ /** holds the queue count, if the test is being performed with multiple queues */
+ private static final String PING_QUEUE_COUNT_PROPNAME = "queues";
+
/** Holds the name of the property to get the test delivery mode from. */
private static final String PERSISTENT_MODE_PROPNAME = "persistent";
@@ -92,6 +95,7 @@ public class PingTestPerf extends AsymptoticTestCase //implements TimingControll
setSystemPropertyIfNull(BROKER_PROPNAME, BROKER_DEFAULT);
setSystemPropertyIfNull(VIRTUAL_PATH_PROPNAME, VIRTUAL_PATH_DEFAULT);
setSystemPropertyIfNull(TIMEOUT_PROPNAME, Long.toString(TIMEOUT_DEFAULT));
+ setSystemPropertyIfNull(PING_QUEUE_COUNT_PROPNAME, Integer.toString(1));
}
/** Holds the test ping client. */
@@ -130,7 +134,7 @@ public class PingTestPerf extends AsymptoticTestCase //implements TimingControll
// Fail the test if the timeout was exceeded.
if (numReplies != numPings)
{
- Assert.fail("The ping timed out. Messages Sent = " + numReplies + ", MessagesReceived = " + numPings);
+ Assert.fail("The ping timed out. Messages Sent = " + numPings + ", MessagesReceived = " + numReplies);
}
}
@@ -147,6 +151,7 @@ public class PingTestPerf extends AsymptoticTestCase //implements TimingControll
String username = "guest";
String password = "guest";
String virtualpath = testParameters.getProperty(VIRTUAL_PATH_PROPNAME);
+ int queueCount = Integer.parseInt(testParameters.getProperty(PING_QUEUE_COUNT_PROPNAME));
String queueName = testParameters.getProperty(PING_QUEUE_NAME_PROPNAME);
boolean persistent = Boolean.parseBoolean(testParameters.getProperty(PERSISTENT_MODE_PROPNAME));
boolean transacted = Boolean.parseBoolean(testParameters.getProperty(TRANSACTED_PROPNAME));
@@ -154,9 +159,18 @@ public class PingTestPerf extends AsymptoticTestCase //implements TimingControll
boolean verbose = false;
int messageSize = Integer.parseInt(testParameters.getProperty(MESSAGE_SIZE_PROPNAME));
- // Establish a client to ping a Queue and listen the reply back from same Queue
- _pingItselfClient = new TestPingItself(brokerDetails, username, password, virtualpath, queueName,
- selector, transacted, persistent, messageSize, verbose);
+ if (queueCount > 1)
+ {
+ // test client with multiple queues
+ _pingItselfClient = new TestPingItself(brokerDetails, username, password, virtualpath, queueCount,
+ selector, transacted, persistent, messageSize, verbose);
+ }
+ else
+ {
+ // Establish a client to ping a Queue and listen the reply back from same Queue
+ _pingItselfClient = new TestPingItself(brokerDetails, username, password, virtualpath, queueName,
+ selector, transacted, persistent, messageSize, verbose);
+ }
// Start the client connection
_pingItselfClient.getConnection().start();