Last updated at 12:59 am UTC on 17 January 2006
This is the home page for BrowseUnit, which is a small project providing integration for SUnit and SLint in the various browsers, including the Star Browser and the Refactoring Browser.
BrowseUnit adds buttons to each of these browsers, allowing you to do the following :
- 'tests' button : teleports you automagically between a class and its test case class. Works in both senses, from class to test, and from test to class.
- '!' button : runs the test case of the class, displaying the results, and proposing you to debug the tests if they fail. Works the same way whether you are browsing the class or the test case.
- 'slint' button : Runs SLint on the current class, then displays the results
Some more buttons are added in the button pane (the button bar which contains buttons like 'browse', 'senders', 'implementors'...). Since this bar is not of infinite size, you may want to enable the preference abbreviatedBrowserButtons.
- 'test' button : teleports you to the test method corresponding to the current method, or do the reverse operation.
- 'run!' button : runs the test method corresponding to the method currently browsed. Works the same way as the '!' button, at a finer level.
You can download and fileIn the tests here
Now you can open a Browser on the Browser class (doIt):
And you can click on the '!' button to run the tests downloaded earlier.
Given that there isn't much to learn ...
I suggest you download and fileIn the tests, and open a browser on the Browser class. A class browser should open, with six buttons instead of three.
Clicking on the 'tests' button will transport you to the BrowserTest class, and clicking on it again will move you back to the Browser class.
Clicking on the '!' button will run all the tests on the Browser class : there are 13 of them, all of them should pass. The button should therefore get a nice green color, indicating success.
Clicking on the 'slint' button will either run SLint or tell you to install it (you don't have the Refactoring Browser ?). Running it will take a bit of time (a few seconds on my machine), and you should evaluate the quality of the code of the Browser class ...
If you have the button row in your browser (toggled by the preference optionalButtons), there are two more buttons to explain, at the left of the 'source' button:
The 'test' button : go to the method testCase in class Browser, category 'BrowseUnit-Main Stuff'. Click on it, and you will browse the method testTestCase in the BrowserTest class. It works the other way round too.
The 'run!' button : will run the test testTestCase if you are browsing the testCase method or the testTestCase method.
Finally, you should be aware that these buttons offers you to create defaults tests and stub methods if they don't exist. For example, clicking on the 'tests' button on the class Foo, will ask you if you want to create the TestCase FooTest. Moreover, clicking on the second 'test' button (method test button) on the bar method on class Foo will offer you the choice of creating the testBar method in class FooTest.