{
return this;
}
- /**
- * Whether to run in dry run mode.
- *
- * Defaults to {@code false}
- *
- * @param isDryRun {@code true} or {@code false}
- * @return this operation instance
- */
- public PitestOperation dryRun(boolean isDryRun) {
- if (isDryRun) {
- options_.put("--dryRun", TRUE);
- } else {
- options_.put("--dryRun", FALSE);
- }
- return this;
- }
-
/**
* List of globs to match against class names. Matching classes will be excluded from mutation.
*
@@ -445,10 +415,9 @@ public class PitestOperation extends AbstractProcessOperation {
if (project_ != null) {
args.add(javaTool());
args.add("-cp");
- args.add(buildClassPath(joinClasspathJar(project_.testClasspathJars()),
- joinClasspathJar(project_.compileClasspathJars()),
- joinClasspathJar(project_.providedClasspathJars()),
- project_.buildMainDirectory().getAbsolutePath(), project_.buildTestDirectory().getAbsolutePath()));
+ args.add(String.format("%s:%s:%s:%s", new File(project_.libTestDirectory(), "*"),
+ new File(project_.libCompileDirectory(), "*"), project_.buildMainDirectory(),
+ project_.buildTestDirectory()));
args.add("org.pitest.mutationtest.commandline.MutationCoverageReport");
if (!options_.containsKey(SOURCE_DIRS)) {
@@ -463,10 +432,6 @@ public class PitestOperation extends AbstractProcessOperation {
});
}
- if (LOGGER.isLoggable(Level.FINE)) {
- LOGGER.fine(String.join(" ", args));
- }
-
return args;
}
@@ -700,14 +665,6 @@ public class PitestOperation extends AbstractProcessOperation {
return s != null && !s.isBlank();
}
- private String joinClasspathJar(List jars) {
- if (!jars.isEmpty()) {
- return String.join(File.pathSeparator, jars.stream().map(File::getAbsolutePath).toList());
- } else {
- return "";
- }
- }
-
/**
* Argument string to use when PIT launches child processes. This is most commonly used to increase the amount of
* memory available to the process, but may be used to pass any valid JVM argument.
diff --git a/src/test/java/rife/bld/extension/PitestOperationTest.java b/src/test/java/rife/bld/extension/PitestOperationTest.java
index bb5ed8c..82f446c 100644
--- a/src/test/java/rife/bld/extension/PitestOperationTest.java
+++ b/src/test/java/rife/bld/extension/PitestOperationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023-2025 the original author or authors.
+ * Copyright 2023-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,10 +16,7 @@
package rife.bld.extension;
-import org.assertj.core.api.AutoCloseableSoftAssertions;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.EnabledOnOs;
-import org.junit.jupiter.api.condition.OS;
import rife.bld.BaseProject;
import rife.bld.Project;
import rife.bld.WebProject;
@@ -40,9 +37,9 @@ import static rife.bld.extension.PitestOperation.TRUE;
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
class PitestOperationTest {
private static final String AS_LIST = "as list";
- private static final String BAR = "bar";
- private static final String FOO = "foo";
- private static final String FOOBAR = FOO + ',' + BAR;
+ private final static String BAR = "bar";
+ private final static String FOO = "foo";
+ private final static String FOOBAR = FOO + ',' + BAR;
@Test
void argLine() {
@@ -66,7 +63,6 @@ class PitestOperationTest {
}
@Test
- @EnabledOnOs(OS.LINUX)
void checkAllParameters() throws IOException {
var args = Files.readAllLines(Paths.get("src", "test", "resources", "pitest-args.txt"));
@@ -80,7 +76,6 @@ class PitestOperationTest {
.classPathFile(FOO)
.coverageThreshold(0)
.detectInlinedCode(false)
- .dryRun(false)
.excludedClasses("class")
.excludedClasses(List.of(FOO, BAR))
.excludedGroups("group")
@@ -126,17 +121,15 @@ class PitestOperationTest {
.verbosity("default")
.executeConstructProcessCommandList();
- try (var softly = new AutoCloseableSoftAssertions()) {
- for (var p : args) {
- var found = false;
- for (var a : params) {
- if (a.startsWith(p)) {
- found = true;
- break;
- }
+ for (var p : args) {
+ var found = false;
+ for (var a : params) {
+ if (a.startsWith(p)) {
+ found = true;
+ break;
}
- softly.assertThat(found).as(p + " not found.").isTrue();
}
+ assertThat(found).as(p + " not found.").isTrue();
}
}
diff --git a/src/test/resources/pitest-args.txt b/src/test/resources/pitest-args.txt
index df24bfb..348f16e 100644
--- a/src/test/resources/pitest-args.txt
+++ b/src/test/resources/pitest-args.txt
@@ -4,7 +4,6 @@
--classPathFile
--coverageThreshold
--detectInlinedCode
---dryRun
--excludedClasses
--excludedGroups
--excludedMethods