diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index 8fe8d5b4eb..fb81cdd70f 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -332,6 +332,7 @@ public static Test suite() suite.addTestSuite( MavenITmng3536AppendedAbsolutePathsTest.class ); suite.addTestSuite( MavenITmng3535SelfReferentialPropertiesTest.class ); suite.addTestSuite( MavenITmng3530DynamicPOMInterpolationTest.class ); + suite.addTestSuite( MavenITmng3529QuotedCliArgTest.class ); suite.addTestSuite( MavenITmng3506ArtifactHandlersFromPluginsTest.class); suite.addTestSuite( MavenITmng3503Xpp3ShadingTest.class ); suite.addTestSuite( MavenITmng3498ForkToOtherMojoTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3529QuotedCliArgTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3529QuotedCliArgTest.java new file mode 100644 index 0000000000..aebf19a890 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3529QuotedCliArgTest.java @@ -0,0 +1,62 @@ +package org.apache.maven.it; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; + +import java.io.File; +import java.util.Properties; + +/** + * This is a test set for MNG-3529. + * + * @author Benjamin Bentmann + */ +public class MavenITmng3529QuotedCliArgTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng3529QuotedCliArgTest() + { + super( "[3.0-alpha-8,)" ); + } + + /** + * Verify that the command line processing doesn't choke on things like -Da=" ". + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3529" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.getCliOptions().add( "-Dtest.a=\" \"" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + Properties props = verifier.loadProperties( "target/pom.properties" ); + assertEquals( "- -", props.getProperty( "project.properties.propA" ) ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-3529/pom.xml b/its/core-it-suite/src/test/resources/mng-3529/pom.xml new file mode 100644 index 0000000000..2772b38376 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3529/pom.xml @@ -0,0 +1,63 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3529 + test + 0.1 + pom + + Maven Integration Test :: MNG-3529 + + Verify that the command line processing doesn't choke on things like -Da=" ". + + + + -${test.a}- + + + + + + org.apache.maven.its.plugins + maven-it-plugin-expression + 2.1-SNAPSHOT + + + test + validate + + + project/properties + + target/pom.properties + + + eval + + + + + + +