hi,
is maven picking up your testng.xml configuration file?
where are your test located (in which dir?)

here's my pom.xml


<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>ExpenseControl</groupId>
  <artifactId>ejbs</artifactId>
  <packaging>jar</packaging>
  <version>1.0</version>
  <name>enterprise java beans</name>
  <parent>
     <groupId>ExpenseControl</groupId>
     <artifactId>project</artifactId>
     <version>1.0</version>
  </parent>
  <dependencies>
     <!-- JBoss Microcontainer dependencies (for tests)-->
     <dependency>
          <groupId>microcontainer</groupId>
          <artifactId>ehcache</artifactId>
          <version>alpha6</version>
          <scope>system</scope>
        <systemPath>${basedir}\microcontainer\optional-lib\ehcache-
alpha6.jar</systemPath>
     </dependency>
     <dependency>
           <groupId>microcontainer</groupId>
           <artifactId>hibernate-all</artifactId>
           <version>alpha6</version>
           <scope>system</scope>
        <systemPath>${basedir}\microcontainer\lib\hibernate-all-alpha6.jar
</systemPath>
     </dependency>
     <dependency>
        <groupId>microcontainer</groupId>
        <artifactId>jboss-ejb3-all</artifactId>
        <version>alpha6</version>
        <scope>system</scope>
        <systemPath>${basedir}\microcontainer\lib\jboss-ejb3-all-alpha6.jar
</systemPath>
     </dependency>
     <dependency>
          <groupId>microcontainer</groupId>
           <artifactId>thirdparty-all</artifactId>
           <version>alpha6</version>
           <scope>system</scope>
        <systemPath>${basedir}\microcontainer\lib\thirdparty-all-alpha6.jar
</systemPath>
     </dependency>
<!-- end of jboss microcontainer dependencies -->


     <dependency>
        <groupId>geronimo-spec</groupId>
        <artifactId>geronimo-spec-j2ee</artifactId>
    <scope>provided</scope>
     </dependency>
     <dependency>
        <groupId>myfaces</groupId>
        <artifactId>myfaces-all</artifactId>
        <version>1.1.1</version>
    <scope>provided</scope>
     </dependency>
     <dependency>
        <groupId>jboss-seam</groupId>
        <artifactId>jboss-seam-ui</artifactId>
    <version>1.0.0CR3</version>
    <scope>provided</scope>
     </dependency>

     <dependency>
        <groupId>jboss-seam</groupId>
        <artifactId>jboss-seam</artifactId>
    <version>1.0.0CR3</version>
     </dependency>

     <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>4.7</version>
        <scope>test</scope>
        <classifier>jdk15</classifier>
     </dependency>
     <dependency>
        <groupId>dbunit</groupId>
        <artifactId>dbunit</artifactId>
    <version>2.1</version>
    <scope>test</scope>
     </dependency>



  </dependencies>
  <build>
     <plugins>


        <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
              <encoding>iso-8859-1</encoding>
           </configuration>
        </plugin>




        <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
       <!--    <version>2.2-SNAPSHOT</version>-->
           <configuration>
             <suiteXmlFiles>
               <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
             </suiteXmlFiles>
           </configuration>
        </plugin>


       <plugin>
       <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
                <configuration>
                  <tasks>
                    <echo message="--------Properties Configured
----------"/>

                    <echo message="------- deploy.dir=${deploy.directory}
"/>
              <echo message="------- ear.name=${ear.name}"/>
              <echo message="-------
project.parent.version=${project.parent.version}"/>
              <echo message="------- project.version=${project.version}"/>

                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
        </plugin>
        <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-jar-plugin</artifactId>
           <configuration>
             <archive>
               <manifest>
                  <addClasspath>true</addClasspath>
               </manifest>
             </archive>
           </configuration>
       </plugin>
     </plugins>
  </build>
  <!--<reporting>
   <plugins>
     <plugin>
       <artifactId>maven-surefire-report-plugin</artifactId>
       <configuration>
         <forkMode>once</forkMode>
         <childDelegation>false</childDelegation>
       </configuration>
     </plugin>
   </plugins>
 </reporting>-->
 <!-- The following two sections should be unnecessary shortly.
       surefire-2.2 is due for release yesterday. -->
 <repositories>
   <repository>
     <id>apache.snapshots</id>
     <url>http://cvs.apache.org/maven-snapshot-repository</url>
     <snapshots>
       <enabled>true</enabled>
     </snapshots>
   </repository>
 </repositories>
 <pluginRepositories>
   <pluginRepository>
     <id>apache.snapshots</id>
     <url>http://cvs.apache.org/maven-snapshot-repository</url>
     <snapshots>
       <enabled>true</enabled>
     </snapshots>
   </pluginRepository>
 </pluginRepositories>


</project>

my tests are in  the src/test/java directory

my testng.xml is in src/test/resources

HTH
marco

Reply via email to