Author: rgreig
Date: Thu Feb 8 03:48:27 2007
New Revision: 504864
URL: http://svn.apache.org/viewvc?view=rev&rev=504864
Log:
(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.
Modified:
incubator/qpid/trunk/qpid/java/perftests/pom.xml
incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingAsyncTestPerf.java
incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java
incubator/qpid/trunk/qpid/java/pom.xml
Modified: incubator/qpid/trunk/qpid/java/perftests/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/pom.xml?view=diff&rev=504864&r1=504863&r2=504864
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/perftests/pom.xml Thu Feb 8 03:48:27 2007
@@ -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>
Modified:
incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingAsyncTestPerf.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingAsyncTestPerf.java?view=diff&rev=504864&r1=504863&r2=504864
==============================================================================
---
incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingAsyncTestPerf.java
(original)
+++
incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingAsyncTestPerf.java
Thu Feb 8 03:48:27 2007
@@ -70,7 +70,7 @@
/** 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 @@
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 @@
* 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 @@
// 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 @@
// 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.
Modified:
incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java?view=diff&rev=504864&r1=504863&r2=504864
==============================================================================
---
incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java
(original)
+++
incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java
Thu Feb 8 03:48:27 2007
@@ -33,6 +33,7 @@
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 @@
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 @@
// 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 @@
// 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.
Modified: incubator/qpid/trunk/qpid/java/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/pom.xml?view=diff&rev=504864&r1=504863&r2=504864
==============================================================================
--- incubator/qpid/trunk/qpid/java/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/pom.xml Thu Feb 8 03:48:27 2007
@@ -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>