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

fix(compat): Fix compilation issues with Pitest 1.13.2 #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
96 changes: 62 additions & 34 deletions pitmp-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,32 @@
<description>Maven plugin to handle multi-module project for Pitest</description>
<url>http://maven.apache.org</url>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- libs -->
<maven-plugin-dev.version>3.2.5</maven-plugin-dev.version>
<maven-plugin-api.version>${maven-plugin-dev.version}</maven-plugin-api.version>
<maven-project.version>${maven-plugin-dev.version}</maven-project.version>
<maven-artifact.version>${maven-plugin-dev.version}</maven-artifact.version>
<maven-plugin-annotations.version>3.9.0</maven-plugin-annotations.version>
<junit.version>5.9.3</junit.version>
<mockito.version>2.10.0</mockito.version>
<hamcrest.version>2.0.0.0</hamcrest.version>

<!-- plugins -->
<maven-plugin-plugin.version>3.9.0</maven-plugin-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
<maven-deploy-plugin.version>2.8.1</maven-deploy-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<maven-javadoc-plugin.version>3.0.0-M1</maven-javadoc-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<wagon-ssh.version>2.12</wagon-ssh.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
</properties>

<dependencies>
Expand All @@ -35,67 +60,62 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.2.1</version>
<version>${maven-plugin-api.version}</version>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>2.2.1</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.maven</groupId>-->
<!-- <artifactId>maven-project</artifactId>-->
<!-- <version>${maven-project.version}</version>-->
<!-- </dependency>-->

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.2.1</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.maven</groupId>-->
<!-- <artifactId>maven-artifact</artifactId>-->
<!-- <version>${maven-artifact.version}</version>-->
<!-- </dependency>-->

<!-- dependencies to annotations -->
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.4</version>
<version>${maven-plugin-annotations.version}</version>
<scope>provided</scope>
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-engine</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.2.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.2.0</version>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.2.0</version>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.10.0</version>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>java-hamcrest</artifactId>
<version>2.0.0.0</version>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>

Expand All @@ -111,22 +131,30 @@

</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.5</version>
<version>${maven-plugin-plugin.version}</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<version>${maven-compiler-plugin.version}</version>
</plugin>

<plugin>
Expand All @@ -151,7 +179,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifest>
Expand All @@ -166,7 +194,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.6.201602180812</version>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
Expand All @@ -180,7 +208,7 @@
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.3.0</version>
<version>${coveralls-maven-plugin.version}</version>
</plugin>

</plugins>
Expand All @@ -207,27 +235,27 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
<version>${maven-deploy-plugin.version}</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<version>${maven-release-plugin.version}</version>
<!-- <configuration> <tagNameFormat>descartes-@{version}</tagNameFormat>
</configuration> -->
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0-M1</version>
<version>${maven-javadoc-plugin.version}</version>
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -238,15 +266,15 @@
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.12</version>
<version>${wagon-ssh.version}</version>
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package eu.stamp_project;

import java.io.File;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -73,17 +74,17 @@ public static void addNewStrings(List<String> targetList,
}

// **********************************************************************
public static ArrayList<File> stringsToFiles(ArrayList<String> nameList)
public static ArrayList<Path> stringsToFiles(ArrayList<String> nameList)
{
ArrayList<File> fileList = new ArrayList<File>();
ArrayList<Path> fileList = new ArrayList<Path>();
File newFile;

for (int i = 0; i < nameList.size(); i++)
{
newFile = new File(nameList.get(i));
if (newFile.exists())
{
fileList.add(newFile);
fileList.add(newFile.toPath());
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package eu.stamp_project.plugins;

import java.io.File;
import java.nio.file.Path;
import java.util.*;
// **********************************************************************

Expand Down Expand Up @@ -216,7 +217,7 @@ private boolean isDefaultNotConfiguredReportOutput() {
public void modifyReportOptions()
{
// require(getPitOptions() != null)
ArrayList<File> fileList = null;
ArrayList<Path> fileList = null;
ArrayList<String> sourceDirList = null;
ArrayList<String> codePaths = null;
ArrayList<String> dependsCodePaths = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package eu.stamp_project.report;

import eu.stamp_project.descartes.reporting.models.MethodRecord;
import org.pitest.mutationtest.ClassMutationResults;
import org.pitest.mutationtest.ListenerArguments;
import org.pitest.mutationtest.MutationResultListener;

import eu.stamp_project.mutationtest.descartes.reporting.models.MethodRecord;

public class PseudoPartialyTestingListener implements MutationResultListener {
private Integer tested = 0;
private Integer notCovered = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package org.pitest.maven;

import java.util.ArrayList;
import java.util.Collection;

import eu.stamp_project.PmpContext;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.pitest.mutationtest.config.ReportOptions;

import eu.stamp_project.PmpContext;

// **********************************************************************
@Mojo(name = "descartes", defaultPhase = LifecyclePhase.VERIFY, requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ public boolean isContinueFromModuleSatisfied(MavenProject module)
public PmpMojo()
{
super(new RunPitStrategy(),
new DependencyFilter(new PluginServices(AbstractPitMojo.class.getClassLoader())),
new PluginServices(AbstractPitMojo.class.getClassLoader()),
new DependencyFilter(PluginServices.makeForLoader(AbstractPitMojo.class.getClassLoader())),
PluginServices.makeForLoader(AbstractPitMojo.class.getClassLoader()),
new PmpNonEmptyProjectCheck());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private InterceptorParameters makeFor(String key, String... vals) {
final Map<String, List<String>> values = new HashMap<>();
values.put(key, Arrays.asList(vals));
final FeatureSetting fs = new FeatureSetting(null, null, values);
return new InterceptorParameters(fs, null, null);
return new InterceptorParameters(fs, null, null, null, null);
}

}
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
package eu.stamp_project.report;

import static org.pitest.mutationtest.DetectionStatus.KILLED;
import static org.pitest.mutationtest.DetectionStatus.SURVIVED;

import java.util.ArrayList;
import java.util.Collection;

import org.junit.Test;
import org.pitest.classinfo.ClassName;
import org.pitest.mutationtest.ClassMutationResults;
import org.pitest.mutationtest.DetectionStatus;
import org.pitest.mutationtest.MutationResult;
import org.pitest.mutationtest.MutationStatusTestPair;
import org.pitest.mutationtest.engine.Location;
import org.pitest.mutationtest.engine.MethodName;
import org.pitest.mutationtest.engine.MutationDetails;
import org.pitest.mutationtest.engine.MutationIdentifier;

import java.util.ArrayList;
import java.util.Collection;

import static org.pitest.mutationtest.DetectionStatus.KILLED;
import static org.pitest.mutationtest.DetectionStatus.SURVIVED;

public class PseudoPartialyTestingListenerTest {

private MutationResult mutation(String method, DetectionStatus status, String mutant) {
return new MutationResult(new MutationDetails(
new MutationIdentifier(
new Location(ClassName.fromString("AClass"), MethodName.fromString(method), "()I"), 1, mutant),
new Location(ClassName.fromString("AClass"), method, "()I"), 1, mutant),
"path/to/file", "Mutation description", 1, 0), new MutationStatusTestPair(1, status, null));
}

Expand Down
2 changes: 2 additions & 0 deletions pitmp-maven-verification/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<default.encoding>UTF-8</default.encoding>
<pitest-maven-version>1.4.2</pitest-maven-version>
<pitmp-maven-plugin-version>1.3.5-SNAPSHOT</pitmp-maven-plugin-version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<default.encoding>UTF-8</default.encoding>
<pitest-maven-version>1.4.2</pitest-maven-version>
<pitmp-maven-plugin-version>1.3.5-SNAPSHOT</pitmp-maven-plugin-version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<default.encoding>UTF-8</default.encoding>
<pitest-maven-version>1.4.2</pitest-maven-version>
<pitmp-maven-plugin-version>1.3.5-SNAPSHOT</pitmp-maven-plugin-version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
Expand Down
Loading