You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marco Mistroni <mm...@gmail.com> on 2006/09/20 19:56:44 UTC

problems with Maven2 and testNG test

hi all,
 i m trying to run my tests using maven2 and testNG
i followed instructions at   http://testng.org/doc/maven.html

here's my pom

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>ejbJ2ME</groupId>
    <artifactId>ejbJ2ME</artifactId>
    <packaging>ejb</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>ejbJ2ME</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>4.7</version>
            <scope>test</scope>
            <classifier>jdk15</classifier>
        </dependency>
        <dependency>
            <groupId>jboss</groupId>
            <artifactId>ejb3-persistence</artifactId>
            <version>rc9-fd</version>
        </dependency>
        <dependency>
            <groupId>jboss</groupId>
            <artifactId>ejb3-persistence</artifactId>
            <version>rc9-fd</version>
        </dependency>
        <dependency>
                    <groupId>j2meCore</groupId>
                    <artifactId>J2MECore</artifactId>
                    <version>1.0-SNAPSHOT</version>
               </dependency>


    </dependencies>
    <build>
        <testSourceDirectory>src/test</testSourceDirectory>
                <testResources>
                      <testResource>
                        <directory>src/test/resources</directory>
                            <includes>
                                  <include>*.*</include>
                            </includes>
                </testResource>
          </testResources>
        <pluginManagement>
            <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>
                    <version>2.8-SNAPSHOT</version>
                    <configuration>
                         <configuration>
                                  <groups>perftest</groups>
                            </configuration>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <pluginRepositories>
        <pluginRepository>
            <id>tapestry.javaforge</id>
            <url>http://howardlewisship.com/repository</url>
        </pluginRepository>
    </pluginRepositories>
</project>



i have 1 test class that belongs to 'ejb3' group, but it is getting executed
anyway......

could anyone help ?

thanks in advance and regards
 marco

Re: problems with Maven2 and testNG test

Posted by Eric Brown <yo...@gmail.com>.
Hi Marco,

On Sep 20, 2006, at 10:56 AM, Marco Mistroni wrote:

> hi all,
> i m trying to run my tests using maven2 and testNG
> i followed instructions at   http://testng.org/doc/maven.html

You need to have a testing.xml.

See http://www.nabble.com/product-codes-at-java-1.4%2C-test-sources- 
at-java-1.5-tf2213975.html#a6134698

This is what I have:
   <dependencies>
     <dependency>
       <groupId>org.testng</groupId>
       <artifactId>testng</artifactId>
       <version>5.1</version>
       <scope>test</scope>
       <classifier>jdk15</classifier>
     </dependency>
   </dependencies>

   <build>
     <plugins>
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <suiteXmlFiles>
             <suiteXmlFile>src/test/resources/testing.xml</suiteXmlFile>
           </suiteXmlFiles>
         </configuration>
       </plugin>
     </plugins>
   </build>

And in testing.xml:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="Suite1"    verbose="1" >
   <test name="Nopackage" >
     <classes>
        <class name="com.knotfast.Iso8601DateTest"  />
     </classes>
   </test>
</suite>

Cheers,
Eric



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