You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Christopher Maki <ch...@mac.com> on 2006/11/14 16:11:53 UTC

Surefire and TestNG

Hi

I seem to be having a problem with TestNG 5.1 and the Surefire plugin (either 2.3-SNAPSHOT or 2.2).  When using Surefire 2.3-SNAPSHOT I get this error when I try to run my tests:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
org.apache.maven.surefire.booter.SurefireExecutionException: 
Cannot find class in classpath: org.maki.model.BankAccountFactory; nested exception is org.testng.TestNGException: 
Cannot find class in classpath: org.maki.model.BankAccountFactory
org.testng.TestNGException: 
Cannot find class in classpath: org.maki.model.BankAccountFactory
	at org.testng.xml.XmlClass.getSupportClass(XmlClass.java:45)
	at org.testng.internal.Utils.xmlClassesToClasses(Utils.java:82)
	at org.testng.TestRunner.initMethods(TestRunner.java:273)
	at org.testng.TestRunner.init(TestRunner.java:212)
	at org.testng.TestRunner.init(TestRunner.java:184)
	at org.testng.TestRunner.<init>(TestRunner.java:121)
	at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:376)
....

The problem stems from using a testng.xml file.  If I just run the tests without testng.xml all methods for all tests are executed, but if I try to customize the execution via testng.xml I get the above error.  I've attached a very small project to illustrate the problem I'm having. 

Any feedback is much appreciated. 

Thanks

Chris



Re: Surefire and TestNG

Posted by Andreas G Guther <An...@markettools.com>.
You might find some more information on the TestNG user list in the following
thread:

http://groups-beta.google.com/group/testng-users/browse_thread/thread/cbca5b2450ce281e


Chris Maki wrote:
> 
> Hi Wayne
> 
> Thanks for getting back to me.  I didn't think this was a bug.  I thought
> it had something to do with the way I was using Surefire and TestNG.  The
> Surefire plugin page indicates you can use a testng.xml file so I thought
> it should work.  I was hoping to find someone that uses TestNG with Maven
> 2 and find out how they got the testng.xml file to work with their
> project.  If this is a bug I have not problem opening a JIRA issue, but I
> wanted to find out what others experiences were before I did that :-)
> 
> Thanks again
> 
> Chris
> 
> On Tuesday, November 14, 2006, at 08:18AM, "Wayne Fay"
> <wa...@gmail.com> wrote:
>>Bugs should be posted in JIRA, not the Users list.
>>
>>Wayne
>>
>>On 11/14/06, Christopher Maki <ch...@mac.com> wrote:
>>> Hi
>>>
>>> I seem to be having a problem with TestNG 5.1 and the Surefire plugin
>>> (either 2.3-SNAPSHOT or 2.2).  When using Surefire 2.3-SNAPSHOT I get
>>> this
>>> error when I try to run my tests:
>>>
>>> -------------------------------------------------------
>>>  T E S T S
>>> -------------------------------------------------------
>>> org.apache.maven.surefire.booter.SurefireExecutionException:
>>> Cannot find class in classpath: org.maki.model.BankAccountFactory;
>>> nested
>>> exception is org.testng.TestNGException:
>>> Cannot find class in classpath: org.maki.model.BankAccountFactory
>>> org.testng.TestNGException:
>>> Cannot find class in classpath: org.maki.model.BankAccountFactory
>>> 	at org.testng.xml.XmlClass.getSupportClass(XmlClass.java:45)
>>> 	at org.testng.internal.Utils.xmlClassesToClasses(Utils.java:82)
>>> 	at org.testng.TestRunner.initMethods(TestRunner.java:273)
>>> 	at org.testng.TestRunner.init(TestRunner.java:212)
>>> 	at org.testng.TestRunner.init(TestRunner.java:184)
>>> 	at org.testng.TestRunner.<init>(TestRunner.java:121)
>>> 	at
>>> org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:376)
>>> ....
>>>
>>> The problem stems from using a testng.xml file.  If I just run the tests
>>> without testng.xml all methods for all tests are executed, but if I try
>>> to
>>> customize the execution via testng.xml I get the above error.  I've
>>> attached
>>> a very small project to illustrate the problem I'm having.
>>>
>>> Any feedback is much appreciated.
>>>
>>> Thanks
>>>
>>> Chris
>>>
>>>
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Surefire-and-TestNG-tf2630007s177.html#a7619364
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Surefire and TestNG

Posted by Christopher Maki <ch...@mac.com>.
Hi Wayne

Thanks for getting back to me.  I didn't think this was a bug.  I thought it had something to do with the way I was using Surefire and TestNG.  The Surefire plugin page indicates you can use a testng.xml file so I thought it should work.  I was hoping to find someone that uses TestNG with Maven 2 and find out how they got the testng.xml file to work with their project.  If this is a bug I have not problem opening a JIRA issue, but I wanted to find out what others experiences were before I did that :-)

Thanks again

Chris

On Tuesday, November 14, 2006, at 08:18AM, "Wayne Fay" <wa...@gmail.com> wrote:
>Bugs should be posted in JIRA, not the Users list.
>
>Wayne
>
>On 11/14/06, Christopher Maki <ch...@mac.com> wrote:
>> Hi
>>
>> I seem to be having a problem with TestNG 5.1 and the Surefire plugin
>> (either 2.3-SNAPSHOT or 2.2).  When using Surefire 2.3-SNAPSHOT I get this
>> error when I try to run my tests:
>>
>> -------------------------------------------------------
>>  T E S T S
>> -------------------------------------------------------
>> org.apache.maven.surefire.booter.SurefireExecutionException:
>> Cannot find class in classpath: org.maki.model.BankAccountFactory; nested
>> exception is org.testng.TestNGException:
>> Cannot find class in classpath: org.maki.model.BankAccountFactory
>> org.testng.TestNGException:
>> Cannot find class in classpath: org.maki.model.BankAccountFactory
>> 	at org.testng.xml.XmlClass.getSupportClass(XmlClass.java:45)
>> 	at org.testng.internal.Utils.xmlClassesToClasses(Utils.java:82)
>> 	at org.testng.TestRunner.initMethods(TestRunner.java:273)
>> 	at org.testng.TestRunner.init(TestRunner.java:212)
>> 	at org.testng.TestRunner.init(TestRunner.java:184)
>> 	at org.testng.TestRunner.<init>(TestRunner.java:121)
>> 	at
>> org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:376)
>> ....
>>
>> The problem stems from using a testng.xml file.  If I just run the tests
>> without testng.xml all methods for all tests are executed, but if I try to
>> customize the execution via testng.xml I get the above error.  I've attached
>> a very small project to illustrate the problem I'm having.
>>
>> Any feedback is much appreciated.
>>
>> Thanks
>>
>> Chris
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Surefire and TestNG

Posted by Wayne Fay <wa...@gmail.com>.
Bugs should be posted in JIRA, not the Users list.

Wayne

On 11/14/06, Christopher Maki <ch...@mac.com> wrote:
> Hi
>
> I seem to be having a problem with TestNG 5.1 and the Surefire plugin
> (either 2.3-SNAPSHOT or 2.2).  When using Surefire 2.3-SNAPSHOT I get this
> error when I try to run my tests:
>
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> org.apache.maven.surefire.booter.SurefireExecutionException:
> Cannot find class in classpath: org.maki.model.BankAccountFactory; nested
> exception is org.testng.TestNGException:
> Cannot find class in classpath: org.maki.model.BankAccountFactory
> org.testng.TestNGException:
> Cannot find class in classpath: org.maki.model.BankAccountFactory
> 	at org.testng.xml.XmlClass.getSupportClass(XmlClass.java:45)
> 	at org.testng.internal.Utils.xmlClassesToClasses(Utils.java:82)
> 	at org.testng.TestRunner.initMethods(TestRunner.java:273)
> 	at org.testng.TestRunner.init(TestRunner.java:212)
> 	at org.testng.TestRunner.init(TestRunner.java:184)
> 	at org.testng.TestRunner.<init>(TestRunner.java:121)
> 	at
> org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:376)
> ....
>
> The problem stems from using a testng.xml file.  If I just run the tests
> without testng.xml all methods for all tests are executed, but if I try to
> customize the execution via testng.xml I get the above error.  I've attached
> a very small project to illustrate the problem I'm having.
>
> Any feedback is much appreciated.
>
> Thanks
>
> Chris
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Surefire and TestNG

Posted by Jason van Zyl <ja...@maven.org>.
On 14 Nov 06, at 10:11 AM 14 Nov 06, Christopher Maki wrote:

> Hi
>
> I seem to be having a problem with TestNG 5.1 and the Surefire  
> plugin (either 2.3-SNAPSHOT or 2.2).  When using Surefire 2.3- 
> SNAPSHOT I get this error when I try to run my tests:
>

Kenney is working another release of the surefire plugin and it  
should be ready early next week. TestNG support is something that  
he's working on.

Jason.

> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> org.apache.maven.surefire.booter.SurefireExecutionException:
> Cannot find class in classpath: org.maki.model.BankAccountFactory;  
> nested exception is org.testng.TestNGException:
> Cannot find class in classpath: org.maki.model.BankAccountFactory
> org.testng.TestNGException:
> Cannot find class in classpath: org.maki.model.BankAccountFactory
> 	at org.testng.xml.XmlClass.getSupportClass(XmlClass.java:45)
> 	at org.testng.internal.Utils.xmlClassesToClasses(Utils.java:82)
> 	at org.testng.TestRunner.initMethods(TestRunner.java:273)
> 	at org.testng.TestRunner.init(TestRunner.java:212)
> 	at org.testng.TestRunner.init(TestRunner.java:184)
> 	at org.testng.TestRunner.<init>(TestRunner.java:121)
> 	at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner 
> (SuiteRunner.java:376)
> ....
>
> The problem stems from using a testng.xml file.  If I just run the  
> tests without testng.xml all methods for all tests are executed,  
> but if I try to customize the execution via testng.xml I get the  
> above error.  I've attached a very small project to illustrate the  
> problem I'm having.
>
> Any feedback is much appreciated.
>
> Thanks
>
> Chris
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org