summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorRobert Greig <rgreig@apache.org>2007-02-08 11:48:27 +0000
committerRobert Greig <rgreig@apache.org>2007-02-08 11:48:27 +0000
commit22d5daa704f4bb1771d83e6356aadb5e1bb25052 (patch)
treedc66ab36d28a5b563ef7364e9aa6648bdebfe90d /java
parentb4ec9cdf5a93e28b060cef4c1b4f4810111826ff (diff)
downloadqpid-python-22d5daa704f4bb1771d83e6356aadb5e1bb25052.tar.gz
(Submitted by Rupert Smith) JUnit-toolkit 0.5 now available on Maven central repo. Using it. Also test classes now use test context properties so that test parameters are correctly printed out in the test results.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@504864 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/perftests/pom.xml12
-rw-r--r--java/perftests/src/test/java/org/apache/qpid/ping/PingAsyncTestPerf.java22
-rw-r--r--java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java15
-rw-r--r--java/pom.xml2
4 files changed, 20 insertions, 31 deletions
diff --git a/java/perftests/pom.xml b/java/perftests/pom.xml
index 3bcda0f359..2fbee8959c 100644
--- a/java/perftests/pom.xml
+++ b/java/perftests/pom.xml
@@ -40,18 +40,6 @@
</properties>
<!-- Temporary local maven repo, whilst JUnit Toolkit is still reaching stable version to add to central maven repository. -->
- <repositories>
- <repository>
- <id>junit-toolkit.snapshots</id>
- <name>JUnit Toolkit SNAPSHOT Repository</name>
- <url>http://junit-toolkit.svn.sourceforge.net/svnroot/junit-toolkit/snapshots/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <!-- Temporary local maven repo, whilst JUnit Toolkit is still reaching stable version to add to central maven repository. -->
<pluginRepositories>
<pluginRepository>
<id>junit-toolkit-plugin.snapshots</id>
diff --git a/java/perftests/src/test/java/org/apache/qpid/ping/PingAsyncTestPerf.java b/java/perftests/src/test/java/org/apache/qpid/ping/PingAsyncTestPerf.java
index 347031ff51..7fd215d410 100644
--- a/java/perftests/src/test/java/org/apache/qpid/ping/PingAsyncTestPerf.java
+++ b/java/perftests/src/test/java/org/apache/qpid/ping/PingAsyncTestPerf.java
@@ -70,7 +70,7 @@ public class PingAsyncTestPerf extends PingTestPerf implements TimingControllerA
/** Holds test specifics by correlation id. This consists of the expected number of messages and the timing controler. */
private Map<String, PerCorrelationId> perCorrelationIds =
- Collections.synchronizedMap(new HashMap<String, PerCorrelationId>());
+ Collections.synchronizedMap(new HashMap<String, PerCorrelationId>());
/** Holds the batched results listener, that does logging on batch boundaries. */
private BatchedResultsListener batchedResultsListener = null;
@@ -85,13 +85,13 @@ public class PingAsyncTestPerf extends PingTestPerf implements TimingControllerA
super(name);
// Sets up the test parameters with defaults.
- ParsedProperties.setSysPropertyIfNull(TEST_RESULTS_BATCH_SIZE_PROPNAME,
- Integer.toString(DEFAULT_TEST_RESULTS_BATCH_SIZE));
+ testParameters.setPropertyIfNull(TEST_RESULTS_BATCH_SIZE_PROPNAME,
+ Integer.toString(DEFAULT_TEST_RESULTS_BATCH_SIZE));
}
/**
* Compile all the tests into a test suite.
- * @return The test suite to run. Should only contain testAsyncPingOk method.
+ * @return The test suite to run. Should only contain testAsyncPingOk method.
*/
public static Test suite()
{
@@ -129,7 +129,7 @@ public class PingAsyncTestPerf extends PingTestPerf implements TimingControllerA
* all replies have been received or a time out occurs before exiting this method.
*
* @param numPings The number of pings to send.
- * @throws Exception pass all errors out to the test harness
+ * @throws Exception pass all errors out to the test harness
*/
public void testAsyncPingOk(int numPings) throws Exception
{
@@ -162,9 +162,9 @@ public class PingAsyncTestPerf extends PingTestPerf implements TimingControllerA
// Generate a sample message of the specified size.
ObjectMessage msg =
- pingClient.getTestMessage(perThreadSetup._pingClient.getReplyDestinations().get(0),
- testParameters.getPropertyAsInteger(PingPongProducer.MESSAGE_SIZE_PROPNAME),
- testParameters.getPropertyAsBoolean(PingPongProducer.PERSISTENT_MODE_PROPNAME));
+ pingClient.getTestMessage(perThreadSetup._pingClient.getReplyDestinations().get(0),
+ testParameters.getPropertyAsInteger(PingPongProducer.MESSAGE_SIZE_PROPNAME),
+ testParameters.getPropertyAsBoolean(PingPongProducer.PERSISTENT_MODE_PROPNAME));
// Send the requested number of messages, and wait until they have all been received.
long timeout = Long.parseLong(testParameters.getProperty(PingPongProducer.TIMEOUT_PROPNAME));
@@ -258,9 +258,9 @@ public class PingAsyncTestPerf extends PingTestPerf implements TimingControllerA
// Extract the correlation id from the message.
String correlationId = message.getJMSCorrelationID();
- _logger.debug("public void onMessage(Message message, int remainingCount = " + remainingCount +
- "): called on batch boundary for message id: "
- + correlationId + " with thread id: " + Thread.currentThread().getId());
+ _logger.debug("public void onMessage(Message message, int remainingCount = " + remainingCount
+ + "): called on batch boundary for message id: " + correlationId + " with thread id: "
+ + Thread.currentThread().getId());
// Get the details for the correlation id and check that they are not null. They can become null
// if a test times out.
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 07d7fad471..9650a78fda 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
@@ -33,6 +33,7 @@ import org.apache.qpid.requestreply.PingPongProducer;
import uk.co.thebadgerset.junit.extensions.AsymptoticTestCase;
import uk.co.thebadgerset.junit.extensions.TestThreadAware;
import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
+import uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
/**
* PingTestPerf is a ping test, that has been written with the intention of being scaled up to run many times
@@ -65,7 +66,7 @@ public class PingTestPerf extends AsymptoticTestCase implements TestThreadAware
ThreadLocal<PerThreadSetup> threadSetup = new ThreadLocal<PerThreadSetup>();
/** Holds a property reader to extract the test parameters from. */
- protected ParsedProperties testParameters = new ParsedProperties(System.getProperties());
+ protected ParsedProperties testParameters = new TestContextProperties(System.getProperties());
public PingTestPerf(String name)
{
@@ -140,11 +141,11 @@ public class PingTestPerf extends AsymptoticTestCase implements TestThreadAware
// Generate a sample message. This message is already time stamped and has its reply-to destination set.
ObjectMessage msg =
- perThreadSetup._pingClient.getTestMessage(perThreadSetup._pingClient.getReplyDestinations().get(0),
- testParameters.getPropertyAsInteger(
- PingPongProducer.MESSAGE_SIZE_PROPNAME),
- testParameters.getPropertyAsBoolean(
- PingPongProducer.PERSISTENT_MODE_PROPNAME));
+ perThreadSetup._pingClient.getTestMessage(perThreadSetup._pingClient.getReplyDestinations().get(0),
+ testParameters.getPropertyAsInteger(
+ PingPongProducer.MESSAGE_SIZE_PROPNAME),
+ testParameters.getPropertyAsBoolean(
+ PingPongProducer.PERSISTENT_MODE_PROPNAME));
// start the test
long timeout = Long.parseLong(testParameters.getProperty(PingPongProducer.TIMEOUT_PROPNAME));
@@ -192,7 +193,7 @@ public class PingTestPerf extends AsymptoticTestCase implements TestThreadAware
// Extract the test set up paramaeters.
int destinationscount =
- Integer.parseInt(testParameters.getProperty(PingPongProducer.PING_DESTINATION_COUNT_PROPNAME));
+ Integer.parseInt(testParameters.getProperty(PingPongProducer.PING_DESTINATION_COUNT_PROPNAME));
// This is synchronized because there is a race condition, which causes one connection to sleep if
// all threads try to create connection concurrently.
diff --git a/java/pom.xml b/java/pom.xml
index 2150e61861..7b18e1beea 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -458,7 +458,7 @@
<dependency>
<groupId>uk.co.thebadgerset</groupId>
<artifactId>junit-toolkit</artifactId>
- <version>0.5-SNAPSHOT</version>
+ <version>0.5</version>
<scope>compile</scope>
</dependency>