You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by NOFXer <no...@gmx.de> on 2008/01/18 13:46:26 UTC

how to change testnames in junitreport?

I have the following problem. I'm doing JUnit tests with only one Testclass
but with different parameters. So when I generate the JUnit reports all
Tests have of course the same name.
So I would have:

Classes
 ExampleTest
 ExampleTest
 ExampleTest

I attached a variable to the XML files so they won't get overwritten. If I
look at the properties of the testreports I could distinguish them, but I
want to see it at the first look.
So what I need is something like this in the navigation menu:

Classes
 ExampleTest_DE
 ExampleTest_US
 ExampleTest_UK

I know that I can pass parameters to xsl file and could change the displayed
names, but since I call my junitreport target after all Tests have been done
there is no way to get the previous parameters like the used
locale(DE,UK,US).

Is there a way to parse the generated xml filenames within the process of
html generation?
Or do you have another suggestion?

I really hope you understood my problem :)
-- 
View this message in context: http://www.nabble.com/how-to-change-testnames-in-junitreport--tp14949365p14949365.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: how to change testnames in junitreport?

Posted by Knuplesch, Jürgen <Ju...@icongmbh.de>.
The simplest way I can think of ist to write 3 Tests and one method, that does the work. This method gets the parameters from the test_DE test_US method etc. Junit has therefore three Tests with names that show what your Test is testing.


-- 
Jürgen Knuplesch                    www.icongmbh.de
icon Systemhaus GmbH                Tel. +49 711 806098-275
Sophienstraße 40                    
D-70178 Stuttgart                   Fax. +49 711 806098-299

Geschäftsführer: Uwe Seltmann
HRB Stuttgart 17655
USt-IdNr.: DE 811944121 
-----Ursprüngliche Nachricht-----
Von: NOFXer [mailto:nofxer@gmx.de] 
Gesendet: Freitag, 18. Januar 2008 13:46
An: user@ant.apache.org
Betreff: how to change testnames in junitreport?


I have the following problem. I'm doing JUnit tests with only one Testclass but with different parameters. So when I generate the JUnit reports all Tests have of course the same name.
So I would have:

Classes
 ExampleTest
 ExampleTest
 ExampleTest

I attached a variable to the XML files so they won't get overwritten. If I look at the properties of the testreports I could distinguish them, but I want to see it at the first look.
So what I need is something like this in the navigation menu:

Classes
 ExampleTest_DE
 ExampleTest_US
 ExampleTest_UK

I know that I can pass parameters to xsl file and could change the displayed names, but since I call my junitreport target after all Tests have been done there is no way to get the previous parameters like the used locale(DE,UK,US).

Is there a way to parse the generated xml filenames within the process of html generation?
Or do you have another suggestion?

I really hope you understood my problem :)
--
View this message in context: http://www.nabble.com/how-to-change-testnames-in-junitreport--tp14949365p14949365.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to change testnames in junitreport?

Posted by Steve Loughran <st...@apache.org>.
NOFXer wrote:
> I have the following problem. I'm doing JUnit tests with only one Testclass
> but with different parameters. So when I generate the JUnit reports all
> Tests have of course the same name.
> So I would have:
> 
> Classes
>  ExampleTest
>  ExampleTest
>  ExampleTest
> 
> I attached a variable to the XML files so they won't get overwritten. If I
> look at the properties of the testreports I could distinguish them, but I
> want to see it at the first look.
> So what I need is something like this in the navigation menu:
> 
> Classes
>  ExampleTest_DE
>  ExampleTest_US
>  ExampleTest_UK
> 
> I know that I can pass parameters to xsl file and could change the displayed
> names, but since I call my junitreport target after all Tests have been done
> there is no way to get the previous parameters like the used
> locale(DE,UK,US).
> 

Right now, there's nothing. I've been thinking of changing some aspects 
of the XML reporting (and resulting HTML), but we have to change stuff 
very carefully.

For now, save the separate test results to different directories - 
tests/de/data tests/uk/data and then generate separate sets of HTML 
reports for each one

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org