Repository: maven-integration-testing Updated Branches: refs/heads/master 27b3c96a4 -> c3f03ac53
[MNG-4721] Create an integration test to check handling of optional plugin dependencies Project: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/commit/c3f03ac5 Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/c3f03ac5 Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/c3f03ac5 Branch: refs/heads/master Commit: c3f03ac53f96c44f8272c8aa6ba27cdbbdb01395 Parents: 27b3c96 Author: Christian Schulte <schu...@apache.org> Authored: Sun Dec 11 00:35:21 2016 +0100 Committer: Christian Schulte <schu...@apache.org> Committed: Sun Dec 11 00:35:21 2016 +0100 ---------------------------------------------------------------------- ...ITmng4721OptionalPluginDependency34Test.java | 66 ++++++++++++++++++++ ...enITmng4721OptionalPluginDependencyTest.java | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c3f03ac5/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependency34Test.java ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependency34Test.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependency34Test.java new file mode 100644 index 0000000..3cb3435 --- /dev/null +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependency34Test.java @@ -0,0 +1,66 @@ +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 <a href="https://issues.apache.org/jira/browse/MNG-4721">MNG-4721</a>. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4721OptionalPluginDependency34Test + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4721OptionalPluginDependency34Test() + { + super( "[3.4,)" ); + } + + /** + * Verify the handling of direct/transitive optional plugin dependencies. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4721" ); + + Verifier verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4721" ); + verifier.addCliOption( "-s" ); + verifier.addCliOption( "settings.xml" ); + verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + Properties props = verifier.loadProperties( "target/pcl.properties" ); + assertEquals( "0", props.get( "org/apache/maven/plugin/coreit/c.properties.count" ) ); + assertEquals( "1", props.get( "mng4721a.properties.count" ) ); + assertEquals( "0", props.get( "mng4721b.properties.count" ) ); + } + +} http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c3f03ac5/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependencyTest.java ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependencyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependencyTest.java index 7780ec5..a636c1e 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependencyTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4721OptionalPluginDependencyTest.java @@ -36,7 +36,7 @@ public class MavenITmng4721OptionalPluginDependencyTest public MavenITmng4721OptionalPluginDependencyTest() { - super( "[2.0.3,)" ); + super( "[2.0.3,3.4)" ); } /**