Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JUnit report on Eclipse

The JUnit integration with eclipse is very nice. However, I would like a feature to be able to generate a quick report from the Unit Tests. It is possible to do so when running a headless build (and my nightly build is configured to do so), but sometimes I want to generate a report from the UI.

Is there anyway to do this? command line options maybe? an extra plugin? maybe the functionality is already there and I can't find it?

EDIT: I have a PDE build, as my project is an RCP application. Thus, running the tests from this build is not really straight-forward. I guess I could try to hack a smaller ANT script to do the test, but then probably I have to fight with the classpath to obtain what I want. I was hoping to find some extension to the already existing JUnit plugin that would provide the information on the tree view, but as an HTML document.

like image 213
Mario Ortegón Avatar asked Dec 17 '09 15:12

Mario Ortegón


2 Answers

You can use ant and generate HTML report [I think you can use Ant in Eclipse]
I found these link but you can survey more:

Ant JUnitReport Task
JUnit Tutorial
JUint Report

like image 145
Sajad Bahmani Avatar answered Sep 22 '22 19:09

Sajad Bahmani


I'm not sure if you want a "physical" report that you can distribution or just more information you can view in your IDE.

Either way I agree with SjB's advice on configuring Eclipse to run the ant script generating the report in your nightly build.

If it's not possible to run the nightly build locally, you can do some very simple build script hacking following the links in SjB's answer.

You also might want to check out the Ant JUnit Task Manual Page

like image 36
austen Avatar answered Sep 21 '22 19:09

austen