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 80cfc2cf90..b566978dcd 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 @@ -83,6 +83,7 @@ public class IntegrationTestSuite // ------------------------------------------------------------------------------------------------------------- // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng4992MapStylePropertiesParamConfigTest.class ); suite.addTestSuite( MavenITmng4975ProfileInjectedPluginExecutionOrderTest.class ); suite.addTestSuite( MavenITmng4973ExtensionVisibleToPluginInReactorTest.class ); suite.addTestSuite( MavenITmng4966AbnormalUrlPreservationTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4992MapStylePropertiesParamConfigTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4992MapStylePropertiesParamConfigTest.java new file mode 100644 index 0000000000..3f3134c115 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4992MapStylePropertiesParamConfigTest.java @@ -0,0 +1,60 @@ +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-4992. + */ +public class MavenITmng4992MapStylePropertiesParamConfigTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4992MapStylePropertiesParamConfigTest() + { + super( "[3.0.3,)" ); + } + + /** + * Verify that plugin parameters of type java.util.Properties can be configured like any other Map-style parameter. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4992" ); + + Verifier verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + Properties props = verifier.loadProperties( "target/config.properties" ); + assertEquals( "mapValue", props.getProperty( "mapParam.mapKey" ) ); + assertEquals( "propValue", props.getProperty( "propertiesParam.propKey" ) ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-4992/pom.xml b/its/core-it-suite/src/test/resources/mng-4992/pom.xml new file mode 100644 index 0000000000..37a586276f --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4992/pom.xml @@ -0,0 +1,60 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4992 + test + 1 + + Maven Integration Test :: MNG-4992 + + Verify that plugin parameters of type java.util.Properties can be configured like any other Map-style parameter. + + + + + + org.apache.maven.its.plugins + maven-it-plugin-configuration + 2.1-SNAPSHOT + + target/config.properties + + mapValue + + + propValue + + + + + validate + + custom-config + + + + + + +