Search in sources :

Example 1 with InteropTestSuite

use of com.jboss.transaction.wstf.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, SC007_TEST_CLASS));
        test = testSuite;
    } else if (testName.startsWith(TestConstants.PREFIX_TESTS)) {
        final Class testClass = SC007_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;
}
Also used : InteropTestSuite(com.jboss.transaction.wstf.interop.InteropTestSuite) TestSuite(junit.framework.TestSuite) InteropTestSuite(com.jboss.transaction.wstf.interop.InteropTestSuite) Test(junit.framework.Test) TestResult(junit.framework.TestResult)

Aggregations

InteropTestSuite (com.jboss.transaction.wstf.interop.InteropTestSuite)1 Test (junit.framework.Test)1 TestResult (junit.framework.TestResult)1 TestSuite (junit.framework.TestSuite)1