null
.
* @param dstPath The path to the output file, relative to the base directory and possibly equal to the
@@ -943,7 +943,7 @@ public Map
+ * ${basedir}
in argument will be replaced by value of {@link #getBasedir()} during execution.
+ * @param option an argument to add
+ */
public void addCliOption( String option )
{
cliOptions.add( option );
}
+ /**
+ * Add a command line arguments, each argument must be set separately one by one.
+ *
+ * ${basedir}
in argument will be replaced by value of {@link #getBasedir()} during execution.
+ * @param options an arguments list to add
+ */
+ public void addCliOptions( String... options )
+ {
+ Collections.addAll( cliOptions, options );
+ }
+
public Properties getSystemProperties()
{
return systemProperties;
diff --git a/src/test/java/org/apache/maven/shared/verifier/VerifierTest.java b/src/test/java/org/apache/maven/shared/verifier/VerifierTest.java
index 0531611..5d16ca5 100644
--- a/src/test/java/org/apache/maven/shared/verifier/VerifierTest.java
+++ b/src/test/java/org/apache/maven/shared/verifier/VerifierTest.java
@@ -19,6 +19,7 @@
* under the License.
*/
+import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Path;
@@ -26,14 +27,23 @@
import java.util.Arrays;
import java.util.Map;
import java.util.Properties;
+import java.util.stream.Stream;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
-
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.arrayContaining;
+import static org.hamcrest.Matchers.hasItemInArray;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.params.provider.Arguments.arguments;
public class VerifierTest
{
@@ -101,7 +111,7 @@ public void testStripAnsi()
}
@Test
- public void testLoadPropertiesFNFE() throws VerificationException
+ public void testLoadPropertiesFNFE()
{
VerificationException exception = assertThrows( VerificationException.class, () -> {
Verifier verifier = new Verifier( "src/test/resources" );
@@ -130,4 +140,87 @@ void testDefaultFilterMap() throws VerificationException
assertTrue( filterMap.containsKey( "@basedir@" ) );
assertTrue( filterMap.containsKey( "@baseurl@" ) );
}
+
+ @Test
+ void testDefaultMavenArgument() throws VerificationException
+ {
+ TestVerifier verifier = new TestVerifier( "src/test/resources" );
+
+ verifier.executeGoal( "test" );
+
+ assertThat( verifier.launcher.cliArgs, arrayContaining(
+ "-e", "--batch-mode", "-Dmaven.repo.local=test-local-repo",
+ "org.apache.maven.plugins:maven-clean-plugin:clean", "test" ) );
+ }
+
+ public static Stream