From: Bob J. <jac...@us...> - 2009-04-20 06:55:23
|
Update of /cvsroot/jmri/help/en/html/doc/Technical In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15405/help/en/html/doc/Technical Modified Files: JUnit.shtml Log Message: more on JFCUnit Index: JUnit.shtml =================================================================== RCS file: /cvsroot/jmri/help/en/html/doc/Technical/JUnit.shtml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JUnit.shtml 20 Apr 2009 06:39:47 -0000 1.7 --- JUnit.shtml 20 Apr 2009 06:55:20 -0000 1.8 *************** *** 267,271 **** <p> ! For more complicated testing, we're starting to use <a href="http://jfcunit.sourceforge.net/">JFCUnit</a>. --- 267,277 ---- <p> ! For many tests, you'll both make testing reliable and improve the structure ! of your code by separating the GUI (Swing) code from the JMRI logic and ! communications. This lets you check the logic code separately, but invoking ! those methods and checking the state them update. ! ! <p> ! For more complicated GUI testing, we're starting to use <a href="http://jfcunit.sourceforge.net/">JFCUnit</a>. *************** *** 274,277 **** --- 280,295 ---- <a href="http://jmri.cvs.sourceforge.net/viewvc/jmri/test/jmri/util/SwingTestCaseTest.java?view=markup">test/jmri/util/SwingTestCaseTest.java</a> file. + <p> + To use JFCUnit, you first inherit your class From + <code>SwingTestCase</code> instead of <code>TestCase</code>. + This is enough to get basic operation of Swing tests; the base class + pauses the test thread until Swing (actually, the AWT event mechanism) + has completed all processing after every Swing call in the test. + (For this reason, the tests will run much slower if you're e.g. moving the + mouse cursor around while they're running) + + <p> + For more complex GUI testing, you can invoke various aspects of the interface + and check internal state using test code. <h3>Issues</h3> |