maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ifedore...@apache.org
Subject maven-integration-testing git commit: MNG-5768 @execution-id syntax for direct plugin goal invocation
Date Fri, 20 Feb 2015 13:08:05 GMT
Repository: maven-integration-testing
Updated Branches:
  refs/heads/master 0eb902cb9 -> 4cdbfa2e0


MNG-5768 @execution-id syntax for direct plugin goal invocation

Signed-off-by: Igor Fedorenko <ifedorenko@apache.org>


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/4cdbfa2e
Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/4cdbfa2e
Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/4cdbfa2e

Branch: refs/heads/master
Commit: 4cdbfa2e0d5c915c466ec922a10f79ef75148104
Parents: 0eb902c
Author: Igor Fedorenko <ifedorenko@apache.org>
Authored: Fri Feb 20 08:02:51 2015 -0500
Committer: Igor Fedorenko <ifedorenko@apache.org>
Committed: Fri Feb 20 08:07:04 2015 -0500

----------------------------------------------------------------------
 .../apache/maven/it/IntegrationTestSuite.java   |  1 +
 .../it/MavenITmng5768CliExecutionIdTest.java    | 49 +++++++++++++++++
 .../resources/mng-5768-cli-execution-id/pom.xml | 58 ++++++++++++++++++++
 3 files changed, 108 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/4cdbfa2e/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index a6cd6d5..8685af0 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -106,6 +106,7 @@ public class IntegrationTestSuite
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng5768CliExecutionIdTest.class );
         suite.addTestSuite( MavenITmng5742BuildExtensionClassloaderTest.class );
         suite.addTestSuite( MavenITmng5578SessionScopeTest.class );
         suite.addTestSuite( MavenITmng5753CustomMojoExecutionConfiguratorTest.class );

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/4cdbfa2e/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5768CliExecutionIdTest.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5768CliExecutionIdTest.java
b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5768CliExecutionIdTest.java
new file mode 100644
index 0000000..4fb29e8
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5768CliExecutionIdTest.java
@@ -0,0 +1,49 @@
+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 java.io.File;
+import java.util.Properties;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+public class MavenITmng5768CliExecutionIdTest
+    extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng5768CliExecutionIdTest()
+    {
+        super( "(3.2.5,)" );
+    }
+
+    public void test()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5768-cli-execution-id"
);
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.deleteDirectory( "target" );
+        verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-configuration:config@test-execution-id"
);
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        Properties props = verifier.loadProperties( "target/config.properties" );
+        assertEquals( "CONFIGURED", props.getProperty( "beanParam.fieldParam" ) );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/4cdbfa2e/core-it-suite/src/test/resources/mng-5768-cli-execution-id/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5768-cli-execution-id/pom.xml b/core-it-suite/src/test/resources/mng-5768-cli-execution-id/pom.xml
new file mode 100644
index 0000000..a138eb8
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5768-cli-execution-id/pom.xml
@@ -0,0 +1,58 @@
+<?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.mng5768</groupId>
+  <artifactId>test</artifactId>
+  <version>1</version>
+
+  <name>Maven Integration Test :: MNG-5768</name> 
+  <description>
+    Verify that plugin execution id can be specified from command line.
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-configuration</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <propertiesFile>target/config.properties</propertiesFile>
+        </configuration>
+        <executions>
+          <execution>
+            <id>test-execution-id</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>config</goal>
+            </goals>
+            <configuration>
+              <beanParam>CONFIGURED</beanParam>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>


Mime
View raw message