From 91966db22cbcdc5b9ce7767a2ee2d68acfb901e1 Mon Sep 17 00:00:00 2001 From: Paul Gier Date: Fri, 2 May 2008 21:01:21 +0000 Subject: [PATCH] [MNG-3268] Adding IT for multiple -P params on the command line. git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@652909 13f79535-47bb-0310-9956-ffa450edef68 --- .../IntegrationTestSuite.java | 1 + ...avenITmng3268MultipleDashPCommandLine.java | 43 +++++++ .../mng-3268-MultipleDashPCommandLine/pom.xml | 120 ++++++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3268MultipleDashPCommandLine.java create mode 100644 its/core-integration-tests/src/test/resources/mng-3268-MultipleDashPCommandLine/pom.xml diff --git a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java index 376f1edb04..2c12d71c33 100644 --- a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java +++ b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java @@ -82,6 +82,7 @@ public class IntegrationTestSuite suite.addTestSuite( MavenITmng3341MetadataUpdatedFromDeploymentRepositoryTest.class ); suite.addTestSuite( MavenITmng3331ModulePathNormalization.class ); suite.addTestSuite( MavenITmng3221InfiniteForking.class ); + suite.addTestSuite( MavenITmng3268MultipleDashPCommandLine.class ); suite.addTestSuite( MavenITmng3220ImportScopeTest.class ); suite.addTestSuite( MavenITmng3099SettingsProfilesWithNoPOM.class ); suite.addTestSuite( MavenITmng2972OverridePluginDependency.class ); diff --git a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3268MultipleDashPCommandLine.java b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3268MultipleDashPCommandLine.java new file mode 100644 index 0000000000..7a77972e6c --- /dev/null +++ b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng3268MultipleDashPCommandLine.java @@ -0,0 +1,43 @@ +package org.apache.maven.integrationtests; + +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; +import org.apache.maven.it.Verifier; +import org.apache.maven.it.util.ResourceExtractor; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +public class MavenITmng3268MultipleDashPCommandLine + extends AbstractMavenIntegrationTestCase +{ + public MavenITmng3268MultipleDashPCommandLine() + throws InvalidVersionSpecificationException + { + super( "(2.0.9,)" ); + } + + public void testitMNG2234 () + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3268-MultipleDashPCommandLine" ); + + Verifier verifier; + + verifier = new Verifier( testDir.getAbsolutePath() ); + + List cliOptions = new ArrayList(); + cliOptions.add( "-Pprofile1,profile2" ); + cliOptions.add( "-Pprofile3" ); + cliOptions.add( "-P profile4" ); + verifier.setCliOptions( cliOptions ); + verifier.executeGoal( "package" ); + + verifier.verifyErrorFreeLog(); + verifier.assertFilePresent( "target/profile1/touch.txt" ); + verifier.assertFilePresent( "target/profile2/touch.txt" ); + verifier.assertFilePresent( "target/profile3/touch.txt" ); + verifier.assertFilePresent( "target/profile4/touch.txt" ); + verifier.resetStreams(); + } +} diff --git a/its/core-integration-tests/src/test/resources/mng-3268-MultipleDashPCommandLine/pom.xml b/its/core-integration-tests/src/test/resources/mng-3268-MultipleDashPCommandLine/pom.xml new file mode 100644 index 0000000000..70a999a6dd --- /dev/null +++ b/its/core-integration-tests/src/test/resources/mng-3268-MultipleDashPCommandLine/pom.xml @@ -0,0 +1,120 @@ + + 4.0.0 + org.apache.maven.its.mng2234 + test-artifact + 1.0-SNAPSHOT + + + + + org.apache.maven.its.plugins + maven-it-plugin-touch + 2.1-SNAPSHOT + + + + + + + profile1 + + + + org.apache.maven.its.plugins + maven-it-plugin-touch + + + profile1-touch + + touch + + + ${project.build.directory}/profile1 + + + + + + + + + profile2 + + + + org.apache.maven.its.plugins + maven-it-plugin-touch + + + profile2-touch + + touch + + + ${project.build.directory}/profile2 + + + + + + + + + profile3 + + + + org.apache.maven.its.plugins + maven-it-plugin-touch + + + profile3-touch + + touch + + + ${project.build.directory}/profile3 + + + + + + + + + profile4 + + + + org.apache.maven.its.plugins + maven-it-plugin-touch + + + profile4-touch + + touch + + + ${project.build.directory}/profile4 + + + + + + + + + + + + apache.snapshots + http://people.apache.org/repo/m2-snapshot-repository + + true + + + false + + + +