{
log.debug("public TestResult doRun(Test \"" + test + "\", boolean " + wait + "): called");
// Wrap all tests in the test suite with WrappedSuiteTestDecorators. This is quite ugly and a bit baffling,
// but the reason it is done is because the JUnit implementation of TestDecorator has some bugs in it.
WrappedSuiteTestDecorator targetTest = null;
if (test instanceof TestSuite)
{
log.debug("targetTest is a TestSuite");
TestSuite suite = (TestSuite) test;
int numTests = suite.countTestCases();
log.debug("There are " + numTests + " in the suite.");
for (int i = 0; i < numTests; i++)
{
Test nextTest = suite.testAt(i);
log.debug("suite.testAt(" + i + ") = " + nextTest);
if (nextTest instanceof FrameworkBaseCase)
{
log.debug("nextTest is a FrameworkBaseCase");
}
}
targetTest = new WrappedSuiteTestDecorator(suite);
log.debug("Wrapped with a WrappedSuiteTestDecorator.");
}
// Wrap the tests in a suitable distributed test decorator, to perform the invite/test cycle.
targetTest = newTestDecorator(targetTest, enlistedClients, conversationFactory, connection);