Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test against java 16 #869

Merged
merged 3 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
java: 8
- title: "JDK 11"
java: 11
- title: "JDK 15"
java: 15
- title: "JDK 16"
java: "16-ea"
runs-on: ubuntu-latest
steps:
- name: 'Checkout from Git'
Expand Down
1 change: 0 additions & 1 deletion pitest-entry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>1.7.5</version>
<scope>test</scope>
</dependency>

Expand Down
20 changes: 19 additions & 1 deletion pitest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
<url>http://pitest.org</url>
<description>Mutation testing system for Java.</description>

<properties>
<surefire.argline/>
</properties>
<profiles>
<profile>
<id>jdk16</id>
<activation>
<jdk>16</jdk>
</activation>
<properties>
<!-- pitest does not use reflection, but some of the tests depend on xstream, which does. Jdk 16 fails with
errors due to the module system. jdk8 does not support the add-opens option, so it must be activated here by jdk-->
<surefire.argline>--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.ref=ALL-UNNAMED</surefire.argline>
</properties>
</profile>
</profiles>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -42,6 +59,8 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<testNGArtifactName>none:none</testNGArtifactName>
<!-- pitest does not use reflection, but some of the tests depend on xstream, which does -->
<argLine>${surefire.argline}</argLine>

<includes>
<include>org/**/Test*.java</include>
Expand Down Expand Up @@ -220,7 +239,6 @@
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>1.7.5</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ public class BlockLocationTest {

@Test
public void shouldObeyHashcodeEqualsContract() {
EqualsVerifier.forClass(BlockLocation.class).verify();
EqualsVerifier.forClass(BlockLocation.class)
.withOnlyTheseFields("block", "location")
.verify();
}

}
4 changes: 3 additions & 1 deletion pitest/src/test/java/org/pitest/coverage/TestInfoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public class TestInfoTest {

@Test
public void shouldObeyHashcodeEqualsContract() {
EqualsVerifier.forClass(TestInfo.class).verify();
EqualsVerifier.forClass(TestInfo.class)
.withOnlyTheseFields("name", "definingClass")
.verify();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ public class BlockTest {

@Test
public void shouldObeyHashcodeEqualsContract() {
EqualsVerifier.forClass(Block.class).verify();
EqualsVerifier.forClass(Block.class)
.withOnlyTheseFields("firstInstruction")
.withOnlyTheseFields("lastInstruction")
.verify();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public void shouldDefaultFilenameWhenNoneKnown() {

@Test
public void shouldObeyHashcodeEqualsContract() {
EqualsVerifier.forClass(MutationDetails.class).verify();
EqualsVerifier.forClass(MutationDetails.class)
.withOnlyTheseFields("id")
.verify();
}

}
4 changes: 3 additions & 1 deletion pitest/src/test/java/org/pitest/plugin/FeatureTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ public class FeatureTest {

@Test
public void shouldObeyHashcodeEqualsContract() {
EqualsVerifier.forClass(Feature.class).verify();
EqualsVerifier.forClass(Feature.class)
.withOnlyTheseFields("name")
.verify();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public void shouldStopExecutingWhenResultCollectorRequestsStop() {

@Test
public void shouldObeyHashcodeEqualsContract() {
EqualsVerifier.forClass(MultipleTestGroup.class).verify();
EqualsVerifier.forClass(MultipleTestGroup.class)
.withOnlyTheseFields("children")
.verify();
}

}
13 changes: 12 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@
</profile>
</profiles>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>3.5.4</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

<!-- common dependencies used in all subprojects -->
<dependencies>
<dependency>
Expand All @@ -154,7 +165,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.9.0</version>
<version>3.19.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down