Search in sources :

Example 26 with ParticipantResult

use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.

the class TestResultAggregator method aggregateOriginalResults.

private boolean aggregateOriginalResults(ITestResult originalTestResult, ParticipantResultAggregator consumerParticipantResultAggregator, ParticipantResultAggregator producerParticipantResultAggregator) {
    boolean hasError = false;
    for (ParticipantResult result : originalTestResult.getParticipantResults()) {
        consumerParticipantResultAggregator.aggregate(result);
        producerParticipantResultAggregator.aggregate(result);
        if (result.hasError()) {
            hasError = true;
        }
    }
    return hasError;
}
Also used : ConsumerParticipantResult(org.apache.qpid.disttest.message.ConsumerParticipantResult) ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) ProducerParticipantResult(org.apache.qpid.disttest.message.ProducerParticipantResult)

Example 27 with ParticipantResult

use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.

the class TestResultAggregator method aggregateAggregatedResults.

private ParticipantResult aggregateAggregatedResults(ParticipantResultAggregator aggregatedResultsAggregator, ParticipantResult aggregatedProducerResult, ParticipantResult aggregaredConsumerResult) {
    aggregatedResultsAggregator.aggregate(aggregatedProducerResult);
    aggregatedResultsAggregator.aggregate(aggregaredConsumerResult);
    ParticipantResult aggregatedAllResult = aggregatedResultsAggregator.getAggregatedResult();
    return aggregatedAllResult;
}
Also used : ConsumerParticipantResult(org.apache.qpid.disttest.message.ConsumerParticipantResult) ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) ProducerParticipantResult(org.apache.qpid.disttest.message.ProducerParticipantResult)

Example 28 with ParticipantResult

use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.

the class CSVFormatter method format.

public String format(List<ITestResult> results) {
    StringBuilder builder = new StringBuilder();
    builder.append(header());
    for (ITestResult testResult : results) {
        List<ParticipantResult> participantResults = new ArrayList<ParticipantResult>(testResult.getParticipantResults());
        Collections.sort(participantResults, new CSVOrderParticipantResultComparator());
        for (ParticipantResult participantResult : participantResults) {
            Map<ParticipantAttribute, Object> attributes = participantResult.getAttributes();
            builder.append(row(attributes));
        }
    }
    return builder.toString();
}
Also used : ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) ITestResult(org.apache.qpid.disttest.results.aggregation.ITestResult) ParticipantAttribute(org.apache.qpid.disttest.message.ParticipantAttribute) ArrayList(java.util.ArrayList)

Example 29 with ParticipantResult

use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.

the class OrdinaryTestRunnerTest method testSuccessfulTestRunReturnsTestResult.

@Test
public void testSuccessfulTestRunReturnsTestResult() {
    ParticipantResult participantResult = new ParticipantResult(PARTICIPANT_NAME);
    configureMockToReturnResponseTo(CreateConnectionCommand.class, new Response(CLIENT1_REGISTERED_NAME, CommandType.CREATE_CONNECTION), null);
    configureMockToReturnResponseTo(StartTestCommand.class, new Response(CLIENT1_REGISTERED_NAME, CommandType.START_TEST), null);
    configureMockToReturnResponseTo(StartDataCollectionCommand.class, new Response(CLIENT1_REGISTERED_NAME, CommandType.START_DATA_COLLECTION), participantResult);
    configureMockToReturnResponseTo(TearDownTestCommand.class, new Response(CLIENT1_REGISTERED_NAME, CommandType.TEAR_DOWN_TEST), null);
    _testInstance = createTestInstanceWithConnection();
    _testRunner = new OrdinaryTestRunner(_participatingClients, _testInstance, _respondingJmsDelegate, COMMAND_RESPONSE_TIMEOUT, TEST_RESULT_TIMEOUT);
    TestResult testResult = _testRunner.run();
    assertNotNull(testResult);
    assertEquals("Unexpected number of participant results", (long) 1, (long) testResult.getParticipantResults().size());
}
Also used : Response(org.apache.qpid.disttest.message.Response) ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) Test(org.junit.Test)

Example 30 with ParticipantResult

use of org.apache.qpid.disttest.message.ParticipantResult in project qpid-broker-j by apache.

the class ParticipantResultAggregatorTest method testConstantProviderVersionRolledUp.

@Test
public void testConstantProviderVersionRolledUp() throws Exception {
    String providerVersion = "PROVIDER_VERSION";
    ParticipantResult result1 = new ParticipantResult();
    result1.setProtocolVersion(providerVersion);
    ParticipantResult result2 = new ParticipantResult();
    result2.setProtocolVersion(providerVersion);
    _aggregator.aggregate(result1);
    _aggregator.aggregate(result2);
    ParticipantResult aggregatedResult = _aggregator.getAggregatedResult();
    assertEquals(providerVersion, aggregatedResult.getProtocolVersion());
}
Also used : ParticipantResult(org.apache.qpid.disttest.message.ParticipantResult) Test(org.junit.Test)

Aggregations

ParticipantResult (org.apache.qpid.disttest.message.ParticipantResult)38 Test (org.junit.Test)25 ConsumerParticipantResult (org.apache.qpid.disttest.message.ConsumerParticipantResult)9 ProducerParticipantResult (org.apache.qpid.disttest.message.ProducerParticipantResult)9 ITestResult (org.apache.qpid.disttest.results.aggregation.ITestResult)6 Date (java.util.Date)5 TestResult (org.apache.qpid.disttest.controller.TestResult)4 ResultsForAllTests (org.apache.qpid.disttest.controller.ResultsForAllTests)3 File (java.io.File)2 ArrayList (java.util.ArrayList)2 Message (javax.jms.Message)2 ParticipantAttribute (org.apache.qpid.disttest.message.ParticipantAttribute)2 TreeSet (java.util.TreeSet)1 MessageListener (javax.jms.MessageListener)1 Context (javax.naming.Context)1 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 Transformer (javax.xml.transform.Transformer)1 TransformerException (javax.xml.transform.TransformerException)1 DOMSource (javax.xml.transform.dom.DOMSource)1