Author: bentmann
Date: Sat Dec  4 20:48:33 2010
New Revision: 1042236

URL: http://svn.apache.org/viewvc?rev=1042236&view=rev
Log:
[MNG-4925] Mismanagement of container lookup realm can cause type 
incompatibilities for plugins looking up components by string

o Added IT

Added:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4925ContainerLookupRealmDuringMojoExecTest.java
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/pom.xml
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/maven-mng4925-plugin/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/maven-mng4925-plugin/0.1/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/maven-mng4925-plugin/0.1/maven-mng4925-plugin-0.1.jar
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/maven-mng4925-plugin/0.1/maven-mng4925-plugin-0.1.pom
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/settings-template.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=1042236&r1=1042235&r2=1042236&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 20:48:33 2010
@@ -83,6 +83,7 @@ public class IntegrationTestSuite
         // 
-------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- 
MNG-3137
 
+        suite.addTestSuite( 
MavenITmng4925ContainerLookupRealmDuringMojoExecTest.class );
         suite.addTestSuite( 
MavenITmng4913UserPropertyVsDependencyPomPropertyTest.class );
         suite.addTestSuite( 
MavenITmng4895PluginDepWithNonRelocatedMavenApiTest.class );
         suite.addTestSuite( MavenITmng4891RobustSnapshotResolutionTest.class );

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4925ContainerLookupRealmDuringMojoExecTest.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4925ContainerLookupRealmDuringMojoExecTest.java?rev=1042236&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4925ContainerLookupRealmDuringMojoExecTest.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4925ContainerLookupRealmDuringMojoExecTest.java
 Sat Dec  4 20:48:33 2010
@@ -0,0 +1,64 @@
+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-4925";>MNG-4925</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4925ContainerLookupRealmDuringMojoExecTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng4925ContainerLookupRealmDuringMojoExecTest()
+    {
+        super( "[3.0.2,)" );
+    }
+
+    /**
+     * Verify that the container's lookup realm is set to the plugin realm 
during a mojo execution as otherwise
+     * string-based lookups can fail to load the proper type.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), 
"/mng-4925" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng4925" );
+        verifier.getCliOptions().add( "-s" );
+        verifier.getCliOptions().add( "settings.xml" );
+        verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", 
verifier.newDefaultFilterProperties() );
+        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/MavenITmng4925ContainerLookupRealmDuringMojoExecTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4925ContainerLookupRealmDuringMojoExecTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/pom.xml?rev=1042236&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/pom.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/pom.xml
 Sat Dec  4 20:48:33 2010
@@ -0,0 +1,55 @@
+<?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.mng4925</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-4925</name>
+  <description>
+    Verify that the container's lookup realm is set to the plugin realm during 
a mojo execution as otherwise
+    string-based lookups can fail to load the proper type.
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <!-- See sources embedded in plugin JAR for more details -->
+        <groupId>org.apache.maven.its.mng4925</groupId>
+        <artifactId>maven-mng4925-plugin</artifactId>
+        <version>0.1</version>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>it</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

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

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

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/maven-mng4925-plugin/0.1/maven-mng4925-plugin-0.1.jar
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/maven-mng4925-plugin/0.1/maven-mng4925-plugin-0.1.jar?rev=1042236&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/maven-mng4925-plugin/0.1/maven-mng4925-plugin-0.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/maven-mng4925-plugin/0.1/maven-mng4925-plugin-0.1.pom
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/maven-mng4925-plugin/0.1/maven-mng4925-plugin-0.1.pom?rev=1042236&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/maven-mng4925-plugin/0.1/maven-mng4925-plugin-0.1.pom
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/repo/org/apache/maven/its/mng4925/maven-mng4925-plugin/0.1/maven-mng4925-plugin-0.1.pom
 Sat Dec  4 20:48:33 2010
@@ -0,0 +1,68 @@
+<?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/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng4925</groupId>
+  <artifactId>maven-mng4925-plugin</artifactId>
+  <version>0.1</version>
+  <packaging>maven-plugin</packaging>
+
+  <distributionManagement>
+    <repository>
+      <id>maven-core-it</id>
+      <url>file:///${basedir}/repo</url>
+    </repository>
+  </distributionManagement>
+
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+      <version>1.0-alpha-9-stable-1</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <resources>
+      <resource>
+        <directory>.</directory>
+        <includes>
+          <include>pom.xml</include>
+          <include>src/**</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
+  </build>
+</project>

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/settings-template.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/settings-template.xml?rev=1042236&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/settings-template.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4925/settings-template.xml
 Sat Dec  4 20:48:33 2010
@@ -0,0 +1,55 @@
+<?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.
+-->
+
+<settings>
+  <profiles>
+    <profile>
+      <id>maven-core-it-repo</id>
+      <repositories>
+        <repository>
+          <id>maven-core-it</id>
+          <url>@baseurl@/repo</url>
+          <releases>
+            <checksumPolicy>ignore</checksumPolicy>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>maven-core-it</id>
+          <url>@baseurl@/repo</url>
+          <releases>
+            <checksumPolicy>ignore</checksumPolicy>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
+  <activeProfiles>
+    <activeProfile>maven-core-it-repo</activeProfile>
+  </activeProfiles>
+</settings>

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

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


Reply via email to