Summary of Changes between 3.3 and 3.4
-
Eliminated code in ActiveTestSuite that could not compile in VA/Java.
-
Fixed bug related to incorrect error progress feedback when running a single
test.
Summary of Changes between 3.2 and 3.3
Framework
-
Fixed Assert.assertEquals(double,double,double) when the actual value is
a Double.NaN.
Extensions
-
Fixed ActiveTest support. Replaced ActiveTest with an ActiveTestSuite,
the ActiveTestSuite waits until the tests running in separate threads have
finished.
-
Added an example that illustrates how to launch a new VM for running a
Test - see TextRunnerTest.java.
TestRunner
-
Refactored the TestRunner classes, they now all descend from junit.runner.BaseTestRunner.
-
Eliminated the non-loading/loading TestRunner flavors. All TestRunners
are now loading by default except when the TestRunners detect that they
run inside VA/Java (BaseTestRunner.getLoader()).
-
Added a junit.properties file for preference settings. It is stored
in the folder referred to by the "user.home" property. The supported setting
is loading, it can be set to true or false to enable or disable
the loading behavior.
-
Renamed junit.ui to junit.awtui (with backward compatibility).
-
Renamed junit.utils to junit.runner.
-
You can now put test cases that should be reloaded into a JAR file. The
TestCaseClassLoader now supports a simple version of class loading from
a JAR file.
-
Simplified invoking the TestRunners programmatically. They now all
support a static method run(Class test).
-
Clarified the exit behavior of junit.textui.TestRunner:
-
TestRunner only exits the VM when it is invoked by main, when the TestRunner
is invoked by run() it will not explicitly exit and terminate the
VM.
-
TestRunner exits with 0 when the tests passed.
Release
-
Removed VA/Java specific installation support
Summary of Changes between 3.1 and 3.2
-
Fixed bug in the handling of inherited test methods.
-
The junit.swing.TestRunner support selective test execution. A Test Browser
shows the contents of the entered test suite as a tree and you can select
the test case to be run. The Test Browser can be launched from JUnit menu.
-
The history file of junit.swingui.TestRunner is stored in .junit on non
Windows platforms.
-
Support for rerunning a failed test was previously only available inside
VisualAge for Java. It is now generally available when using the LoadingTestRunners.
-
The junit.textui.TestRunner exits with -1 when the test run fails.
Summary of Changes between 2.1 and 3.1
JUnit Framework
-
TestSuite now extracts inherited test methods. The test extraction stops
at the first class that doesn't implement Test.
-
Added support for TestListeners. A TestListeners observes changes to the
TestResult. It enables to have multiple observers on the same result and
allowed us to delete the TestResult subclasses (parallel class hierarchy)
as the TestRunners now implement TestListener. It also allows clients to
generate additional kinds of test run feedback.
-
Added an ExceptionTestCase
class. A TestCase that expects a particular exception to be thrown.
-
Fixed TestSetup so that errors in setUp are caught and reported correctly.
-
Assertion checks where moved from TestCase into a separate Assert
class. This enables programming by contract.
-
Added support for protected blocks. A protected block has to implement
the Protectable
interface. We used it to factor out a common template method to run tests.
To implement your own protected block that logs thrown exceptions, pass
a Protectable to TestResult.runProtected().
-
Clarified and deprecated method names in TestResult: testErrors, testFailures
and runTests are now called errorCount, failureCount and runCount.
-
TestCase.getResult got removed you can add access to the current TestResult
in your own TestCase subclasses.
-
TestCase.setUp() and tearDown() now throw a Throwable, so you can allow
exceptions in setUp() to propagate.
TestRunner
-
There is a new version of a Swing based graphical TestRunner. It supports
a combo box with a persistent history of ran test suites. You can start
it with:
java junit.swingui.TestRunner
There is also a LoadingTestRunner for Swing. The Swing TestRunner requires
Swing 1.1 (javax.swing package structure) or jdk 1.2.
-
Some common code among the TestRunners was moved into the package junit.util.
-
The batch TestRunner unit.textui.TestRunner can now be given a PrintStream
to output the results to.
-
The batch TestRunner can be given a class to run directly. To start the
batch runner from your main you can write:
public static void main(String args[]) {
junit.textui.TestRunner.run(MoneyTest.class);
}
Documentation
-
There is a new article: JUnit a cook's tour included.
Release
-
We no longer provide a .dat file for VAJ users. You install JUnit into
VAJ by importing the resources from the junit.jar and the sources from
the src.zip files.