Different Error Messages for Different Versions of TestNg

15 views
Skip to first unread message

kartik krishnan

unread,
Feb 8, 2008, 6:30:36 PM2/8/08
to testng...@googlegroups.com
Hi,

I am using Maven 2 and surefire plugin to manage my TestNG dependencies and to run a unittest. Depending upon the version specified in the POM, I get different errors for the same unit test. If my testng version is 5.6 or 5.7 , this is the nested exception that I get

[b]java.lang.IllegalArgumentException: Unable to find method <configureAndRun(Map)> on TestNG class provided
at org.apache.maven.surefire.testng.TestNGExecutor.executeTestNG(TestNGExecutor.java:176)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:85)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:275)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:832)[/b]


For Testng version 5.5

[b]Caused by: java.lang.NumberFormatException: For input string: "true"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.<init>(Integer.java:620)
at org.testng.xml.TestNGContentHandler.xmlSuite(TestNGContentHandler.java:120)
at org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:374)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:798)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:878)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:1157)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:176)
at org.testng.xml.Parser.parseOneFile(Parser.java:261)
at org.testng.xml.Parser.parse(Parser.java:158)
[/b]

My Maven set up

[b]<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.7</version>
<classifier>jdk15</classifier>
<scope>test</scope>
</dependency>

<build>

<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<!-- TestNg plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4-collab-SNAPSHOT</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
[/b]

I have no idea what I am doing wrong. i would be grateful for any help that you can give.

Thanks,
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=219113&messageID=297947#297947

Mark Derricutt

unread,
Feb 8, 2008, 6:39:21 PM2/8/08
to testng...@googlegroups.com
Whats in your testng.xml file and what version of the surefire plugin are you using?

kartik krishnan

unread,
Feb 8, 2008, 7:56:33 PM2/8/08
to testng...@googlegroups.com
My testng is directly under Project Tree and is as follows.
[CODE]
<suite name="firstClass" verbose="true">
<!-- Parameter names -->
<parameter name="id" value="970334" />
<parameter name="invalidId" value = "123456"/>

<test name="repositoryTest" >
<classes>
<class name="com.jbe.testing.dao.FooDAOTest">
<methods>
<include name="testNoUserFetch"/>
<include name="testUserFetch"/>
<include name="testEmailAddress"/>
<include name="testFullName"/>
<include name="testFaxNumber"/>
</methods>
</class>
</classes>
</test>

</suite>
[/CODE]

Sure Fire plugin is 2.4


---------------------------------------------------------------------
Posted via Jive Forums

http://forums.opensymphony.com/thread.jspa?threadID=219113&messageID=297993#297993

kartik krishnan

unread,
Feb 9, 2008, 9:07:13 PM2/9/08
to testng...@googlegroups.com
I found what the problem what. I set to verbose to "true" instead of a range from 1 to 10. I should have checked the dtd.

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=219113&messageID=298923#298923

Reply all
Reply to author
Forward
0 new messages