Specifing a testng listener and a testng.xml suite file causes a stack trace
----------------------------------------------------------------------------

                 Key: SUREFIRE-441
                 URL: http://jira.codehaus.org/browse/SUREFIRE-441
             Project: Maven Surefire
          Issue Type: Bug
          Components: TestNG support
            Reporter: Mike Beaubien


When you specifiy a listener to the surefire plugin it works. However, if you 
also specify a testng.xml file then the following stack trace occurs:

org.apache.maven.surefire.booter.SurefireExecutionException: java.lang.String; 
nested exception is java.lang.ClassCastException: java.lang.String
java.lang.ClassCastException: java.lang.String
        at org.testng.TestNG.configure(TestNG.java:1100)
        at 
org.apache.maven.surefire.testng.conf.TestNGMapConfigurator.configure(TestNGMapConfigurator.java:69)
        at 
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:73)
        at 
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        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:334)
        at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)

I looked at the source code and the problem seems to be with the TestNGExecuter 
class. There are 2 run functions, one for when the user provides suit xml files 
and one for when the user doesn't. The one that works removes the listener from 
the options before calling the configurator, the one that is broke doesn't, and 
that's what causes the stack trace.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to