Re: JSwat and JUnit
Nathan Fiedler <[email protected]> Wed, 18 Feb 2004 11:24:07 -0800
| Newsgroups | gmane.comp.java.jswat.user |
|---|---|
| Organization | Blue Marsh Softworks |
| Message-ID | <1077132247.1007.15.camel@chip> |
I hadn't actually thought about this until you asked, but it turns out to be easier than I imagined. 1. Start JSwat 2. Set classpath to include junit/junit.jar and your test classes. 3. Set sourcepath to include junit/src.jar and your test source. 4. Select "Start VM" from the "VM" menu and enter the appropriate junit test runner (e.g. junit.swingui.TestRunner). 5. Once JUnit appears, enter the name of your test case. At this point you can: A. Run the tests once so the classes load. Then use JSwat's "Classes" panel to browse the class tree to find your test class. Double-click on the method you want to set a breakpoint in. The source should appear in the JSwat source view area. Click on the line number you want to stop at -- a breakpoint indicator (green highlight) should appear at that line number. Now run the tests again -- it should stop at the breakpoint. B. Use "Open File" from the "File" menu and browse to the source file. Open that file and the source will appear in the view area. Set the breakpoint at the desired line by clicking on that line number. Then run your tests and the breakpoint should be hit. C. Type "stop name.of.class:line#" (e.g. "stop com.bluemarsh.jswat.util.SkipListTest:50") in the "Command" field of JSwat, then run your tests. The breakpoint should be hit and the source view will be opened to that line. That should do it. If you haven't already, take a look at the tutorial, which can be found in the JSwat help. n On Wed, 2004-02-18 at 03:22, Joyce Stack wrote: > Hello, > > I am a new user to JSwat and I would like to know how can I use JUnit to > kick of my unit tests and be able to debug at the same time.?? > > Any screen shots etc would be great. > > Thanking you in advance, > > Joyce Stack.