Author: bentmann
Date: Sat Dec 4 23:24:20 2010
New Revision: 1042262
URL: http://svn.apache.org/viewvc?rev=1042262&view=rev
Log:
[MNG-2738] 1-char profile names cannot be activated with -P
o Added IT
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2738ProfileIdCollidesWithCliOptionTest.java
(with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2738/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2738/pom.xml
(with props)
Modified:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
Modified:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=1042262&r1=1042261&r2=1042262&view=diff
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
(original)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
Sat Dec 4 23:24:20 2010
@@ -451,6 +451,7 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenITmng2744checksumVerificationTest.class );
suite.addTestSuite(
MavenITmng2741PluginMetadataResolutionErrorMessageTest.class );
suite.addTestSuite( MavenITmng2739RequiredRepositoryElementsTest.class
);
+ suite.addTestSuite(
MavenITmng2738ProfileIdCollidesWithCliOptionTest.class );
suite.addTestSuite( MavenITmng2720SiblingClasspathArtifactsTest.class
);
suite.addTestSuite( MavenITmng2695OfflinePluginSnapshotsTest.class );
suite.addTestSuite( MavenITmng2693SitePluginRealmTest.class );
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2738ProfileIdCollidesWithCliOptionTest.java
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2738ProfileIdCollidesWithCliOptionTest.java?rev=1042262&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2738ProfileIdCollidesWithCliOptionTest.java
(added)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2738ProfileIdCollidesWithCliOptionTest.java
Sat Dec 4 23:24:20 2010
@@ -0,0 +1,61 @@
+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;
+
+/**
+ * This is a test set for <a
href="http://jira.codehaus.org/browse/MNG-2738">MNG-2738</a>.
+ *
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng2738ProfileIdCollidesWithCliOptionTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng2738ProfileIdCollidesWithCliOptionTest()
+ {
+ super( "[2.1.0,3.0-alpha-1),[3.0,)" );
+ }
+
+ /**
+ * Verify that the CLI parsing properly handles activation of profiles
whose id happens to match a short command
+ * line option.
+ */
+ public void testit()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(),
"/mng-2738" );
+
+ Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.getCliOptions().add( "-Pe" );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ verifier.assertFilePresent( "target/touch.txt" );
+ }
+
+}
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2738ProfileIdCollidesWithCliOptionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2738ProfileIdCollidesWithCliOptionTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2738/pom.xml
URL:
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2738/pom.xml?rev=1042262&view=auto
==============================================================================
---
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2738/pom.xml
(added)
+++
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2738/pom.xml
Sat Dec 4 23:24:20 2010
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.mng2738</groupId>
+ <artifactId>test</artifactId>
+ <version>0.1</version>
+
+ <name>Maven Integration Test :: MNG-2738</name>
+ <description>
+ Verify that the CLI parsing properly handles activation of profiles whose
id happens to match a short command
+ line option.
+ </description>
+
+ <profiles>
+ <profile>
+ <!-- NOTE: It's the essential piece of this test that the profile id
matches a short command line option, i.e. -e here -->
+ <id>e</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-log-file</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>default</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>reset</goal>
+ </goals>
+ <configuration>
+ <logFile>target/touch.txt</logFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2738/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2738/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision