summaryrefslogtreecommitdiff
path: root/qpid/java/perftests/src/test
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2012-07-05 14:56:45 +0000
committerKeith Wall <kwall@apache.org>2012-07-05 14:56:45 +0000
commitc47834db296c0fda1bc97c662412a6310d788a5a (patch)
tree7dddf13443321d755e44fa7e2e4f6dd706ec51e0 /qpid/java/perftests/src/test
parent8b555d057f483874d9384c15bd989c975d18e0b0 (diff)
downloadqpid-python-c47834db296c0fda1bc97c662412a6310d788a5a.tar.gz
QPID-4110 added topic support to performance tests.
Specifically: - Added support for creating and tearing down durable subscriptions - Improved IterationValueTest so that we test the format for boolean properties (such as durableSubscription) - Added test and chart definitions Applied patch from Philip Harvey <phil@philharveyonline.com> git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1357650 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/perftests/src/test')
-rw-r--r--qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ClientTest.java2
-rw-r--r--qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/IterationValueTest.java33
2 files changed, 19 insertions, 16 deletions
diff --git a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ClientTest.java b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ClientTest.java
index 198baa6ef4..dd50766918 100644
--- a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ClientTest.java
+++ b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ClientTest.java
@@ -125,7 +125,7 @@ public class ClientTest extends TestCase
_client.tearDownTest();
- verify(_delegate).closeTestConnections();
+ verify(_delegate).tearDownTest();
verify(_participantRegistry).clear();
}
diff --git a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/IterationValueTest.java b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/IterationValueTest.java
index 7998eae37e..860f6af565 100644
--- a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/IterationValueTest.java
+++ b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/config/IterationValueTest.java
@@ -22,19 +22,19 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
-import java.util.Collections;
+import java.util.HashMap;
import java.util.Map;
-import junit.framework.TestCase;
-
+import org.apache.qpid.disttest.message.CreateConnectionCommand;
import org.apache.qpid.disttest.message.CreateConsumerCommand;
-import org.apache.qpid.disttest.message.CreateProducerCommand;
+import org.apache.qpid.test.utils.QpidTestCase;
-public class IterationValueTest extends TestCase
+public class IterationValueTest extends QpidTestCase
{
- private static final int MESSAGE_SIZE = 10;
+ private static final int MAXIMUM_DURATION = 10;
+
+ private static final boolean IS_DURABLE_SUBSCRIPTION = true;
- private CreateProducerCommand _createProducerCommand;
private CreateConsumerCommand _createConsumerCommand;
private Map<String, String> _iterationValueMap;
@@ -42,37 +42,40 @@ public class IterationValueTest extends TestCase
protected void setUp() throws Exception
{
super.setUp();
- _createProducerCommand = mock(CreateProducerCommand.class);
_createConsumerCommand = mock(CreateConsumerCommand.class);
- _iterationValueMap = Collections.singletonMap("_messageSize", String.valueOf(MESSAGE_SIZE));
+ _iterationValueMap = new HashMap<String, String>();
+ _iterationValueMap.put("_maximumDuration", String.valueOf(MAXIMUM_DURATION));
+ _iterationValueMap.put("_durableSubscription", String.valueOf(IS_DURABLE_SUBSCRIPTION));
}
public void testApplyPopulatedIterationValueToCommandWithMatchingProperties() throws Exception
{
IterationValue iterationValue = new IterationValue(_iterationValueMap);
- iterationValue.applyToCommand(_createProducerCommand);
+ iterationValue.applyToCommand(_createConsumerCommand);
- verify(_createProducerCommand).setMessageSize(MESSAGE_SIZE);
+ verify(_createConsumerCommand).setMaximumDuration(MAXIMUM_DURATION);
+ verify(_createConsumerCommand).setDurableSubscription(IS_DURABLE_SUBSCRIPTION);
}
public void testApplyPopulatedIterationValueToCommandWithoutMatchingProperties() throws Exception
{
IterationValue iterationValue = new IterationValue(_iterationValueMap);
- iterationValue.applyToCommand(_createConsumerCommand);
+ CreateConnectionCommand createConnectionCommand = mock(CreateConnectionCommand.class);
+ iterationValue.applyToCommand(createConnectionCommand);
- verifyZeroInteractions(_createConsumerCommand);
+ verifyZeroInteractions(createConnectionCommand);
}
public void testApplyUnpopulatedIterationValueToCommand() throws Exception
{
IterationValue iterationValue = new IterationValue();
- iterationValue.applyToCommand(_createProducerCommand);
+ iterationValue.applyToCommand(_createConsumerCommand);
- verifyZeroInteractions(_createProducerCommand);
+ verifyZeroInteractions(_createConsumerCommand);
}
}