Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » JUnit TestNG Test(Both annotations in one class)
JUnit TestNG Test [message #545839] Fri, 09 July 2010 11:20 Go to next message
gomesr  is currently offline gomesr
Messages: 3
Registered: July 2010
Junior Member
Hi I have been trying to use SWTbot in headless mode, the problem is, my testcase is in testng which doesn't work, so what I did was use both annotations in one class so some tests will have @org.junit.Test and others will have @org.testng.annotations.Test and within eclipse this works just fine, running the class as a Junit runs only the junit tests and running as testng runs only the testng, but when I try to run this using an ant file the product starts up but ignores all tests and exits. If I remove the testng annotations then the test runs fine. Any ideas how I can get around this or if there is some known limitation in SWTBot in headless mode that does this?

Regards,
Rick Gomes
Re: JUnit TestNG Test [message #545909 is a reply to message #545839] Fri, 09 July 2010 14:58 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
TestNG is not supported by the headless runner[0].

Sorry that I do not any experience with TestNG. I think the problem in
this case is that the headless runner is unable to find the TestNG jars,
but I can't say for sure, unless you provide some console logs.

In order to ensure that the headless runner is able to find TestNG, you
may need to do the following:

* Create an OSGi bundle for the TestNG jar or get one from springsource[1]
* Create a TestNG fragment to add testng jars to ant's classpath, this
should be similar to the junit-ant fragment[2]

Try executing the tests once again to see where it goes.

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot

[0] - http://goo.gl/1NFe
[1] - http://goo.gl/kYf6
[2] - http://goo.gl/u0em


On 7/9/10 4:20 AM, gomesr wrote:
> Hi I have been trying to use SWTbot in headless mode, the problem is, my
> testcase is in testng which doesn't work, so what I did was use both
> annotations in one class so some tests will have @org.junit.Test and
> others will have @org.testng.annotations.Test and within eclipse this
> works just fine, running the class as a Junit runs only the junit tests
> and running as testng runs only the testng, but when I try to run this
> using an ant file the product starts up but ignores all tests and exits.
> If I remove the testng annotations then the test runs fine. Any ideas
> how I can get around this or if there is some known limitation in SWTBot
> in headless mode that does this?
>
> Regards,
> Rick Gomes
Re: JUnit TestNG Test [message #545913 is a reply to message #545909] Fri, 09 July 2010 15:18 Go to previous message
gomesr  is currently offline gomesr
Messages: 3
Registered: July 2010
Junior Member
Hi Ketan,

Thanks for the quick response, I'll try that but my problem is that my test is not in testng but in junit, but I happen to have some testng annotations in there, imagine a test class which has both annotations, I think that swtbot should pick up the junit tests I don't want it to pick up the testng ones. I can send you an example of what I'm doing if you like.


Regards,
Rick Gomes
Previous Topic:Got feedback about SWTBot ?
Next Topic:How do I create a CR?
Goto Forum:
  


Current Time: Wed Sep 17 13:42:35 GMT 2014

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

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