-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#750 -DskipTests Flag should be honoured in a maven run without addit…
…ional configuration - restored old test and added new IT test to verify if if -DskipTests works correctly
- Loading branch information
1 parent
7b19bf0
commit 195909d
Showing
6 changed files
with
141 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
pitest-maven-verification/src/test/resources/pit-skipTests-active/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<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>com.example</groupId> | ||
<artifactId>junit-categories-check</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>skipTests-active</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.11</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.4</version> | ||
<configuration> | ||
<source>1.7</source> | ||
<target>1.7</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.18.1</version> | ||
<configuration> | ||
<excludes> | ||
<exclude>**/FailingTest.java</exclude> | ||
<exclude>**/BadTest.java</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.pitest</groupId> | ||
<artifactId>pitest-maven</artifactId> | ||
<version>${pit.version}</version> | ||
<configuration> | ||
<exportLineCoverage>true</exportLineCoverage> | ||
<outputFormats> | ||
<value>XML</value> | ||
</outputFormats> | ||
<features>+CLASSLIMIT(limit[1])</features> | ||
<timestampedReports>false</timestampedReports> | ||
<mutators> | ||
<mutator>NEGATE_CONDITIONALS</mutator> | ||
</mutators> | ||
<verbose>true</verbose> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
13 changes: 13 additions & 0 deletions
13
...rification/src/test/resources/pit-skipTests-active/src/main/java/com/example/Covered.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.example; | ||
|
||
public class Covered { | ||
|
||
public static int someCode(int i) { | ||
if ( i == 0 ) { | ||
return 1; | ||
} | ||
|
||
return 1; | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...ication/src/test/resources/pit-skipTests-active/src/main/java/com/example/NotCovered.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.example; | ||
|
||
public class NotCovered { | ||
|
||
public static int someCode(int i) { | ||
if ( i == 0 ) { | ||
return 1; | ||
} | ||
|
||
if ( i == 2 ) { | ||
return 42; | ||
} | ||
|
||
return i; | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...cation/src/test/resources/pit-skipTests-active/src/test/java/com/example/AnotherTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.example; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class AnotherTest { | ||
|
||
@Test | ||
public void aTest() { | ||
assertEquals(1, Covered.someCode(0)); | ||
} | ||
|
||
@Test | ||
public void anotherTest() { | ||
assertEquals(1, Covered.someCode(1)); | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
...rification/src/test/resources/pit-skipTests-active/src/test/java/com/example/BadTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class BadTest { | ||
|
||
@Test | ||
public void aTest() { | ||
assertEquals(1, 2); | ||
} | ||
|
||
} |