Skip to main content



      Home
Home » Newcomers » Newcomers » Generating a JUnit test report
Generating a JUnit test report [message #150447] Mon, 01 May 2006 14:24 Go to next message
Eclipse UserFriend
How can JUnit test reports be generated? Essentially I would like to
output the results in the <i> JUnit View </i>; which tests passed/failed.
I would perfer not to have to create an Ant script to do it, but if there
is no other way I will. I have looked throughout the Eclipse Help
Contents, the Eclipse site, and searched the web. If you could give me a
pointer I would greatly appreciate it.
Re: Generating a JUnit test report [message #151511 is a reply to message #150447] Wed, 10 May 2006 16:27 Go to previous message
Eclipse UserFriend
Now that I have found a solution to this problem I will post it in hopes
that it might help others:
This approach is makes use of the eclipse2ant plug-in which is standard on
Eclipse release 3.1M6 and higher
(http://www.geocities.com/richard_hoefter/eclipse2ant/).

1) First generate an Ant build file for your project.
In the Export page select "Ant Buildfiles" it is under General. Then
select a project that contains your JUnit tests. The default JUnit output
directory is appropriately named "junit".

2) Next resolve dependencies by making sure that the junit.jar is added to
Ant's "Global Entries."
Window->Preferences->Ant->Runtime->Global Entries and Add External
JARs... Navigate to your "eclipse" directory (where eclipse is
installed). It is under "plugins" directory and presently the junit.jar
is in a directory named "org.junit_3.8.1". If this is missing then you
will see error messages since junit is an optional Ant task.

3) Run then right click on the Ant build file (by default build.xml) and
Run As->Ant Build... This will display a list of targets. All of the
launch configurations you have previously configured will have a
corresponding target in your Ant build file. Select the desired
target(s), and also select the "junitreport" target. Check the "Target
execution order" text area to make sure the junitreport is run last.

Whenever you run a test case it will generate results and will be placed
in the junit output directory. These results are formatted into an HTML
report by the junitreport target and stored in the junit output directory.
This is a quick and dirty explanation of the process, but hopefully it
helps get you off your feet.
Previous Topic:Where my Eclipse console hiding??
Next Topic:Help needed: How to host GEF editor inside any composite?
Goto Forum:
  


Current Time: Tue Jul 08 23:35:42 EDT 2025

Powered by FUDForum. Page generated in 0.07732 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top