maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Gudian <andreas.gud...@gmail.com>
Subject Re: Unable to run a particular test group in testng
Date Fri, 12 Jul 2013 09:05:00 GMT
Am Freitag, 12. Juli 2013 schrieb vishwa :

> Hi Members,
> I am very new to this forum. I am trying to run a particular group of tests
> from testng.
> I have to groups of tests: *first* and *second*.
>
> *testng.xml:
> ----------*
> /<!DOCTYPE suite SYSTEM &quot;http://testng.org/testng-1.0.dtd&quot; >
> <suite name="Suite 1">
>   <test name="testNG test1">
>     <classes>
>        <class name="com.prac1.MyFirstTest"/>
>     </classes>
>         <groups>
>                 <run>
>                         <include name="first"/>
>                 </run>
>         </groups>
>   </test>
> </suite>
> /
> *pom.xml:
> --------*
> /<?xml version="1.0" encoding="UTF-8"?>
> <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/xsd/maven-4.0.0.xsd">
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>vnath</groupId>
>     <artifactId>Student</artifactId>
>     <version>2.0</version>
>         <properties>
>         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>     </properties>
>
>     <dependencies>
>         <dependency>
>             <groupId>org.testng</groupId>
>             <artifactId>testng</artifactId>
>             <version>6.8</version>
>
>         </dependency>
>     </dependencies>
>
>     <build>
>                 <testResources>
>             <testResource>
>                 <directory>src/test/resources</directory>
>             </testResource>
>                 </testResources>
>         <plugins>
>                         <plugin>
>                                 <groupId>org.apache.maven.plugin</groupId>
>
> <artifactId>maven-surefire-plugin</artifactId>
>                                 <version>2.5.1</version>
>                                 <configuration>
>
> <testSourceDirectory>src/test/java</testSourceDirectory>
>                                         <suiteXmlFiles>
>
> <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
>                                         </suiteXmlFiles>
>                                 </configuration>
>                         </plugin>
>
>                         <plugin>
>                                 <groupId>org.apache.maven.plugins</groupId>
>
> <artifactId>maven-compiler-plugin</artifactId>
>                                 <version>2.5.1</version>
>                                 <configuration>
>                                         <suiteXmlFiles>
>
> <suiteXmlFile>${basedir}/src/test/resources/testng.xml</suiteXmlFile>
>                                         </suiteXmlFiles>
>                                 </configuration>
>             </plugin>
>                 </plugins>
>     </build>
> </project>/
>
> *Project structure:
> ----------------*
>
>    Student
>           |
>           |---src
>           |     |---main
>           |     |      |----java
>           |     |      |       |--com
>           |     |      |             |--prac
>           |     |      |                   |--Student.java
>           |     |      |----resources
>           |     |
>           |     |
>           |     |---test
>           |             |---java
>           |             |       |---com
>           |             |               |---prac1
>           |             |                       |---MyFirstTest.java
>           |             |
>           |             |---resources
>           |                      |---testng.xml
>           |
>           |----pom.xml
>
>
>
> When I ran *mvn test* command, It executed all the test groups but I am
> expecting only "first" test group tests to be run.
>
> What is the problem in the above pom.xml or testng.xml?
>
> Please help me.
>
> Thanks in advance,
> Vishwanath
>

Hi,

Please try again with surefire version 2.15 (it is the latest release).

Andreas

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message