ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45227] JUnit summary reports bogus running of the last test after a timeout
Date Wed, 06 Oct 2010 17:51:14 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45227

--- Comment #3 from Ivan Kronkvist <ikronkvist@yahoo.com> 2010-10-06 13:51:11 EDT ---
The fix, below, only tales the first part of the package name. For instance if
my package is org.apache.junit.tests.MyTest, the output displayed will be 

[junit] Running org.Batch-With-Multiple-Tests
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Tests FAILED (timeout)

And thus still leads to a wild-goose chase. Much better solution is to find tha
last "." in the test name so the real package can be displayed.


private static JUnitTest createDummyTestForBatchTest(JUnitTest test) {
    JUnitTest t = (JUnitTest) test.clone();
    int index = test.getName().indexOf(".");
    // make sure test looks as if it was in the same "package" as
    // the last test of the batch
    String pack = index > 0 ? test.getName().substring(0, index + 1) : "";
    t.setName(pack + NAME_OF_DUMMY_TEST);
    return t;
}

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Mime
View raw message