org.apache.qpid.test.framework.distributedtesting
Class InteropTestDecorator

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.extensions.TestDecorator
          extended by org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator
              extended by org.apache.qpid.test.framework.distributedtesting.DistributedTestDecorator
                  extended by org.apache.qpid.test.framework.distributedtesting.InteropTestDecorator
All Implemented Interfaces:
junit.framework.Test

public class InteropTestDecorator
extends DistributedTestDecorator

DistributedTestDecorator is a test decorator, written to implement the interop test specification. Given a list of enlisted test clients, that are available to run interop tests, this decorator invites them to participate in each test in the wrapped test suite. Amongst all the clients that respond to the invite, all pairs are formed, and each pairing (in both directions, but excluding the reflexive pairings) is split into a sender and receivers role and a test case run between them. Any enlisted combinations that do not accept a test invite are automatically failed.

CRC Card
Responsibilities Collaborations
Broadcast test invitations and collect enlists. ConversationFactory.
Output test failures for clients unwilling to run the test case. Coordinator
Execute distributed test cases. FrameworkBaseCase
Fail non-participating pairings. OptOutTestCase


Field Summary
 
Fields inherited from class org.apache.qpid.test.framework.distributedtesting.DistributedTestDecorator
allClients, connection, controlTopic, conversationFactory, testSuite
 
Fields inherited from class org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator
suite
 
Fields inherited from class junit.extensions.TestDecorator
fTest
 
Constructor Summary
InteropTestDecorator(org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator suite, Set<TestClientDetails> availableClients, ConversationFactory controlConversation, Connection controlConnection)
          Creates a wrapped suite test decorator from another one.
 
Method Summary
 CircuitFactory getTestSequencer()
          Should provide the distributed test sequencer to pass to FrameworkBaseCase tests.
 void run(junit.framework.TestResult testResult)
          Broadcasts a test invitation and accetps enlisting from participating clients.
 
Methods inherited from class org.apache.qpid.test.framework.distributedtesting.DistributedTestDecorator
signupClients, toString
 
Methods inherited from class org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator
countTestCases, getAllUnderlyingTests, testAt
 
Methods inherited from class junit.extensions.TestDecorator
basicRun, getTest
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InteropTestDecorator

public InteropTestDecorator(org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator suite,
                            Set<TestClientDetails> availableClients,
                            ConversationFactory controlConversation,
                            Connection controlConnection)
Creates a wrapped suite test decorator from another one.

Parameters:
suite - The test suite.
availableClients - The list of all clients that responded to the compulsory invite.
controlConversation - The conversation helper for the control level, test coordination conversation.
controlConnection - The connection that the coordination messages are sent over.
Method Detail

run

public void run(junit.framework.TestResult testResult)
Broadcasts a test invitation and accetps enlisting from participating clients. The wrapped test case is then repeated for every combination of test clients (provided the wrapped test case extends FrameworkBaseCase.

Any JMSExceptions during the invite/enlist conversation will be allowed to fall through as runtime exceptions, resulting in the non-completion of the test run.

Specified by:
run in interface junit.framework.Test
Specified by:
run in class DistributedTestDecorator
Parameters:
testResult - The the results object to monitor the test results with.
Todo:
Better error recovery for failure of the invite/enlist conversation could be added.

getTestSequencer

public CircuitFactory getTestSequencer()
Should provide the distributed test sequencer to pass to FrameworkBaseCase tests.

Specified by:
getTestSequencer in class DistributedTestDecorator
Returns:
A distributed test sequencer.


Licensed to the Apache Software Foundation