I used the supplied tutorial:
http://maven.apache.org/plugins/maven-surefire-plugin/examples/testng.html

I have the dependancy set as shown.

*here is My plugin:*
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <systemProperties>
                        <property>
                            <name>net.sourceforge.cobertura.datafile</name>

<value>${basedir}/target/cobertura/cobertura.ser</value>
                        </property>
                    </systemProperties>
                    <parallel>true</parallel>
                    <threadCount>10</threadCount>

                    <suiteXmlFiles>

<suiteXmlFile>${basedir}/src/test/resources/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>

*Here is my testng.xml:*
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"; >

<suite name="common-jar" verbose="1">
    <test name="common-jar">
        <classes>
            <class name="com.baselogic.security.AESTest"/>
        </classes>
    </test>

    <test name="common-class">
        <packages>
            <package name="com.baselogic*"/>
        </packages>
    </test>
</suite>

When I run "mvn clean install" the tests run fine.
But when I run "mvn install" I get this error:

*[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] Surefire report directory:
C:\opt\baselogic\tools\common-jar\target\surefire-reports
org.apache.maven.surefire.booter.SurefireExecutionException:
org.testng.xml.Parser.parse()Lorg/testng/xml/XmlSuite;; nested exception is
java.lan
g.NoSuchMethodError: org.testng.xml.Parser.parse()Lorg/testng/xml/XmlSuite;
java.lang.NoSuchMethodError: org.testng.xml.Parser.parse
()Lorg/testng/xml/XmlSuite;
        at
org.apache.maven.surefire.testng.TestNGXmlTestSuite.locateTestSets(
TestNGXmlTestSuite.java:132)
        at org.apache.maven.surefire.Surefire.createSuiteFromDefinition(
Surefire.java:150)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:111)
        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:290)
        at org.apache.maven.surefire.booter.SurefireBooter.main(
SurefireBooter.java:818)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] There are test failures.
*


-- 
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---

Reply via email to