Skip to content

Commit

Permalink
ant and mvn should execute tests using different filters
Browse files Browse the repository at this point in the history
  • Loading branch information
aaschmid committed Apr 26, 2014
1 parent f27c6a6 commit 7fde835
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 22 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
bin/
build/
out/
target/
.classpath
.gradle
.idea
Expand Down
16 changes: 9 additions & 7 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,20 @@
<fileset refid="libs.fileset" />
</classpath>

<formatter type="xml" />
<formatter usefile="false" type="brief" />

<!-- Categories test -->
<batchtest todir="${test.reports.dir}">
<!-- single category -->
<batchtest>
<fileset dir="${build.classes.test.dir}">
<include name="**/Category*TestSuite.class" />
<include name="**/CategoryOneTestSuite.class" />
</fileset>
</batchtest>

<!-- Single method of Test class -->
<test todir="${test.reports.dir}"
name="com.tngtech.test.java.junit.dataprovider.DataProviderSimpleAcceptanceTest"
<!-- single test class -->
<test name="com.tngtech.test.java.junit.dataprovider.DataProviderSimpleAcceptanceTest" />

<!-- single test method -->
<test name="com.tngtech.test.java.junit.dataprovider.DataProviderSimpleAcceptanceTest"
methods="testIsStringLengthGreaterThanTwo" />

</junit>
Expand Down
46 changes: 32 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<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">
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>com.tngtech.java</groupId>
Expand All @@ -15,22 +15,40 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<profiles>
<profile>
<id>CategoryOne</id>
<properties>
<testcase.groups>com.tngtech.test.java.junit.dataprovider.category.CategoryOne</testcase.groups>
</properties>
</profile>
</profiles>

<build>
<directory>build/maven-target</directory>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<groups>${testcase.groups}</groups>
</configuration>
<version>2.17</version>
<executions>
<execution>
<id>default-test</id>
<configuration>
<skip>true</skip>
</configuration>
</execution>
<execution>
<id>single group</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<groups>com.tngtech.test.java.junit.dataprovider.category.CategoryOne</groups>
</configuration>
</execution>
<execution>
<id>single test class</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>com/tngtech/test/java/junit/dataprovider/DataProviderSimpleAcceptanceTest.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand All @@ -44,7 +62,7 @@

<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>provided</scope>
</dependency>
Expand Down

0 comments on commit 7fde835

Please sign in to comment.