-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
quote all classpath entries to handle spaces
- Loading branch information
Showing
8 changed files
with
143 additions
and
7 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
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
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
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
47 changes: 47 additions & 0 deletions
47
pitest-maven-verification/src/test/resources/pit spaces in path/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,47 @@ | ||
<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>org.example</groupId> | ||
<artifactId>deterministic-coverage</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>deterministic-coverage</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>${junit.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.4</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.pitest</groupId> | ||
<artifactId>pitest-maven</artifactId> | ||
<version>${pit.version}</version> | ||
<configuration> | ||
<exportLineCoverage>true</exportLineCoverage> | ||
<features>+CLASSLIMIT(limit[1])</features> | ||
<timestampedReports>false</timestampedReports> | ||
<targetClasses><param>com.example*</param></targetClasses> | ||
<verbose>true</verbose> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
|
||
<properties> | ||
<junit.version>4.13.1</junit.version> | ||
</properties> | ||
|
||
</project> |
25 changes: 25 additions & 0 deletions
25
...test/resources/pit spaces in path/src/main/java/com/example/CoveredByMultipleThreads.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,25 @@ | ||
package com.example; | ||
|
||
public class CoveredByMultipleThreads { | ||
|
||
public int lotsOfLinesOfCode(int i) { | ||
if ( i == 0 ) { | ||
return 1; | ||
} | ||
|
||
if ( i == 2 ) { | ||
return 42; | ||
} | ||
|
||
for ( int j = 0; j != 100; j++ ) { | ||
try { | ||
Thread.sleep(1); | ||
} catch (InterruptedException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
return i; | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
...on/src/test/resources/pit spaces in path/src/test/java/com/example/MultiThreadedTest.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,45 @@ | ||
package com.example; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.junit.runners.Parameterized.Parameters; | ||
|
||
@RunWith(value = Parameterized.class) | ||
public class MultiThreadedTest { | ||
|
||
private final int i; | ||
|
||
@Parameters | ||
public static Collection<Object[]> data() { | ||
Object[][] data = new Object[][] { { 1 }, { 2 }, { 3 }, { 4 }, { 5 } ,{ 6 }, { 7 }, { 8 } }; | ||
return Arrays.asList(data); | ||
} | ||
|
||
public MultiThreadedTest(int i) { | ||
this.i = i; | ||
} | ||
|
||
@Test | ||
public void test() throws InterruptedException { | ||
Thread t = new Thread(aTest()); | ||
t.start(); | ||
t.join(); | ||
} | ||
|
||
|
||
|
||
private Runnable aTest() { | ||
return new Runnable() { | ||
public void run() { | ||
CoveredByMultipleThreads testee = new CoveredByMultipleThreads(); | ||
testee.lotsOfLinesOfCode(i); | ||
} | ||
|
||
}; | ||
}; | ||
|
||
} |
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