Author: olamy
Date: Wed Jan  4 20:23:55 2012
New Revision: 1227299

URL: http://svn.apache.org/viewvc?rev=1227299&view=rev
Log:
add it test for MNG-5224

Added:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/pom.xml
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/settings.xml
   (with props)
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/pom.xml
   (with props)
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/maven/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/maven/plugin/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/maven/plugin/coreit/
    
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/maven/plugin/coreit/SettingsReadItMojo.java
   (with props)
Modified:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml

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=1227299&r1=1227298&r2=1227299&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
 Wed Jan  4 20:23:55 2012
@@ -106,6 +106,7 @@ public class IntegrationTestSuite
         // 
-------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- 
MNG-3137
 
+        suite.addTestSuite( MavenITmng5224InjectedSettings.class );
         suite.addTestSuite( MavenITmng5214DontMapWsdlToJar.class );
         suite.addTestSuite( 
MavenITmng5137ReactorResolutionInForkedBuildTest.class );
         suite.addTestSuite( 
MavenITmng5135AggregatorDepResolutionModuleExtensionTest.class );

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/pom.xml?rev=1227299&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/pom.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/pom.xml
 Wed Jan  4 20:23:55 2012
@@ -0,0 +1,27 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng5224</groupId>
+  <artifactId>test-project</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>test-project</name>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-settings</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>settings-read</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/settings.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/settings.xml?rev=1227299&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/settings.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/settings.xml
 Wed Jan  4 20:23:55 2012
@@ -0,0 +1,27 @@
+<settings>
+  <profiles>
+    <profile>
+      <id>apache</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <properties>
+        <run-its>true</run-its>
+      </properties>
+    </profile>
+    <profile>
+      <id>release</id>
+      <properties>
+        <gpg.passphrase>verycomplicatedpassphrase</gpg.passphrase>
+      </properties>
+    </profile>
+    <profile>
+      <id>fast</id>
+      <properties>
+        <maven.test.skip>true</maven.test.skip>
+        <skipTests>true</skipTests>
+      </properties>
+    </profile>
+  </profiles>
+</settings>
+ 

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/settings.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5224/settings.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/pom.xml?rev=1227299&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/pom.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/pom.xml
 Wed Jan  4 20:23:55 2012
@@ -0,0 +1,50 @@
+<?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 xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <artifactId>maven-it-plugins</artifactId>
+    <groupId>org.apache.maven.its.plugins</groupId>
+    <version>2.1-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>maven-it-plugin-settings</artifactId>
+  <packaging>maven-plugin</packaging>
+
+  <name>Maven IT Plugin :: Touch</name>
+  <inceptionYear>2001</inceptionYear>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-settings</artifactId>
+      <version>2.0</version>
+    </dependency>
+
+  </dependencies>
+</project>

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/maven/plugin/coreit/SettingsReadItMojo.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/maven/plugin/coreit/SettingsReadItMojo.java?rev=1227299&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/maven/plugin/coreit/SettingsReadItMojo.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/maven/plugin/coreit/SettingsReadItMojo.java
 Wed Jan  4 20:23:55 2012
@@ -0,0 +1,79 @@
+package org.apache.maven.plugin.coreit;
+
+/*
+ * 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.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.settings.Settings;
+import org.apache.maven.settings.io.xpp3.SettingsXpp3Writer;
+import org.codehaus.plexus.util.IOUtil;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * @goal settings-read
+ * @phase validate
+ * @description Goal which read settings and dump it to a file
+ */
+public class SettingsReadItMojo
+    extends AbstractMojo
+{
+    /**
+     * @parameter expression="${settings}"
+     * @required
+     * @readonly
+     */
+    private Settings settings;
+
+    /**
+     * @parameter default-value="target/settings-dump.xml"
+     * @required
+     */
+    private File dumpFile;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+        if ( dumpFile.exists() )
+        {
+            dumpFile.delete();
+        }
+        dumpFile.getParentFile().mkdirs();
+        FileWriter fw = null;
+        try
+        {
+            fw = new FileWriter( dumpFile );
+            SettingsXpp3Writer writer = new SettingsXpp3Writer();
+            writer.write( fw, settings );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( e.getMessage(), e );
+        }
+        finally
+        {
+            IOUtil.close( fw );
+        }
+    }
+
+
+}

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/maven/plugin/coreit/SettingsReadItMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-settings/src/main/java/org/apache/maven/plugin/coreit/SettingsReadItMojo.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml?rev=1227299&r1=1227298&r2=1227299&view=diff
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml 
(original)
+++ 
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/pom.xml 
Wed Jan  4 20:23:55 2012
@@ -75,6 +75,7 @@ under the License.
     <module>maven-it-plugin-extension1</module>
     <module>maven-it-plugin-extension2</module>
     <module>maven-it-plugin-plexus-lifecycle</module>
+    <module>maven-it-plugin-settings</module>
   </modules>
 
   <scm>


Reply via email to