test reporters configuration

61 views
Skip to first unread message

Tomek Kaczanowski

unread,
Mar 3, 2011, 8:37:42 AM3/3/11
to testn...@googlegroups.com
Hello All,

I'm wondering how should test reporter be configured. I mean, if you
code, then things are easy, you could do something like (using setters
or constructor, whatever):

ITestReporter myReporter = new MyReporter();
myReporter.setX
myReporter.setY
testNg.setListener(myReporter);
testNg.run();

That is obvious. But what about if you use Maven surefire, or Ant
task, or Gradle? Then you end up passing name of a class (i.e.
MyReporter.class) and not an object, which means you can't configure
it (can you?).

The question is, how can you configure your report in such case?
Should you look for some myreport.properties file on classpath and
read your configuration from there? What would you recommmend?

--
Regards / Pozdrawiam
Tomek Kaczanowski

Cédric Beust ♔

unread,
Mar 3, 2011, 10:01:39 AM3/3/11
to testn...@googlegroups.com, Tomek Kaczanowski
Hi Tomek,

You're right the current reporters can't be configured outside of doing so programmatically. And if I wanted a reporter that can be configured, I would probably go the way you suggest and have it look up a configuration file on the classpath or something like that. I would be open to considering extending the testng.xml format to support that as well, if need be.

Interestingly, the need has never arisen: most of the reporters that exist today (both TestNG's and third parties') are pretty much self contained.

-- 
Cédric



--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to testn...@googlegroups.com.
To unsubscribe from this group, send email to testng-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en.




--
Cédric


Reply all
Reply to author
Forward
0 new messages