1<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> 2<html> 3<head> 4 <meta http-equiv="Content-Type" 5 content="text/html; charset=iso-8859-1"> 6 <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> 7 <meta name="Author" content="Erich Gamma & Kent Beck"> 8 <title>JUnit 3.8</title> 9</head> 10<body> 11<h1> 12<b><font color="#00cc00">J</font><font color="#ff0000">U</font><font 13 color="#000000">nit 143.8.2</font></b></h1> 15<hr width="100%"> 16<font color="#000000"><br> 1711/11/2004<br> 18</font> 19<ul> 20 <li><font color="#000000"><a href="#Summary%20of">Summary of Changes</a></font></li> 21 <li> 22 <font color="#000000"><a href="#Contents">Contents</a></font></li> 23 <li> 24 <font color="#000000"><a href="#Installation">Installation</a></font></li> 25 <li> 26 <font color="#000000"><a href="#Getting">Getting Started</a></font></li> 27 <li> 28 <font color="#000000"><a href="#Documentation">Documentation</a></font></li> 29</ul> 30<h2> 31<font><a name="Summary of"></a><font color="#000000">Summary of Changes 32between 3.8.1 and 3.8.2</font></font></h2> 33<font color="#000000">The changes between the versions are minimal and 34the focus was on fixing the accumulated bug reports. The most 35signifanct change is replacing the much-reviled string comparison 36format with something easier to read and use.<br> 37</font> 38<ul> 39 <li>ComparisonFailure shows context. <br> 40 </li> 41 <ul> 42 <li>assertEquals("Mary had a little lamb", "Mary had the little 43lamb") shows: expected:<Mary had [a] little lamb> but 44was:<Mary had [the] little lamb><br> 45Longer prefixes and suffixes are truncated to a fixed size (currently 4620):</li> 47 <li>expected:<...st of the emergency [broadcasting] 48system> but was:<...st of the emergency [locating] system><br> 49 </li> 50 </ul> 51 <li><font color="#000000">Running single tests. 52junit.ui.TestRunner can be invoked with "-m</font> ClassName.testName" 53to run a single test.</li> 54 <li>TestSuite(Class[]). 55There is a new TestSuite constructor that takes an array of classes as 56a parameter and returns a suite of suites, each of which is constructed 57from a single class.</li> 58</ul> 59<h3><font><font color="#000000">Closed Bugs/Patches and Enhancment 60Requests<br> 61</font></font></h3> 62<ul> 63 <li><a 64 href="http://sourceforge.net/tracker/index.php?func=detail&aid=698067&group_id=15278&atid=115278">assertEquals(float,float,delta) 65fails on negative delta</a></li> 66 <li><a 67 href="http://sourceforge.net/tracker/index.php?func=detail&aid=609972&group_id=15278&atid=115278">'...' 68in ComparisonFailure</a></li> 69 <li><a 70 href="http://sourceforge.net/tracker/index.php?func=detail&aid=461535&group_id=15278&atid=115278">Trouble 71in teardown hides orig. probl.</a></li> 72 <li><a 73 href="http://sourceforge.net/tracker/index.php?func=detail&aid=609819&group_id=15278&atid=115278">NaN's 74in assertEquals</a></li> 75 <li><a 76 href="http://sourceforge.net/tracker/index.php?func=detail&aid=620039&group_id=15278&atid=115278">BaseTestRunner.setPreference 77static</a></li> 78 <li><a 79 href="http://sourceforge.net/tracker/index.php?func=detail&aid=658044&group_id=15278&atid=115278">failNotEquals() 80should be protected</a></li> 81 <li><a 82 href="http://sourceforge.net/tracker/index.php?func=detail&aid=777097&group_id=15278&atid=115278">RFE: 83make private methods protected</a></li> 84 <li><a 85 href="http://sourceforge.net/tracker/index.php?func=detail&aid=654507&group_id=15278&atid=365278">Printing 86version number</a></li> 87 <li><a 88 href="http://sourceforge.net/tracker/index.php?func=detail&aid=993150&group_id=15278&atid=315278">Patch 89to quell warnings in tiger</a></li> 90 <li><a 91 href="http://sourceforge.net/tracker/index.php?func=detail&aid=657593&group_id=15278&atid=315278">Enhanced 92ComparisonFailure output</a></li> 93 <li><a 94 href="http://sourceforge.net/tracker/index.php?func=detail&aid=625016&group_id=15278&atid=315278">addt'l 95TestSuite constructrs for Class[]</a></li> 96 <li><a 97 href="http://sourceforge.net/tracker/index.php?func=detail&aid=908467&group_id=15278&atid=315278">Run 98one test method for junit</a></li> 99 <li><a 100 href="http://sourceforge.net/tracker/index.php?func=detail&aid=756480&group_id=15278&atid=315278">excluded.properties: 101Add commons logging</a></li> 102</ul> 103<h2><font color="#000000">Summary of Changes between 3.8 and 3.8.1</font></h2> 104<ul> 105 <font color="#000000"> <li>Backed out setting the testing Thread's 106context class loader (see <a 107 href="https://sourceforge.net/tracker/index.php?func=detail&aid=598200&group_id=15278&atid=115278">JUnit 108not setting ClassLoader</a>). It has caused problems in tests that 109worked OK before. See the bug report for more details.</li> 110 <li>Fixes: 111 <ul> 112 <li><a 113 href="https://sourceforge.net/tracker/index.php?func=detail&aid=601326&group_id=15278&atid=115278">NPE 114in ComparisonFailure</a></li> 115 <li><a 116 href="https://sourceforge.net/tracker/index.php?func=detail&aid=602948&group_id=15278&atid=115278">Swing 117UI: NoSuchMethodError on JDK 1.3</a></li> 118 </ul> 119 </li> 120 </font> 121</ul> 122<h2> 123<font color="#000000">Summary of Changes between 3.7 and 3.8</font></h2> 124<h3> 125<font color="#000000">Framework</font></h3> 126<ul> 127 <li> 128 <font color="#000000">Made the string argument TestCase constructor 129optional. You can now delete 130constructors of the form "FooTestCase(String name) { super(name); }".</font></li> 131 <li> 132 <font color="#000000">Deleted deprecated assert(boolean) in favor 133of assertTrue(boolean) and 134assertFalse(boolean). To migrate to JUnit 3.8, rename calls to 135assert(boolean) 136to call assertTrue(boolean).</font></li> 137 <li> 138 <font color="#000000">Added assertFalse() to avoid the difficult of 139reading the assertTrue(! 140condition).</font></li> 141 <li> 142 <font color="#000000">Added assertNotSame(Object, Object).</font></li> 143 <li> 144 <font color="#000000">Deleted deprecated TestCase.name() in favor 145of TestCase.getName().</font></li> 146 <li> 147 <font color="#000000">Deleted deprecated package junit.ui in favor 148of junit.awtui.</font></li> 149</ul> 150<h3> 151<font color="#000000">Test Runner</font></h3> 152<ul> 153 <li> 154 <font color="#000000">When you compare two long strings with a 155small delta embedded in the middle, it 156is hard to spot the difference. In 3.8, when you call 157assertEquals(String, 158String), only the differences between the strings are displayed. The 159common 160prefix and suffix are replaced with "...".</font></li> 161 <li> 162 <font color="#000000">Added initial version of a TestRunListener 163attached to TestRunners which 164eventually will replace TestListeners attached to the TestResult.</font></li> 165 <li> 166 <font color="#000000">Filled in ActiveTestSuite constructors.</font></li> 167 <li> 168 <font color="#000000">Added these packages to the 169excluded.properties:<font size="2"> 170 <ul> 171 <li>org.w3c.dom.*</li> 172 <li>org.xml.sax.*</li> 173 <li>net.jini.*</li> 174 </ul> 175 </font></font></li> 176 <li><font color="#000000">Extracted textual formatting of a 177TestResult from junit.textui.TestRunner into ResultPrinter.</font></li> 178</ul> 179<h3><font color="#000000">Documentation</font></h3> 180<ul> 181 <font color="#000000"> <li>Much improved <a href="doc/faq/faq.htm">FAQ</a> 182thanks to Mike Clark.</li> 183 </font> 184</ul> 185<h3><font color="#000000">Closed Bugs</font></h3> 186<ul> 187 <font color="#000000"> <li><a 188 href="https://sourceforge.net/tracker/index.php?func=detail&aid=583346&group_id=15278&atid=115278">Class 189loader problem</a></li> 190 <li><a 191 href="https://sourceforge.net/tracker/index.php?func=detail&aid=551239&group_id=15278&atid=115278">Cookbook 192Simple Test Case problems</a></li> 193 <li><a 194 href="https://sourceforge.net/tracker/index.php?func=detail&aid=539015&group_id=15278&atid=115278">License 195not included in source</a></li> 196 <li><a 197 href="https://sourceforge.net/tracker/index.php?func=detail&aid=560081&group_id=15278&atid=115278">assert 198is a keyword</a></li> 199 <li><a 200 href="https://sourceforge.net/tracker/index.php?func=detail&aid=572444&group_id=15278&atid=115278">javadoc 201returns mysterious message</a></li> 202 <li><a 203 href="https://sourceforge.net/tracker/index.php?func=detail&aid=581251&group_id=15278&atid=115278">swingui 204CounterPanel values disappear</a></li> 205 <li><a 206 href="https://sourceforge.net/tracker/index.php?func=detail&aid=574641&group_id=15278&atid=115278">TestCase 207javadoc incorrect example</a></li> 208 <li><a 209 href="https://sourceforge.net/tracker/index.php?func=detail&aid=582784&group_id=15278&atid=115278">silly 210cookbook error</a></li> 211 <li><a 212 href="https://sourceforge.net/tracker/index.php?func=detail&aid=583328&group_id=15278&atid=115278">junit 213properties missfunction</a></li> 214 <li><a 215 href="https://sourceforge.net/tracker/index.php?func=detail&aid=595957&group_id=15278&atid=115278">Test.java 216is not Serializable</a></li> 217 <li><a 218 href="https://sourceforge.net/tracker/index.php?func=detail&aid=598200&group_id=15278&atid=115278">JUnit 219not setting ClassLoader`</a></li> 220 <li><a 221 href="https://sourceforge.net/tracker/index.php?func=detail&aid=592713&group_id=15278&atid=115278">NullPointerException 222when loading suite</a></li> 223 <li><a 224 href="https://sourceforge.net/tracker/index.php?func=detail&aid=544683&group_id=15278&atid=115278">labels 225for bug counts too small in Swing</a></li> 226 <li><a 227 href="https://sourceforge.net/tracker/index.php?func=detail&aid=537502&group_id=15278&atid=115278">Swing 228TestRunner layout shifts</a></li> 229 <li><a 230 href="https://sourceforge.net/tracker/index.php?func=detail&aid=528868&group_id=15278&atid=115278">Exit 231code problem for cygwin/w2k</a></li> 232 <li><a 233 href="https://sourceforge.net/tracker/index.php?func=detail&aid=529953&group_id=15278&atid=115278">Automatic 234reload causes strange errors</a></li> 235 <li><a 236 href="https://sourceforge.net/tracker/index.php?func=detail&aid=532952&group_id=15278&atid=115278">TestRunner 237fails with swing/awtui</a></li> 238 <li><a 239 href="https://sourceforge.net/tracker/index.php?func=detail&aid=533411&group_id=15278&atid=115278">CVS 240version doesn't build on NetBSD</a></li> 241 <li><a 242 href="https://sourceforge.net/tracker/index.php?func=detail&aid=520210&group_id=15278&atid=115278">NullPointerException 243JUnit sample w/ Ant</a></li> 244 <li><a 245 href="https://sourceforge.net/tracker/index.php?func=detail&aid=527511&group_id=15278&atid=115278">money 246sample bug</a></li> 247 <li><a 248 href="https://sourceforge.net/tracker/index.php?func=detail&aid=491981&group_id=15278&atid=115278">incomplete 249message from failNotSame()</a></li> 250 <li><a 251 href="https://sourceforge.net/tracker/index.php?func=detail&aid=471577&group_id=15278&atid=115278">Icons 252on systems with 64 colors exceptio</a></li> 253 <li><a 254 href="https://sourceforge.net/tracker/index.php?func=detail&aid=470324&group_id=15278&atid=115278">1000+ 255tests, swing gui doesn't display</a></li> 256 <li><a 257 href="https://sourceforge.net/tracker/index.php?func=detail&aid=442752&group_id=15278&atid=115278">test 258selector included incorrect classes</a></li> 259 <li><a 260 href="https://sourceforge.net/tracker/index.php?func=detail&aid=430974&group_id=15278&atid=115278">No 261UI update when re-run methods fail</a></li> 262 </font> 263</ul> 264<h2> 265<font color="#000000">Summary of Changes between 3.6 and 3.7</font></h2> 266<h3> 267<font color="#000000">GUI</font></h3> 268<ul> 269 <li> 270 <font color="#000000">Eliminated warning when re-running tests when 271class loading checkbox is 272unchecked. There are legitimate reasons for doing this, so a warning 273didn't 274make much sense, and it was too obtrusive.</font></li> 275 <li> 276 <font color="#000000">Stopped reloading classes when running in 277VisualAge for Java.</font></li> 278 <li> 279 <font color="#000000">Print total number of tests as well as number 280of tests run so far (Swing 281only).</font></li> 282</ul> 283<h3> 284<font color="#000000">Framework</font></h3> 285<ul> 286 <li> 287 <font color="#000000">Introduced Assert.assertTrue(boolean) and 288assertTrue(String, boolean) deprecated 289assert(boolean) and assert(String, boolean) in preparation for the 290assert 291keyword in Java 1.4. We plan to support native assertions when they are 292publicly available. You can either move to assertTrue() or wait for 1.4 293and delete parentheses as the syntax is e.g. "assert 2 == 3".</font></li> 294 <li> 295 <font color="#000000">Added accessors for TestCase.fName and 296TestSuite.fName.</font></li> 297 <li> 298 <font color="#000000">Added a no argument TestCase constructor to 299support serialization.</font></li> 300 <li> 301 <font color="#000000">Improved warnings when constructing 302TestSuites.</font></li> 303</ul> 304<h3> 305<font color="#000000">Text Runner</font></h3> 306<ul> 307 <li> 308 <font color="#000000">Made doRun() public so clients can create a 309text runner with a specified 310output stream and then run tests.</font></li> 311</ul> 312<h3> 313<font color="#000000">Fixed Bugs (SourceForge Bug Tracker Ids)</font></h3> 314<font color="#000000"> [420315] No trace when fail 315with message... 316<br> 317 [419375] reload warning lags 318<br> 319 [418849] Classloader warning too obtrusive 320<br> 321 [417978] constructor stack trace, please 322<br> 323 [415103] Reload checkbox should be ignored in VAJ 324<br> 325 [414954] error reporting when invoking suite() 326<br> 327 [407296] Make doRun() public 328<br> 329 [227578] rmi callbacks fail since TestCase has no 330noArg constructor 331<br> 332 [422603] Decorated decorators bug 333</font> 334<h2><font color="#000000">Summary of Changes between 3.5 and 3.6</font></h2> 335<h3> 336<font color="#000000">TestRunner</font></h3> 337<ul> 338 <li> 339 <font color="#000000">The UI test runners provide a check box to 340enable/disable the custom class 341loader. The user is warned when running a second test with the non 342loading 343class loader.</font></li> 344 <li> 345 <font color="#000000">Renames to address file name length 346limitation on MacOS:</font></li> 347 <ul> 348 <li> 349 <font color="#000000">LoadingClassPathTestCollector -> 350LoadingTestCollector</font></li> 351 <li> 352 <font color="#000000">SimpleClassPathTestCollector -> 353SimpleTestCollector</font></li> 354 </ul> 355</ul> 356<h3> 357<font color="#000000">Framework</font></h3> 358<ul> 359 <li> 360 <font color="#000000">Added TestSuite.getName()</font></li> 361</ul> 362<h3> 363<font color="#000000">Builds</font></h3> 364<ul> 365 <li> 366 <font color="#000000">Updated the build script for Ant 1.3.</font></li> 367</ul> 368<h3> 369<font color="#000000">Fixed Bugs (SourceForge Bug Tracker Ids)</font></h3> 370<blockquote><font color="#000000">[ #229753 ] assertEquals on NaN and 371Infinity does not work 372correctly 373 <br> 374[ #229287 ] Class Name too long "SimpleClassPathTestCollector" 375 <br> 376[ #229609 ] Stack Filtering missing in textui.TesRunner 377 <br> 378[ #229870 ] Clicking on ... after tests failed gives NPE 379 <br> 380[ #229974 ] Incorrect icon shown for first element in Swing GUI 381 <br> 382[ #230581 ] swingui.TestTreeModel: results of decorated testcases... 383 <br> 384[ #230971 ] Make junit.extensions.TestDecorator.getTest() public 385 <br> 386[ #231569 ] DocBug: JUnit Test Infected: Programmers Love Writing Tests 387 <br> 388[ #232645 ] BaseTestRunner.getTest loses exception information 389 <br> 390[ #233094 ] TestSuite masks exceptions 391 <br> 392[ #410967 ] No icon provided for first test 393 <br> 394[ #230745 ] ClassPathTestCollector sometimes lists classes in duplicate</font></blockquote> 395<h3> 396<font color="#000000">Documentation</font></h3> 397<ul> 398 <li> 399 <font color="#000000">Added documentation about the <a 400 href="doc/JUnitProperties.html">properties</a> 401supported by TestRunners.</font></li> 402 <li> 403 <font color="#000000">Updated the FAQ</font></li> 404</ul> 405<h2> 406<font color="#000000">Summary of Changes between 3.4 and 3.5</font></h2> 407<h3> 408<font color="#000000">Framework</font></h3> 409<ul> 410 <li> 411 <font color="#000000">Added TestSuite.addTestSuite(Class testClass)</font></li> 412 <font color="#000000"><br> 413This method allows to create a TestSuite with a class containing test 414cases directly. 415 <br> 416Instead of writing <b>suite.addTest(new TestSuite(AssertTest.class)) 417 </b>you 418can now write <b>suite.addTestSuite(AssertTest.class)</b>; 419 <li>Added assertEquals methods for all primitive types: float, 420boolean, byte, 421char, int, short</li> 422 <li> 423The signature of TestListeners.addFailure(Test test, Throwable t)</li> 424 <br> 425was changed to addFailure(Test test, AssertionFailedError t)</font> 426</ul> 427<h3> 428<font color="#000000">TestRunner</font></h3> 429<ul> 430 <li> 431 <font color="#000000">The Swing TestRunner provides an experimental 432feature to browse test classes. 433There is an additional browse ("...") button besides the suite combo. 434It 435shows a simple dialog to select a test class from a list. Different 436strategies 437to locate Test classes are supported and you can plug-in your own 438strategy. 439This allows to leverage functionality provided by an extension API of 440an 441integrated development environment (IDE). To define a custom test 442collector 443you 1) implement the <b>junit.runner.TestCollector </b>interface and 4442) 445add an entry to the <b>junit.properties</b> file with the key <b>TestCollectorClass</b> 446and the name of your TestCollector implementation class as the key:</font></li> 447 <font color="#000000"><br> 448 449TestCollectorClass=junit.swingui.LoadingClassPathTestCollector 450 <br> 451This class has to be installed on the class path. 452 <br> 453JUnit provides two different TestCollector implementations: 454 </font> 455 <ul> 456 <li> 457 <font color="#000000">simple 458(junit.runner.SimpleClassPathTestCollector) - considers all classes 459on the class path on the file system that contain "Test" in their name. 460Classes in JARs are not considered.</font></li> 461 <li> 462 <font color="#000000">loading 463(junit.runner.LoadingClassPathTestCollector) - loads all classes 464on the class path and tests whether the class is assignable from Test 465or 466has a static <b>suite</b> method.</font></li> 467 </ul> 468 <font color="#000000">By default the simple the test collector is 469used. The loading collector 470is more precise but much slower than the simple one. The loading 471collector 472doesn't scale up when many classes are available on the class path. 473 <br> 474 <b><font color="#ff0000">Notice</font></b>: that both TestCollectors 475assume that the class files reside are kept in the file system. This 476isn't 477case in VA/Java and they will not work there. A custom TestCollector is 478required for VA/Java. 479 <li>The Swing TestRunner now provides an additional test result view 480that shows 481all tests of the executed test suite as a tree. The view shows the 482success 483status for each test. The view is shown as an additional tab in the 484TestRunner 485window. In previous versions of JUnit this view was shown in a separate 486window.</li> 487 <li> 488The failure panels in the Swing and AWT TestRunners filter the 489exception 490stack trace so that only non-framework stack frames are shown.</li> 491 <li> 492There is support to plug-in a custom failure panel that provides 493additional 494functionality like navigating from a failure to the source. To do so 495you 496implement the <b>junit.runner.FailureDetailView</b> interface and 497register 498the implementation class in the junit.properties file under the key <b>FailureViewClass</b>, 499for example</li> 500 <br> 501 502FailureViewClass=MyFailureViewClassName. 503 <li>The Swing and AWT TestRunners now understand an additional 504command line 505argument "-noloading". When this argument is set then the standard 506system 507class loader is used to load classes. This is an alternative to setting 508the <b>loading</b> property to false in the junit.properties file.</li> 509 <li> 510Swing TestRunner - the maximum test history length shown in the suite 511combo 512can be defined in the junit.properties file with the key <b>maxhistory</b>.</li> 513 <li> 514BaseTestRunner.<b>getLoader</b>() is no longer a static method and can 515now be overridden in subclasses.</li> 516 <li> 517BaseTestRunner removed dependency on JDK 1.2.</li> 518 <li> 519Swing TestRunner - fixed the problem that a suite name was sometimes 520duplicated 521in the history combo.</li> 522 <li> 523Swing TestRunner - the Run button is now the default button.</li> 524 <li> 525Output string truncation can now be controlled by adding the <b>maxmessage</b> 526key with the desired maximum length to the junit.properties file. 527Setting 528maxmessage to -1 means no output truncation.</li> 529 <li> 530The Text TestRunner now shows the summary at the very end so that you 531don't 532have to scroll back.</li> 533 </font> 534</ul> 535<h3> 536<font color="#000000">Tests</font></h3> 537<ul> 538 <li> 539 <font color="#000000">TextRunnerTest now only depends on a nonzero 540status to indicate abnormal 541termination.</font></li> 542 <li> 543 <font color="#000000">TextRunnerTest now also passes on JDK 1.1.*. 544It uses the -classpath command 545line argument instead of -cp.</font></li> 546</ul> 547<h3> 548<font color="#000000">Documentation</font></h3> 549<ul> 550 <li> 551 <font color="#000000">Add an FAQ entry about what to do when the 552junit tests provided with the 553distribution can't be found.</font></li> 554</ul> 555<h2> 556<font color="#000000">Older Change Notes</font></h2> 557<blockquote> 558 <li><font color="#000000">Changes between <a 559 href="doc/changes34.html">2.1 and 3.4</a></font></li> 560 <li> 561 <font color="#000000">Changes between <a href="doc/changes21.html">1.0 562and 2.1</a></font></li> 563</blockquote> 564<h2> 565<font color="#000000"><a name="Contents"></a>Contents of the Release</font></h2> 566<table cellspacing="0" cellpadding="0"> 567 <tbody> 568 <tr> 569 <td><tt>README.html </tt></td> 570 <td>this file</td> 571 </tr> 572 <tr> 573 <td><tt>junit.jar</tt></td> 574 <td>a jar file with the JUnit framework and tools </td> 575 </tr> 576 <tr> 577 <td>src.jar</td> 578 <td>a jar file with the source code of the junit framework</td> 579 </tr> 580 <tr> 581 <td><tt>junit</tt></td> 582 <td>the source code of the JUnit samples</td> 583 </tr> 584 <tr> 585 <td><tt> samples</tt></td> 586 <td>sample test cases</td> 587 </tr> 588 <tr> 589 <td><tt> tests</tt></td> 590 <td>test cases for JUnit itself</td> 591 </tr> 592 <tr> 593 <td><tt>javadoc</tt></td> 594 <td>javadoc generated documentation</td> 595 </tr> 596 <tr> 597 <td><tt>doc</tt></td> 598 <td>documentation and articles</td> 599 </tr> 600 </tbody> 601</table> 602<h2> 603<font color="#000000"><a name="Installation"></a>Installation</font></h2> 604<font color="#000000">Below are the installation steps for installing 605JUnit: 606</font> 607<ol> 608 <li> 609 <font color="#000000">unzip the junit.zip file</font></li> 610 <li> 611 <font color="#000000">add<i> </i><b>junit.jar</b> to the 612CLASSPATH. For example: <tt>set 613classpath=%classpath%;INSTALL_DIR\junit3\junit.jar</tt></font></li> 614 <li> 615 <font color="#000000">test the installation by using either the 616batch or the graphical TestRunner 617tool to run the tests that come with this release. All the tests should 618pass OK.</font></li> 619 <font color="#000000"><br> 620 <b><font color="#ff0000">Notice</font></b>: that the tests are not 621contained in the junit.jar but in the installation directory directly. 622Therefore make sure that the installation directory is on the class 623path 624 </font> 625 <ul> 626 <li> 627 <font color="#000000">for the batch TestRunner type:</font></li> 628 <font color="#000000"><br> 629 <tt> java junit.textui.TestRunner 630junit.samples.AllTests</tt> 631 <li>for the graphical TestRunner type:</li> 632 <br> 633 <tt> java junit.awtui.TestRunner 634junit.samples.AllTests</tt> 635 <li>for the Swing based graphical TestRunner type:</li> 636 <br> 637 <tt> java junit.swingui.TestRunner 638junit.samples.AllTests</tt></font> 639 </ul> 640</ol> 641<font color="#000000"><b><font color="#ff0000">Important</font></b>: 642don't install the junit.jar 643into the extension directory of your JDK installation. If you do so the 644test class on the files system will not be found. 645</font> 646<h2><font color="#000000"><a name="Getting"></a>Getting Started</font></h2> 647<font color="#000000">To get started with unit testing and JUnit read 648the Java Report article: 649<a href="doc/testinfected/testing.htm">Test 650Infected - Programmers Love Writing Tests</a>. 651<br> 652This article demonstrates the development process with JUnit in the 653context of multiple currency arithmetic. The corresponding source code 654is in junit\samples\money. 655</font> 656<p><font color="#000000">You find additional samples in the 657junit.samples package: 658</font></p> 659<ul> 660 <li> 661 <font color="#000000">SimpleTest.java - some simple test cases</font></li> 662 <li> 663 <font color="#000000">VectorTest.java - test cases for 664java.util.Vector</font></li> 665</ul> 666<h2> 667<font color="#000000"><a name="Documentation"></a>Documentation</font></h2> 668<blockquote><font color="#000000"><a href="doc/cookbook/cookbook.htm">JUnit 669Cookbook</a> 670 <br> 671 A cookbook for implementing tests with JUnit. 672 <br> 673 <a href="doc/testinfected/testing.htm">Test Infected - Programmers 674Love Writing Tests</a> 675 <br> 676 An article demonstrating the development process 677with JUnit. 678 <br> 679 <a href="doc/cookstour/cookstour.htm">JUnit - A cooks tour</a> 680 <br> 681 <a href="javadoc/index.html">Javadoc</a> 682 <br> 683 API documentation generated with javadoc. 684 <br> 685 <a href="doc/faq/faq.htm">Frequently asked questions</a> 686 <br> 687 Some frequently asked questions about using JUnit. 688 <br> 689 <a href="doc/JUnitProperties.html">TestRunner Preference settings</a> 690 <br> 691 Describes the preferences settings that can be 692configured 693for the JUnit TestRunners.<br> 694 <a href="cpl-v10.html">License</a> 695 <br> 696 The terms of the common public license used for 697JUnit.</font></blockquote> 698<h2> 699<font color="#000000"><a name="Extending"></a>Extending JUnit</font></h2> 700<font color="#000000">Examples of possible JUnit extensions can be 701found in the <tt>junit.extensions</tt> 702package: 703</font> 704<ul> 705 <li> 706 <font color="#000000"><a 707 href="javadoc/junit/extensions/TestDecorator.html">TestDecorator</a> 708- A decorator for Test. You can use it as the base class for 709implementing 710decorators to extend test cases.</font></li> 711 <li> 712 <font color="#000000"><a 713 href="javadoc/junit/extensions/ActiveTestSuite.html">ActiveTestSuite</a> 714- A TestSuite which runs each test in a separate thread and waits until 715they are all terminated.</font></li> 716 <li> 717 <font color="#000000"><a 718 href="javadoc/junit/extensions/TestSetup.html">TestSetup</a> - A 719Decorator 720to set up and tear down additional fixture state. Subclass TestSetup 721and 722insert it into your tests when you want to set up additional state once 723before the tests are run.</font></li> 724 <li> 725 <font color="#000000"><a 726 href="javadoc/junit/extensions/ExceptionTestCase.html">ExceptionTestCase</a> 727- A TestCase that expects a particular Exception to be thrown.</font></li> 728</ul> 729<hr width="100%"> 730<!--webbot bot="HTMLMarkup" startspan --><font color="#000000"><a 731 href="http://sourceforge.net"><img 732 src="http://sourceforge.net/sflogo.php?group_id=15278" width="88" 733 height="31" border="0" alt="SourceForge Logo"></a><!--webbot 734bot="HTMLMarkup" endspan --></font> 735</body> 736</html> 737