You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Lee Bieber <ka...@yahoo.com> on 2006/11/23 00:12:55 UTC

Using maven and testng

I'm trying to get testng working with maven. I've configured my pom.xml per the documentation
......
  <dependency>
                        <groupId>org.testng</groupId>
                        <artifactId>testng</artifactId>
                        <version>5.1</version>
                        <scope>test</scope>
                        <classifier>jdk15</classifier>
                </dependency>
</dependencies>
        <build>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                        <source>1.5</source>
                                        <target>1.5</target>
                                </configuration>
                        </plugin>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-surefire-plugin</artifactId>
                                <configuration>
                                    <suiteXmlFiles>
                                        <suiteXmlFile>src/test/java/com/trovix/dts/web/controller/web-controller-testng-functional.xml</suiteXmlFile>
                                    </suiteXmlFiles>
                                </configuration>
                        </plugin>
                </plugins>
........

but when I run "mvn test"  I get the following exception:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
org.apache.maven.surefire.booter.SurefireExecutionException: null; nested exception is java.lang.NullPointerException: null
java.lang.NullPointerException
        at org.apache.maven.surefire.report.AbstractTextReporter.testFailed(AbstractTextReporter.java:106)
        at org.apache.maven.surefire.report.ReporterManager.testFailed(ReporterManager.java:299)
        at org.apache.maven.surefire.report.ReporterManager.testFailed(ReporterManager.java:281)
        at org.apache.maven.surefire.testng.TestNGReporter.onTestFailure(TestNGReporter.java:97)
        at org.testng.internal.Invoker.runTestListeners(Invoker.java:1164)
        at org.testng.internal.Invoker.runTestListeners(Invoker.java:1149)
        at org.testng.internal.Invoker.handleConfigurationFailure(Invoker.java:191)
        at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:170)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:223)
        at org.testng.SuiteRunner.run(SuiteRunner.java:145)
        at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:901)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:863)
        at org.apache.maven.surefire.testng.TestNGExecutor.executeTestNG(TestNGExecutor.java:64)
        at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
        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:225)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE

Any ideas on what I am doing wrong??

Thanks


 
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com

Re: Using maven and testng - collab workaround

Posted by Erik Drolshammer <dr...@idi.ntnu.no>.
I reposted my question in a new thread. Search for subject "Testng with 
testng.xml config file".

-- 
Regards
Erik Drolshammer

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


Using maven and testng - collab workaround

Posted by Erik Drolshammer <dr...@idi.ntnu.no>.
Hi! 
I got maven to run with testng 5.5 by using
<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.4-collab-SNAPSHOT</version>
            </plugin>

and 

<dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>5.5</version>
            <scope>test</scope>
            <classifier>jdk15</classifier>
        </dependency>



However, I can't get the suiteXmlFile configuration option to work
properly. 

Can anyone point me to a testng.xml file that runs the same set of tests
as are run without any config? 

(I have searched the src for the surefire-plugin, but I couldn't find
the default testng.xml file.) 


Resources: 
http://maven.apache.org/plugins/maven-surefire-plugin/examples/testng.html
http://docs.codehaus.org/pages/viewpage.action?pageId=62120
http://maven.apache.org/plugins/maven-surefire-plugin/examples/testng.html

-- 
Regards
Erik Drolshammer 


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


Re: Using maven and testng

Posted by Wayne Fay <wa...@gmail.com>.
I've run into exactly the same problem... Did you ever get any
resolution to this, Lee?

Wayne

On 11/22/06, Lee Bieber <ka...@yahoo.com> wrote:
> I'm trying to get testng working with maven. I've configured my pom.xml per the documentation
> ......
>   <dependency>
>                         <groupId>org.testng</groupId>
>                         <artifactId>testng</artifactId>
>                         <version>5.1</version>
>                         <scope>test</scope>
>                         <classifier>jdk15</classifier>
>                 </dependency>
> </dependencies>
>         <build>
>                 <plugins>
>                         <plugin>
>                                 <groupId>org.apache.maven.plugins</groupId>
>                                 <artifactId>maven-compiler-plugin</artifactId>
>                                 <configuration>
>                                         <source>1.5</source>
>                                         <target>1.5</target>
>                                 </configuration>
>                         </plugin>
>                         <plugin>
>                                 <groupId>org.apache.maven.plugins</groupId>
>                                 <artifactId>maven-surefire-plugin</artifactId>
>                                 <configuration>
>                                     <suiteXmlFiles>
>                                         <suiteXmlFile>src/test/java/com/trovix/dts/web/controller/web-controller-testng-functional.xml</suiteXmlFile>
>                                     </suiteXmlFiles>
>                                 </configuration>
>                         </plugin>
>                 </plugins>
> ........
>
> but when I run "mvn test"  I get the following exception:
>
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> org.apache.maven.surefire.booter.SurefireExecutionException: null; nested exception is java.lang.NullPointerException: null
> java.lang.NullPointerException
>         at org.apache.maven.surefire.report.AbstractTextReporter.testFailed(AbstractTextReporter.java:106)
>         at org.apache.maven.surefire.report.ReporterManager.testFailed(ReporterManager.java:299)
>         at org.apache.maven.surefire.report.ReporterManager.testFailed(ReporterManager.java:281)
>         at org.apache.maven.surefire.testng.TestNGReporter.onTestFailure(TestNGReporter.java:97)
>         at org.testng.internal.Invoker.runTestListeners(Invoker.java:1164)
>         at org.testng.internal.Invoker.runTestListeners(Invoker.java:1149)
>         at org.testng.internal.Invoker.handleConfigurationFailure(Invoker.java:191)
>         at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:170)
>         at org.testng.SuiteRunner.privateRun(SuiteRunner.java:223)
>         at org.testng.SuiteRunner.run(SuiteRunner.java:145)
>         at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:901)
>         at org.testng.TestNG.runSuitesLocally(TestNG.java:863)
>         at org.apache.maven.surefire.testng.TestNGExecutor.executeTestNG(TestNGExecutor.java:64)
>         at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
>         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:225)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
>
> Any ideas on what I am doing wrong??
>
> Thanks
>
>
>
> ____________________________________________________________________________________
> Cheap talk?
> Check out Yahoo! Messenger's low PC-to-Phone call rates.
> http://voice.yahoo.com

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