connection = controlConnection;
// Sign available clients up to the test.
for (Test test : getAllUnderlyingTests())
{
FrameworkBaseCase coordTest = (FrameworkBaseCase) test;
// Get all of the clients able to participate in the test.
Set<TestClientDetails> enlists = signupClients(coordTest);
// Check that there were some clients available.
if (enlists.size() == 0)
{
throw new RuntimeException("No clients to test with");
}
// Create a distributed test circuit factory for the test.
CircuitFactory circuitFactory = getTestSequencer();
// Set up the first client in the sender role, and the remainder in the receivers role.
Iterator<TestClientDetails> clients = enlists.iterator();
circuitFactory.setSender(clients.next());
while (clients.hasNext())
{
// Set the sending and receiving client details on the test case.
circuitFactory.setReceiver(clients.next());
}
// Pass down the connection to hold the coordinating conversation over.
circuitFactory.setConversationFactory(conversationFactory);
// If the current test case is a drop-in test, set it up as the currently running test for late joiners to
// add in to. Otherwise the current test field is set to null, to indicate that late joiners are not allowed.
currentTest = (coordTest instanceof DropInTest) ? coordTest : null;
// Execute the test case.
coordTest.setCircuitFactory(circuitFactory);
}
}