JUnit 3.8.1 Modified

I just quickly moved over the changes from my 4.0-based source to the JUnit 3.8.2 source. I found that, when being restricted to the Java 1.4 API, debugging information is a lot harder to get. I can’t find stack traces of the threads involved, for example.

When I ran the DrJava unit test suite with the modified version of JUnit 3.8.2, I got these results:

Testsuite: edu.rice.cs.drjava.model.GlobalModelJUnitTest
Tests run: 14, Failures: 1, Errors: 0, Time elapsed: 18.958 sec

Testcase: testJUnitAllWithErrors (edu.rice.cs.drjava.model.GlobalModelJUnitTest): FAILED junit.framework.AssertionFailedError: test case has one error reported expected: <2> but was:<1>

Testsuite: edu.rice.cs.drjava.model.MultiThreadedTestCaseTest Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.011 sec

Testcase: testUncaught (edu.rice.cs.drjava.model.MultiThreadedTestCaseTest): FAILED junit.framework.AssertionFailedError: expected:<1> but was:<0>

Testsuite: edu.rice.cs.drjava.model.junit.JUnitErrorModelTest Tests run: 4, Failures: 1, Errors: 1, Time elapsed: 6.293 sec

Testcase: testErrorsArrayInOrder (edu.rice.cs.drjava.model.junit.JUnitErrorModelTest): FAILED junit.framework.AssertionFailedError: the test results should have one error and one failure 1 expected: <2> but was:<1>

Testcase: testVerifyErrorHandledCorrectly (edu.rice.cs.drjava.model.junit.JUnitErrorModelTest): Caused an ERROR edu.rice.cs.util.UnexpectedException: java.lang.InterruptedException

Testsuite: edu.rice.cs.drjava.model.repl.InteractionsModelTest Tests run: 10, Failures: 0, Errors: 1, Time elapsed: 1.486 sec

Testcase: testInterpretCurrentInteractionWithIncompleteInput (edu.rice.cs.drjava.model.repl.InteractionsModelTest): Caused an ERROR junit.framework.TestCase$MultithreadedTestError: The test did not perform a join on all spawned threads.

Testsuite: edu.rice.cs.drjava.ui.InteractionsPaneTest Tests run: 14, Failures: 0, Errors: 1, Time elapsed: 4.876 sec

Testcase: testPromptListClearedOnReset (edu.rice.cs.drjava.ui.InteractionsPaneTest): Caused an ERROR junit.framework.TestCase$MultithreadedTestError: The test did not perform a join on all spawned threads.

Testsuite: edu.rice.cs.util.CompletionMonitorTest Tests run: 2, Failures: 0, Errors: 1, Time elapsed: 0.061 sec

Testcase: testDegenerateSignal (edu.rice.cs.util.CompletionMonitorTest): Caused an ERROR junit.framework.TestCase$MultithreadedTestError: The test did not perform a join on all spawned threads.

Testsuite: edu.rice.cs.util.ReaderWriterLockTest Tests run: 7, Failures: 0, Errors: 1, Time elapsed: 0.138 sec

Testcase: testMultipleReaders (edu.rice.cs.util.ReaderWriterLockTest): Caused an ERROR junit.framework.TestCase$MultithreadedTestError: The test did not perform a join on all spawned threads.

This already looks a lot better than the weird RMI “unmarshall” exceptions. It looks like we have three failed tests due to wrong counts, one due to an InterruptedException, and a whole four tests with bad join policies.

I’ll look at it more in the morning. I don’t really like this 3.8.2 system. It constrains me too much. I want something 5.0, with annotations, so I’ll have to see if I can rewrite DrJava or bring the missing files back to JUnit4.

About Mathias

Software development engineer. Principal developer of DrJava. Recent Ph.D. graduate from the Department of Computer Science at Rice University.
This entry was posted in Concurrent Unit Testing. Bookmark the permalink.

Leave a Reply