Modified: 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ParticipantTestHelper.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ParticipantTestHelper.java?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ParticipantTestHelper.java
 (original)
+++ 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ParticipantTestHelper.java
 Mon Apr 23 12:44:37 2012
@@ -32,7 +32,21 @@ public class ParticipantTestHelper
         assertTrue(message + " " + actual, actual >= minimumExpected);
     }
 
-    public static void assertExpectedResults(ParticipantResult result, String 
participantName, String registeredClientName, long expectedTestStartTime, 
Integer expectedNumberOfMessages, Integer expectedPayloadSize, Long 
expectedTotalPayloadProcessed, Long expectedMinimumExpectedDuration)
+    public static void assertExpectedConsumerResults(ParticipantResult result, 
String participantName, String registeredClientName, long 
expectedTestStartTime, Integer expectedNumberOfMessages, Integer 
expectedPayloadSize, Long expectedTotalPayloadProcessed, Long 
expectedMinimumExpectedDuration)
+    {
+        assertExpectedResults(result, participantName, registeredClientName, 
expectedTestStartTime, expectedNumberOfMessages, expectedPayloadSize, 
expectedTotalPayloadProcessed, expectedMinimumExpectedDuration);
+        assertEquals("Unexpected number of consumers", 1, 
result.getTotalNumberOfConsumers());
+        assertEquals("Unexpected number of producers", 0, 
result.getTotalNumberOfProducers());
+    }
+
+    public static void assertExpectedProducerResults(ParticipantResult result, 
String participantName, String registeredClientName, long 
expectedTestStartTime, Integer expectedNumberOfMessages, Integer 
expectedPayloadSize, Long expectedTotalPayloadProcessed, Long 
expectedMinimumExpectedDuration)
+    {
+        assertExpectedResults(result, participantName, registeredClientName, 
expectedTestStartTime, expectedNumberOfMessages, expectedPayloadSize, 
expectedTotalPayloadProcessed, expectedMinimumExpectedDuration);
+        assertEquals("Unexpected number of producers", 1, 
result.getTotalNumberOfProducers());
+        assertEquals("Unexpected number of consumers", 0, 
result.getTotalNumberOfConsumers());
+    }
+
+    private static void assertExpectedResults(ParticipantResult result, String 
participantName, String registeredClientName, long expectedTestStartTime, 
Integer expectedNumberOfMessages, Integer expectedPayloadSize, Long 
expectedTotalPayloadProcessed, Long expectedMinimumExpectedDuration)
     {
         assertFalse(result.hasError());
 

Modified: 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ProducerParticipantTest.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ProducerParticipantTest.java?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ProducerParticipantTest.java
 (original)
+++ 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ProducerParticipantTest.java
 Mon Apr 23 12:44:37 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.qpid.disttest.client;
 
-import static 
org.apache.qpid.disttest.client.ParticipantTestHelper.assertExpectedResults;
+import static 
org.apache.qpid.disttest.client.ParticipantTestHelper.assertExpectedProducerResults;
 import static org.mockito.Matchers.isA;
 import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.inOrder;
@@ -87,7 +87,7 @@ public class ProducerParticipantTest ext
         ParticipantResult result = _producer.doIt(CLIENT_NAME);
 
         long expectedPublishedStartTime = _testStartTime + delay;
-        assertExpectedResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
expectedPublishedStartTime, numberOfMessages, PAYLOAD_SIZE_PER_MESSAGE, 
totalPayloadSize, null);
+        assertExpectedProducerResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
expectedPublishedStartTime, numberOfMessages, PAYLOAD_SIZE_PER_MESSAGE, 
totalPayloadSize, null);
     }
 
 
@@ -120,7 +120,7 @@ public class ProducerParticipantTest ext
         _command.setDeliveryMode(deliveryMode);
 
         ParticipantResult result = (ParticipantResult) 
_producer.doIt(CLIENT_NAME);
-        assertExpectedResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
_testStartTime, numberOfMessages, PAYLOAD_SIZE_PER_MESSAGE, totalPayloadSize, 
null);
+        assertExpectedProducerResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
_testStartTime, numberOfMessages, PAYLOAD_SIZE_PER_MESSAGE, totalPayloadSize, 
null);
 
         
_inOrder.verify(_delegate).sendNextMessage(isA(CreateProducerCommand.class));
         _inOrder.verify(_delegate).calculatePayloadSizeFrom(_mockMessage);
@@ -134,7 +134,7 @@ public class ProducerParticipantTest ext
         _command.setMaximumDuration(duration);
 
         ParticipantResult result = _producer.doIt(CLIENT_NAME);
-        assertExpectedResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
_testStartTime, null, PAYLOAD_SIZE_PER_MESSAGE, null, duration);
+        assertExpectedProducerResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
_testStartTime, null, PAYLOAD_SIZE_PER_MESSAGE, null, duration);
 
         verify(_delegate, 
atLeastOnce()).sendNextMessage(isA(CreateProducerCommand.class));
         verify(_delegate, 
atLeastOnce()).calculatePayloadSizeFrom(_mockMessage);
@@ -151,7 +151,7 @@ public class ProducerParticipantTest ext
         _command.setBatchSize(3);
 
         ParticipantResult result = _producer.doIt(CLIENT_NAME);
-        assertExpectedResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
_testStartTime, numberOfMessages, PAYLOAD_SIZE_PER_MESSAGE, totalPayloadSize, 
null);
+        assertExpectedProducerResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
_testStartTime, numberOfMessages, PAYLOAD_SIZE_PER_MESSAGE, totalPayloadSize, 
null);
 
         verify(_delegate, 
times(numberOfMessages)).sendNextMessage(isA(CreateProducerCommand.class));
         verify(_delegate, 
times(numberOfMessages)).calculatePayloadSizeFrom(_mockMessage);
@@ -172,7 +172,7 @@ public class ProducerParticipantTest ext
         _command.setInterval(publishInterval);
 
         ParticipantResult result = _producer.doIt(CLIENT_NAME);
-        assertExpectedResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
_testStartTime, numberOfMessages, null, totalPayloadSize, 
expectedTimeToRunTest);
+        assertExpectedProducerResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
_testStartTime, numberOfMessages, null, totalPayloadSize, 
expectedTimeToRunTest);
 
         verify(_delegate, 
times(numberOfMessages)).sendNextMessage(isA(CreateProducerCommand.class));
         verify(_delegate, 
times(numberOfMessages)).calculatePayloadSizeFrom(_mockMessage);
@@ -196,7 +196,7 @@ public class ProducerParticipantTest ext
         ParticipantResult result = _producer.doIt(CLIENT_NAME);
 
         final int expectedPayloadResultPayloadSize = 0;
-        assertExpectedResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
_testStartTime, numberOfMessages, expectedPayloadResultPayloadSize, 
totalPayloadSize, null);
+        assertExpectedProducerResults(result, PARTICIPANT_NAME1, CLIENT_NAME, 
_testStartTime, numberOfMessages, expectedPayloadResultPayloadSize, 
totalPayloadSize, null);
 
         verify(_delegate, 
times(numberOfMessages)).sendNextMessage(isA(CreateProducerCommand.class));
         verify(_delegate, 
times(numberOfMessages)).calculatePayloadSizeFrom(_mockMessage);

Modified: 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/ClientRegistryTest.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/ClientRegistryTest.java?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/ClientRegistryTest.java
 (original)
+++ 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/ClientRegistryTest.java
 Mon Apr 23 12:44:37 2012
@@ -18,6 +18,9 @@
  */
 package org.apache.qpid.disttest.controller;
 
+import java.util.Timer;
+import java.util.TimerTask;
+
 import junit.framework.TestCase;
 
 import org.apache.qpid.disttest.DistributedTestException;
@@ -25,6 +28,8 @@ import org.apache.qpid.disttest.Distribu
 public class ClientRegistryTest extends TestCase
 {
     private static final String CLIENT1_REGISTERED_NAME = 
"CLIENT1_REGISTERED_NAME";
+    private static final String CLIENT2_REGISTERED_NAME = 
"CLIENT2_REGISTERED_NAME";
+    private static final int AWAIT_DELAY = 100;
 
     private ClientRegistry _clientRegistry = new ClientRegistry();
 
@@ -51,7 +56,44 @@ public class ClientRegistryTest extends 
         }
     }
 
+    public void testAwaitOneClientWhenClientNotRegistered()
+    {
+        int numberOfClientsAbsent = _clientRegistry.awaitClients(1, 
AWAIT_DELAY);
+        assertEquals(1, numberOfClientsAbsent);
+    }
 
+    public void testAwaitOneClientWhenClientAlreadyRegistered()
+    {
+        _clientRegistry.registerClient(CLIENT1_REGISTERED_NAME);
 
+        int numberOfClientsAbsent = _clientRegistry.awaitClients(1, 
AWAIT_DELAY);
+        assertEquals(0, numberOfClientsAbsent);
+    }
+
+    public void testAwaitTwoClientWhenClientRegistersWhilstWaiting()
+    {
+        _clientRegistry.registerClient(CLIENT1_REGISTERED_NAME);
+        registerClientLater(CLIENT2_REGISTERED_NAME, 50);
 
+        int numberOfClientsAbsent = _clientRegistry.awaitClients(2, 
AWAIT_DELAY);
+        assertEquals(0, numberOfClientsAbsent);
+    }
+
+    private void registerClientLater(final String clientName, long 
delayInMillis)
+    {
+        doLater(new TimerTask()
+        {
+            @Override
+            public void run()
+            {
+                _clientRegistry.registerClient(clientName);
+            }
+        }, delayInMillis);
+    }
+
+    private void doLater(TimerTask task, long delayInMillis)
+    {
+        Timer timer = new Timer();
+        timer.schedule(task, delayInMillis);
+    }
 }

Modified: 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/ControllerTest.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/ControllerTest.java?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/ControllerTest.java
 (original)
+++ 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/controller/ControllerTest.java
 Mon Apr 23 12:44:37 2012
@@ -30,8 +30,6 @@ import static org.mockito.Mockito.when;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
-import java.util.Timer;
-import java.util.TimerTask;
 
 import junit.framework.TestCase;
 
@@ -50,9 +48,7 @@ import org.mockito.stubbing.Answer;
 public class ControllerTest extends TestCase
 {
     private static final String CLIENT1_REGISTERED_NAME = "client-uid1";
-    private static final String CLIENT2_REGISTERED_NAME = "client-uid2";
 
-    private static final int DELAY = 100;
     private static final long COMMAND_RESPONSE_TIMEOUT = 1000;
     private static final long REGISTRATION_TIMEOUT = 1000;
 
@@ -104,43 +100,19 @@ public class ControllerTest extends Test
         }
     }
 
-    public void testControllerRequiresOneClientRegistration()
-    {
-        Config configWithOneClient = createMockConfig(1);
-
-        _controller.setConfig(configWithOneClient);
-        registerClientAndAwait(CLIENT1_REGISTERED_NAME);
-    }
-
     public void testControllerReceivesTwoExpectedClientRegistrations()
     {
         Config configWithTwoClients = createMockConfig(2);
         _controller.setConfig(configWithTwoClients);
+        when(_clientRegistry.awaitClients(2, 
REGISTRATION_TIMEOUT)).thenReturn(0);
 
-        registerClientLater(_controller, CLIENT1_REGISTERED_NAME);
-        registerClientLater(_controller, CLIENT2_REGISTERED_NAME);
         _controller.awaitClientRegistrations();
     }
 
     public void testControllerDoesntReceiveAnyRegistrations()
     {
-        try
-        {
-            _controller.awaitClientRegistrations();
-            fail("Exception not thrown");
-        }
-        catch (DistributedTestException e)
-        {
-            // PASS
-        }
-    }
-
-    public void testControllerDoesntReceiveTwoExpectedClientRegistrations()
-    {
-        Config configWithTwoClients = createMockConfig(2);
-        _controller.setConfig(configWithTwoClients);
+        when(_clientRegistry.awaitClients(1, 
REGISTRATION_TIMEOUT)).thenReturn(1);
 
-        registerClientLater(_controller, CLIENT1_REGISTERED_NAME); // only 
receives one out of two expected registrations
         try
         {
             _controller.awaitClientRegistrations();
@@ -202,12 +174,6 @@ public class ControllerTest extends Test
         return config;
     }
 
-    private void doLater(TimerTask task, long delayInMillis)
-    {
-        Timer timer = new Timer();
-        timer.schedule(task, delayInMillis);
-    }
-
     private Config createMockConfig(int numberOfClients)
     {
         Config config = mock(Config.class);
@@ -215,27 +181,6 @@ public class ControllerTest extends Test
         return config;
     }
 
-    private void registerClientAndAwait(String... clientNames)
-    {
-        for (String clientName : clientNames)
-        {
-            registerClientLater(_controller, clientName);
-        }
-        _controller.awaitClientRegistrations();
-    }
-
-    private void registerClientLater(final Controller controller, final String 
clientName)
-    {
-        doLater(new TimerTask()
-        {
-            @Override
-            public void run()
-            {
-                controller.registerClient(new 
RegisterClientCommand(clientName, "dummy"));
-            }
-        }, DELAY);
-    }
-
     private TestRunnerFactory createTestFactoryReturningMock()
     {
         TestRunnerFactory testRunnerFactory = mock(TestRunnerFactory.class);

Modified: 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/message/ParticipantResultTest.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/message/ParticipantResultTest.java?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/message/ParticipantResultTest.java
 (original)
+++ 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/message/ParticipantResultTest.java
 Mon Apr 23 12:44:37 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.qpid.disttest.message;
 
-import static org.apache.qpid.disttest.message.ParticipantAttribute.BATCH_SIZE;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.*;
 import static 
org.apache.qpid.disttest.message.ParticipantAttribute.CONFIGURED_CLIENT_NAME;
 import static 
org.apache.qpid.disttest.message.ParticipantAttribute.DELIVERY_MODE;
 import static 
org.apache.qpid.disttest.message.ParticipantAttribute.ERROR_MESSAGE;
@@ -67,6 +67,9 @@ public class ParticipantResultTest exten
         long endTime = startTime + timeTaken;
         long maximumDuration = 1000;
 
+        int totalNumberOfConsumers = 1;
+        int totalNumberOfProducers = 1;
+
         result.setParticipantName(participantName);
         result.setTestName(testName);
         result.setIterationNumber(iterationNumber);
@@ -74,12 +77,15 @@ public class ParticipantResultTest exten
 
         result.setNumberOfMessagesProcessed(numberOfMessages);
         result.setConfiguredClientName(clientConfiguredName);
-        result.setBatchSize(10);
+        result.setBatchSize(batchSize);
 
         result.setStartDate(new Date(startTime));
         result.setEndDate(new Date(endTime));
         result.setMaximumDuration(maximumDuration);
 
+        result.setTotalNumberOfConsumers(totalNumberOfConsumers);
+        result.setTotalNumberOfProducers(totalNumberOfProducers);
+
         result.setErrorMessage(errorMessage);
 
         assertEquals(participantName,      
result.getAttributes().get(PARTICIPANT_NAME));
@@ -87,8 +93,12 @@ public class ParticipantResultTest exten
         assertEquals(clientConfiguredName,   
result.getAttributes().get(CONFIGURED_CLIENT_NAME));
         assertEquals(numberOfMessages,       
result.getAttributes().get(NUMBER_OF_MESSAGES_PROCESSED));
         assertEquals(timeTaken,              
result.getAttributes().get(TIME_TAKEN));
+        assertEquals(timeTaken,              
result.getAttributes().get(TIME_TAKEN));
+        assertEquals(timeTaken,              
result.getAttributes().get(TIME_TAKEN));
         assertEquals(batchSize,              
result.getAttributes().get(BATCH_SIZE));
         assertEquals(maximumDuration,        
result.getAttributes().get(MAXIMUM_DURATION));
+        assertEquals(totalNumberOfConsumers, 
result.getAttributes().get(TOTAL_NUMBER_OF_CONSUMERS));
+        assertEquals(totalNumberOfProducers, 
result.getAttributes().get(TOTAL_NUMBER_OF_PRODUCERS));
         assertEquals(errorMessage,           
result.getAttributes().get(ERROR_MESSAGE));
         assertEquals(iterationNumber,         
result.getAttributes().get(ITERATION_NUMBER));
     }

Modified: 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregatorTest.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregatorTest.java?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregatorTest.java
 (original)
+++ 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/ParticipantResultAggregatorTest.java
 Mon Apr 23 12:44:37 2012
@@ -179,4 +179,27 @@ public class ParticipantResultAggregator
         assertEquals(0, aggregratedResult.getPayloadSize());
     }
 
+    public void testSumNumberOfConsumerAndProducers() throws Exception
+    {
+        final int expectedNumberOfProducers = 1;
+        final int expectedNumberOfConsumers = 2;
+
+        ParticipantResult result1 = new ParticipantResult();
+        result1.setTotalNumberOfConsumers(1);
+
+        ParticipantResult result2 = new ParticipantResult();
+        result2.setTotalNumberOfConsumers(1);
+
+        ParticipantResult result3 = new ParticipantResult();
+        result2.setTotalNumberOfProducers(1);
+
+        _aggregator.aggregate(result1);
+        _aggregator.aggregate(result2);
+        _aggregator.aggregate(result3);
+
+        ParticipantResult aggregratedResult = 
_aggregator.getAggregatedResult();
+        assertEquals(expectedNumberOfConsumers, 
aggregratedResult.getTotalNumberOfConsumers());
+        assertEquals(expectedNumberOfProducers, 
aggregratedResult.getTotalNumberOfProducers());
+    }
+
 }

Modified: 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java
 (original)
+++ 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/aggregation/TestResultAggregatorTest.java
 Mon Apr 23 12:44:37 2012
@@ -78,17 +78,17 @@ public class TestResultAggregatorTest ex
         assertMinimalAggregatedResults(
                 aggregatedTestResult.getAllParticipantResult(),
                 TEST1_NAME, TEST1_ITERATION_NUMBER,
-                NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL);
+                NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 1);
 
         assertMinimalAggregatedResults(
                 aggregatedTestResult.getAllConsumerParticipantResult(),
                 TEST1_NAME, TEST1_ITERATION_NUMBER,
-                NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL);
+                NUMBER_OF_MESSAGES_CONSUMED_IN_TOTAL, 2, 0);
 
         assertMinimalAggregatedResults(
                 aggregatedTestResult.getAllProducerParticipantResult(),
                 TEST1_NAME, TEST1_ITERATION_NUMBER,
-                NUMBER_OF_MESSAGES_PRODUCED);
+                NUMBER_OF_MESSAGES_PRODUCED, 0, 1);
     }
 
     public void testAggregateResultsWhenParticipantErrored()
@@ -103,11 +103,13 @@ public class TestResultAggregatorTest ex
         assertEquals(TestResultAggregator.AGGREGATED_ERROR_MESSAGE, 
aggregatedTestResult.getAllParticipantResult().getErrorMessage());
     }
 
-    private void assertMinimalAggregatedResults(ParticipantResult result, 
String expectedTestName, int expectedIterationNumber, long 
expectedNumberOfMessagesProcessed)
+    private void assertMinimalAggregatedResults(ParticipantResult result, 
String expectedTestName, int expectedIterationNumber, long 
expectedNumberOfMessagesProcessed, int expectedTotalNumberOfConsumers, int 
expectedTotalNumberOfProducers)
     {
         assertEquals("Unexpected test name in " + result.getParticipantName(), 
expectedTestName, result.getTestName());
         assertEquals("Unexpected iteration number in " + 
result.getParticipantName(), expectedIterationNumber, 
result.getIterationNumber());
         assertEquals("Unexpected number of messages processed in " + 
result.getParticipantName(), expectedNumberOfMessagesProcessed, 
result.getNumberOfMessagesProcessed());
+        assertEquals("Unexpected total number of consumers " + 
result.getParticipantName(), expectedTotalNumberOfConsumers, 
result.getTotalNumberOfConsumers());
+        assertEquals("Unexpected total number of producers " + 
result.getParticipantName(), expectedTotalNumberOfProducers, 
result.getTotalNumberOfProducers());
     }
 
     private TestResult createResultsFromTest()
@@ -115,25 +117,27 @@ public class TestResultAggregatorTest ex
         TestResult testResult = new TestResult(TEST1_NAME);
 
         ConsumerParticipantResult consumerResult1 = new 
ConsumerParticipantResult();
-        setPropertiesOn(consumerResult1, TEST1_NAME, TEST1_ITERATION_NUMBER, 
CONSUMER_PARTICIPANT_NAME1, NUMBER_OF_MESSAGES_PROCESSED_PER_CONSUMER, 
PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED_PER_CONSUMER, CONSUMER1_STARTDATE, 
CONSUMER1_ENDDATE);
+        setPropertiesOn(consumerResult1, TEST1_NAME, TEST1_ITERATION_NUMBER, 
CONSUMER_PARTICIPANT_NAME1, NUMBER_OF_MESSAGES_PROCESSED_PER_CONSUMER, 
PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED_PER_CONSUMER, CONSUMER1_STARTDATE, 
CONSUMER1_ENDDATE, 1, 0);
         testResult.addParticipantResult(consumerResult1);
 
         ConsumerParticipantResult consumerResult2 = new 
ConsumerParticipantResult();
-        setPropertiesOn(consumerResult2, TEST1_NAME, TEST1_ITERATION_NUMBER, 
CONSUMER_PARTICIPANT_NAME2, NUMBER_OF_MESSAGES_PROCESSED_PER_CONSUMER, 
PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED_PER_CONSUMER, CONSUMER2_STARTDATE, 
CONSUMER2_ENDDATE);
+        setPropertiesOn(consumerResult2, TEST1_NAME, TEST1_ITERATION_NUMBER, 
CONSUMER_PARTICIPANT_NAME2, NUMBER_OF_MESSAGES_PROCESSED_PER_CONSUMER, 
PAYLOAD_SIZE, TOTAL_PAYLOAD_PROCESSED_PER_CONSUMER, CONSUMER2_STARTDATE, 
CONSUMER2_ENDDATE, 1, 0);
         testResult.addParticipantResult(consumerResult2);
 
         ParticipantResult producerResult = new ProducerParticipantResult();
-        setPropertiesOn(producerResult, TEST1_NAME, TEST1_ITERATION_NUMBER, 
PRODUCER_PARTICIPANT_NAME, NUMBER_OF_MESSAGES_PRODUCED, PAYLOAD_SIZE, 
TOTAL_PAYLOAD_PRODUCED_IN_TOTAL, PRODUCER_STARTDATE, PRODUCER_ENDDATE);
+        setPropertiesOn(producerResult, TEST1_NAME, TEST1_ITERATION_NUMBER, 
PRODUCER_PARTICIPANT_NAME, NUMBER_OF_MESSAGES_PRODUCED, PAYLOAD_SIZE, 
TOTAL_PAYLOAD_PRODUCED_IN_TOTAL, PRODUCER_STARTDATE, PRODUCER_ENDDATE, 0, 1);
         testResult.addParticipantResult(producerResult);
 
         return testResult;
     }
 
-    private void setPropertiesOn(ParticipantResult participantResult, String 
testName, int iterationNumber, String participantName, long 
numberOfMessagesProcessed, int payloadSize, long totalPayloadProcessed, long 
start, long end)
+    private void setPropertiesOn(ParticipantResult participantResult, String 
testName, int iterationNumber, String participantName, long 
numberOfMessagesProcessed, int payloadSize, long totalPayloadProcessed, long 
start, long end, int totalNumberOfConsumers, int totalNumberOfProducers)
     {
         participantResult.setParticipantName(participantName);
         participantResult.setTestName(testName);
         participantResult.setIterationNumber(iterationNumber);
+        participantResult.setTotalNumberOfConsumers(totalNumberOfConsumers);
+        participantResult.setTotalNumberOfProducers(totalNumberOfProducers);
 
         
participantResult.setNumberOfMessagesProcessed(numberOfMessagesProcessed);
         participantResult.setPayloadSize(payloadSize);

Modified: 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/CSVFormaterTest.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/CSVFormaterTest.java?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/CSVFormaterTest.java
 (original)
+++ 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/CSVFormaterTest.java
 Mon Apr 23 12:44:37 2012
@@ -30,16 +30,18 @@ import static org.apache.qpid.disttest.m
 import static org.apache.qpid.disttest.message.ParticipantAttribute.IS_TOPIC;
 import static 
org.apache.qpid.disttest.message.ParticipantAttribute.ITERATION_NUMBER;
 import static 
org.apache.qpid.disttest.message.ParticipantAttribute.MAXIMUM_DURATION;
-import static 
org.apache.qpid.disttest.message.ParticipantAttribute.PAYLOAD_SIZE;
 import static 
org.apache.qpid.disttest.message.ParticipantAttribute.NUMBER_OF_MESSAGES_PROCESSED;
 import static 
org.apache.qpid.disttest.message.ParticipantAttribute.PARTICIPANT_NAME;
+import static 
org.apache.qpid.disttest.message.ParticipantAttribute.PAYLOAD_SIZE;
 import static org.apache.qpid.disttest.message.ParticipantAttribute.PRIORITY;
 import static 
org.apache.qpid.disttest.message.ParticipantAttribute.PRODUCER_INTERVAL;
 import static 
org.apache.qpid.disttest.message.ParticipantAttribute.PRODUCER_START_DELAY;
 import static org.apache.qpid.disttest.message.ParticipantAttribute.TEST_NAME;
+import static org.apache.qpid.disttest.message.ParticipantAttribute.THROUGHPUT;
 import static org.apache.qpid.disttest.message.ParticipantAttribute.TIME_TAKEN;
 import static 
org.apache.qpid.disttest.message.ParticipantAttribute.TIME_TO_LIVE;
-import static org.apache.qpid.disttest.message.ParticipantAttribute.THROUGHPUT;
+import static 
org.apache.qpid.disttest.message.ParticipantAttribute.TOTAL_NUMBER_OF_CONSUMERS;
+import static 
org.apache.qpid.disttest.message.ParticipantAttribute.TOTAL_NUMBER_OF_PRODUCERS;
 import static 
org.apache.qpid.disttest.message.ParticipantAttribute.TOTAL_PAYLOAD_PROCESSED;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -56,7 +58,6 @@ import org.apache.qpid.disttest.controll
 import org.apache.qpid.disttest.controller.TestResult;
 import org.apache.qpid.disttest.message.ParticipantAttribute;
 import org.apache.qpid.disttest.message.ParticipantResult;
-import org.apache.qpid.disttest.results.formatting.CSVFormater;
 
 public class CSVFormaterTest extends TestCase
 {
@@ -110,6 +111,8 @@ public class CSVFormaterTest extends Tes
         participantAttributes.put(IS_SELECTOR, false);
         participantAttributes.put(IS_NO_LOCAL, true);
         participantAttributes.put(IS_SYNCHRONOUS_CONSUMER, false);
+        participantAttributes.put(TOTAL_NUMBER_OF_CONSUMERS, 1);
+        participantAttributes.put(TOTAL_NUMBER_OF_PRODUCERS, 2);
         participantAttributes.put(TOTAL_PAYLOAD_PROCESSED, 1024);
         participantAttributes.put(THROUGHPUT, 2048);
         participantAttributes.put(TIME_TAKEN, 1000);

Modified: 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/expectedOutput.csv
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/expectedOutput.csv?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/expectedOutput.csv
 (original)
+++ 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/results/formatting/expectedOutput.csv
 Mon Apr 23 12:44:37 2012
@@ -1,2 +1,2 @@
-Test Name,Iteration number,Client Name,Participant name,Number of 
messages,Payload size (bytes),Priority,Time to live (ms),Delivery mode,Batch 
size,Maximum duration (ms),Producer start delay (ms),Producer interval (ms),Is 
topic,Is durable subscription,Is browsing subscription,Is selector,Is no 
local,Is synchronous consumer,Total payload processed (bytes),Throughput 
(kbytes/s),Time taken (ms),Error message
-TEST1,0,CONFIGURED_CLIENT1,PARTICIPANT,1,2,3,4,5,6,7,8,9,true,false,true,false,true,false,1024,2048,1000,error
\ No newline at end of file
+testName,iterationNumber,clientName,participantName,numberOfMessages,payloadSizeB,priority,timeToLiveMs,deliveryMode,batchSize,maximumDurationMs,producerStartDelayMs,producerIntervalMs,isTopic,isDurableSubscription,isBrowsingSubscription,isSelector,isNoLocal,isSynchronousConsumer,totalNumberOfConsumers,totalNumberOfProducers,totalPayloadProcessedB,throughputKbPerS,timeTakenMs,errorMessage
+TEST1,0,CONFIGURED_CLIENT1,PARTICIPANT,1,2,3,4,5,6,7,8,9,true,false,true,false,true,false,1,2,1024,2048,1000,error
\ No newline at end of file

Modified: 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/endtoend/EndToEndTest.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/endtoend/EndToEndTest.java?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/endtoend/EndToEndTest.java
 (original)
+++ 
qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/systest/disttest/endtoend/EndToEndTest.java
 Mon Apr 23 12:44:37 2012
@@ -19,7 +19,7 @@
 package org.apache.qpid.systest.disttest.endtoend;
 
 import static org.apache.qpid.disttest.AbstractRunner.JNDI_CONFIG_PROP;
-import static org.apache.qpid.disttest.ControllerRunner.OUTPUT_FILE_PROP;
+import static org.apache.qpid.disttest.ControllerRunner.OUTPUT_DIR_PROP;
 import static org.apache.qpid.disttest.ControllerRunner.TEST_CONFIG_PROP;
 
 import java.io.File;
@@ -39,18 +39,19 @@ public class EndToEndTest extends QpidBr
 
     public void testRunner() throws Exception
     {
-        File csvOutputFile = createTemporaryCsvFile();
-        assertFalse("CSV output file must exist",csvOutputFile.exists());
+        File csvOutputDir = createTemporaryCsvDirectory();
+        assertTrue("CSV output dir must not exist",csvOutputDir.isDirectory());
 
         final String[] args = new String[] {TEST_CONFIG_PROP + "=" + 
TEST_CONFIG,
                                             JNDI_CONFIG_PROP + "=" + 
JNDI_CONFIG_FILE,
-                                            OUTPUT_FILE_PROP  + "=" + 
csvOutputFile.getAbsolutePath()};
+                                            OUTPUT_DIR_PROP  + "=" + 
csvOutputDir.getAbsolutePath()};
         _runner = new ControllerRunner();
         _runner.parseArgumentsIntoConfig(args);
         _runner.runController();
 
-        assertTrue("CSV output file must exist", csvOutputFile.exists());
-        final String csvContents = FileUtils.readFileAsString(csvOutputFile);
+        File expectedCsvOutputFile = new File(csvOutputDir, "endtoend.csv");
+        assertTrue("CSV output file must exist", 
expectedCsvOutputFile.exists());
+        final String csvContents = 
FileUtils.readFileAsString(expectedCsvOutputFile);
         final String[] csvLines = csvContents.split("\n");
 
         int numberOfHeaders = 1;
@@ -82,13 +83,13 @@ public class EndToEndTest extends QpidBr
 
     }
 
-    private File createTemporaryCsvFile() throws IOException
+    private File createTemporaryCsvDirectory() throws IOException
     {
-        File csvFile = File.createTempFile(getName(), ".csv");
-        csvFile.delete();
-        csvFile.deleteOnExit();
-
-        return csvFile;
+        String tmpDir = System.getProperty("java.io.tmpdir");
+        File csvDir = new File(tmpDir, "csv");
+        csvDir.mkdir();
+        csvDir.deleteOnExit();
+        return csvDir;
     }
 
 }

Modified: qpid/trunk/qpid/java/test-profiles/CPPExcludes
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/CPPExcludes?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/CPPExcludes (original)
+++ qpid/trunk/qpid/java/test-profiles/CPPExcludes Mon Apr 23 12:44:37 2012
@@ -172,3 +172,8 @@ org.apache.qpid.scripts.QpidPasswdTest#*
 
 // QPID-3604: Immediate Prefetch no longer supported by 0-10
 
org.apache.qpid.client.AsynchMessageListenerTest#testImmediatePrefetchWithMessageListener
+
+// QPID-3936: Exclude Performance Test Framework tests
+org.apache.qpid.systest.disttest.*
+org.apache.qpid.disttest.*
+

Modified: qpid/trunk/qpid/java/test-profiles/Excludes
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/Excludes?rev=1329215&r1=1329214&r2=1329215&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/Excludes (original)
+++ qpid/trunk/qpid/java/test-profiles/Excludes Mon Apr 23 12:44:37 2012
@@ -31,9 +31,3 @@ org.apache.qpid.server.logging.DerbyMess
 
 org.apache.qpid.client.ssl.SSLTest#testVerifyLocalHostLocalDomain
 
-// QPID-3936: disable the systests temporarily
-org.apache.qpid.systest.disttest.*
-org.apache.qpid.systest.disttest.clientonly.*
-org.apache.qpid.systest.disttest.controlleronly.*
-org.apache.qpid.systest.disttest.controllerandclient.*
-org.apache.qpid.systest.disttest.endtoend.*



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to