| Joe Walnes |
|
|||||||||||||||||
|
|
|
|
||||||||||||||||
|
Making JUnit friendlier to AgileDoxHere's a little trick to make JUnit display your test results in a similar way to AgileDox. Override
... and your test runner results are transformed from this ...
... to this ...
To make this easier, stick it in an abstract TestCase and inherit from that instead. CommentsSam NewmanIts nice to have easily generated descriptions, but isn't working with such long method names sometimes a pain? And couldn't you achive something similar using JavaDoc and your own doclet? I suspect it would be more work than TestDox though (which I'm guessing just uses some class introspection and a bit of string parsing). Robert WatkinsWhy would such long method names be a pain for test cases? It's not like you ever call the test methods by hand, after all? In any case, with a modern IDE and auto-completion, long names only become a problem because of how long they make your lines of code. :) Nat PryceThe next step would be to change the toString method of the suite itself to return "A RowFilterApplier..." instead of "RowFilterApplierTest". Ian BourkeOr just use the TestDox IntelliJ plugin, and get all of this for free with no work. http://www.sourceforge.net/projects/agiledox Joe WalnesSam, By naming tests in this way, you can autogenerate a description of the responsibilities (or the contract) of the class under test. This complements the API to provide a clear description of what the class does. Of course, this can also be achieved by writing JavaDoc, except it has the added advantage that it is live and testable. > isn't working with such long method names sometimes a pain? Not really. They're test method names so they are only ever written once. I never have to remember them as JUnit figures them out automatically using reflection. > And couldn't you achive something similar using JavaDoc and your own doclet? Yes. This is how TestDox works (kind of). It uses QDox which is an awesome ;) alternative to JavaDoc for reading source code. This snippet is meant to complement TestDox. TestDox is used to explore code. This just makes test names easier to read from the JUnit test runner. Sam Newman> This snippet is meant to complement TestDox. Hmmm....I can certainly understand that. And thanks for the QDox pointer. Rob DawsonFor the poor people out there on a pre 1.4 jdk (and ORO in their classpath)... public String getName() { Ross MasonOn the subject of AgileDox, you could use FatCow to document your web-testcases. Right now we generate a nice report, but it's not really documentation. It would be very easy to generate other reports from the test results. NickSadly, this little hack breaks IntelliJ Aurora. It seems as though it uses the displayed name to synch with the source. If you apply this cool hack, IntelliJ no longer seems to scroll to source when you click on a given test method... :'( Use the testdox plugin instead (though its scroll-to-source seems to be broken in the latest builds of Aurora...) -Nick Deryl SealeHow do you use TestDox in IntelliJ? I installed the plugin, but when I select a test class and activate the TestDox window, it just says "No TestDox Available". Is there something else I need to install? thanks. Mike CorumI couldn't get it to work either. I tried in both IntelliJ 3 and 4. I also tried with WebStart and just saying java -jar etc.. I can find no way in which this tool will work at all. I've also downloaded qdox and put the library everywhere I can think of to try to make it work. Any help would be much appreciated. Mike Franck RasoloMike, Try the patched TestDox JAR that I posted on the IntelliJ Plugins forum: Hope it works for you! Franck penis enlargementHy, HAPPY NEW YEAR!! |
|
||||||||||||||||
|
[RSS | RDF] © 2001-2004, Joe Walnes |
Powered by SiteMesh and Moveable Type. | |||||||||||||||||