TestNG equivalent of @RunWith annotation?

4,367 views
Skip to first unread message

Karthik Krishnan

unread,
Dec 22, 2009, 7:14:13 PM12/22/09
to testng...@googlegroups.com
Hi,

Can any one tell me what is the TestNG equivalent of JUnit4's   @RunWith annotation.

Thanks,

Kartik

Cédric Beust ♔

unread,
Dec 22, 2009, 8:13:46 PM12/22/09
to testng...@googlegroups.com
Hi Karthik,

There is no such annotation because creating a runner with TestNG is trivial ("new TestNG()").  Do you have a specific JUnit4 runner in mind that you'd like to emulate with TestNG?

-- 
Cedric


--

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



--
Cédric


Mark Derricutt

unread,
Dec 22, 2009, 8:27:01 PM12/22/09
to testng...@googlegroups.com
I was thinking about this the other day, if I had an @Test that in
turn created its own TestNG() and ran things in a specific way, is
there currently anyway to merge the results of that TestNG() with the
parent one?

Mark

--
Pull me down under...

2009/12/23 Cédric Beust ♔ <cbe...@google.com>:

Cédric Beust ♔

unread,
Dec 22, 2009, 9:30:44 PM12/22/09
to testng...@googlegroups.com
Mmmh...  Can you give me an example of what you have in mind?

-- 
Cédric


--

Daniel Rudman

unread,
Dec 23, 2009, 2:01:21 AM12/23/09
to testng...@googlegroups.com
We actually have a very similar requirement, where we have tests which have to be run in-container. This is where something like @RunWith would come in handy I think. right now I use a factory, sort of as a hack, so it doesnt return any tests but instead deploys the tests to the container and invokes them. So in this case the new TestNG does happen, but within the container server. From the caller/client side, for example Eclipse or Maven, it is obviously not aware that any tests were run and so always reports zero tests. That sounds to me like what Mark is mentioning, merging test results from into the "parent".

I might be missing something, but I was not able to find a really proper way to accomplish the above.

Thanks

2009/12/22 Cédric Beust ♔ <cbe...@google.com>
Reply all
Reply to author
Forward
0 new messages