use of com.jboss.transaction.txinterop.interop.InteropTestSuite in project narayana by jbosstm.
the class TestRunner method execute.
/**
* Execute the specific test against the specified participant.
* @param participantURI The URI of the participant.
* @param testTimeout The test timeout.
* @param asyncTest The asynchronous test flag.
* @param testName The name of the test to execute.
* @return The test result.
*/
public static TestResult execute(final String participantURI, final long testTimeout, final boolean asyncTest, final String testName) {
MessageLogging.clearThreadLog();
final Test test;
if (TestConstants.NAME_ALL_TESTS.equals(testName)) {
final TestSuite testSuite = new TestSuite();
testSuite.addTest(new InteropTestSuite(participantURI, testTimeout, asyncTest, AT_TEST_CLASS));
testSuite.addTest(new InteropTestSuite(participantURI, testTimeout, asyncTest, BA_TEST_CLASS));
test = testSuite;
} else if (TestConstants.NAME_ALL_AT_TESTS.equals(testName)) {
test = new InteropTestSuite(participantURI, testTimeout, asyncTest, AT_TEST_CLASS);
} else if (TestConstants.NAME_ALL_BA_TESTS.equals(testName)) {
test = new InteropTestSuite(participantURI, testTimeout, asyncTest, BA_TEST_CLASS);
} else if (testName.startsWith(TestConstants.PREFIX_AT_TESTS)) {
final Class testClass = AT_TEST_CLASS;
try {
test = createTest(testClass, participantURI, testTimeout, asyncTest, testName);
} catch (final Throwable th) {
System.err.println("Unexpected error instantiating test class: " + th);
return null;
}
} else if (testName.startsWith(TestConstants.PREFIX_BA_TESTS)) {
final Class testClass = BA_TEST_CLASS;
try {
test = createTest(testClass, participantURI, testTimeout, asyncTest, testName);
} catch (final Throwable th) {
System.err.println("Unexpected error instantiating test class: " + th);
return null;
}
} else {
System.err.println("Unidentified test name: " + testName);
return null;
}
MessageLogging.appendThreadLog(LOG_MESSAGE_PREFIX);
final TestResult testResult = new FullTestResult();
test.run(testResult);
MessageLogging.appendThreadLog(LOG_MESSAGE_SUFFIX);
return testResult;
}
Aggregations