Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2007

Tip: Looking for answers? Try searching our database.

[JUnit] Generate an HTML report of tests

Thread view: 
sylsau - 12 Dec 2007 13:56 GMT
Hello,

I use JUnit 4 in an Eclipse project which is built with an Ant script.
I included the junit-report Ant task in my script to generate an HTML
report of the tests executed with JUnit.

I followed the JUnit faq on the official site to configure the junit-
report task. It runs well since I obtain an HTML report like I wanted.
However, the problem is that in my report there is no name for the
tests displayed.

I haven't found the way to named my tests in the JUnit 4
documentation. This is an example of my JUnit tests :

public class UtilsTest {

    // Adapter for execute Junit Test v4 in Junit Test v3
    public static junit.framework.Test suite() {
           return new
junit.framework.JUnit4TestAdapter(testUtils.class);
       }

    @Test public void testGetName1(){
        String filePath = "path...";
        String result = "test1";
        Assert.assertTrue("Test Utils.getName 1",
result.equals(Utils.getName(filePath)));
    }

    @Test public void testGetName2(){
        String filePath = "path2...";
        String result = "test2";
        Assert.assertTrue("Test Utils.getName 2",
result.equals(Utils.getName(filePath)));
    }

    ...etc ...

}

So, someone would know how I can name my tests to generate an HTML
report with tests name ?
Or, how can I use JUnit 3 to get the same result ?

Thanks to help me.
sylsau - 12 Dec 2007 21:06 GMT
No one can help me ?

sylsau a écrit :
> Hello,
>
[quoted text clipped - 41 lines]
>
> Thanks to help me.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.