You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2011/10/09 20:33:52 UTC

svn commit: r1180680 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-5019/ resources/mng-5019/repo/ resources/mng-5019/repo/org/ resources/mng-5019/repo/org/apache/ resources/mng-5019/repo/org/...

Author: bentmann
Date: Sun Oct  9 18:33:51 2011
New Revision: 1180680

URL: http://svn.apache.org/viewvc?rev=1180680&view=rev
Log:
[MNG-5019] [regression] String-based component lookups performed by report mojos fail with ClassCastException

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/maven-it-plugin/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/maven-it-plugin/0.1/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/maven-it-plugin/0.1/maven-it-plugin-0.1.jar   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/maven-it-plugin/0.1/maven-it-plugin-0.1.pom
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/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=1180680&r1=1180679&r2=1180680&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 Sun Oct  9 18:33:51 2011
@@ -84,6 +84,7 @@ public class IntegrationTestSuite
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
         suite.addTestSuite( MavenITmng5064SuppressSnapshotUpdatesTest.class );
+        suite.addTestSuite( MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest.class );
         suite.addTestSuite( MavenITmng5013ConfigureParamBeanFromScalarValueTest.class );
         suite.addTestSuite( MavenITmng5012CollectionVsArrayParamCoercionTest.class );
         suite.addTestSuite( MavenITmng5011ConfigureCollectionArrayFromSystemPropTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest.java?rev=1180680&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest.java Sun Oct  9 18:33:51 2011
@@ -0,0 +1,63 @@
+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-5019">MNG-5019</a>.
+ */
+public class MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest()
+    {
+        super( "[3.0.3,)" );
+    }
+
+    /**
+     * Verify that plugins executed by other plugins (like reports executed by the maven-site-plugin) can successfully
+     * lookup components via string-based roles from their plugin realm as denoted by the thread context class loader,
+     * even if those components are also contained in the parent plugin realm.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5019" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng5019" );
+        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/MavenITmng5019StringBasedCompLookupFromChildPluginRealmTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/pom.xml?rev=1180680&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/pom.xml Sun Oct  9 18:33:51 2011
@@ -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.mng5019</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-5019</name>
+  <description>
+    Verify that plugins executed by other plugins (like reports executed by the maven-site-plugin) can successfully
+    lookup components via string-based roles from their plugin realm as denoted by the thread context class loader,
+    even if those components are also contained in the parent plugin realm.
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <!-- see plugin sources embedded in JAR for the details -->
+        <groupId>org.apache.maven.its.mng5019</groupId>
+        <artifactId>maven-it-plugin</artifactId>
+        <version>0.1</version>
+        <executions>
+          <execution>
+            <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-5019/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/maven-it-plugin/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/maven-it-plugin/0.1/
------------------------------------------------------------------------------
    bugtraq:number = true

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

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

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/maven-it-plugin/0.1/maven-it-plugin-0.1.pom
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/maven-it-plugin/0.1/maven-it-plugin-0.1.pom?rev=1180680&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/maven-it-plugin/0.1/maven-it-plugin-0.1.pom (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/repo/org/apache/maven/its/mng5019/maven-it-plugin/0.1/maven-it-plugin-0.1.pom Sun Oct  9 18:33:51 2011
@@ -0,0 +1,70 @@
+<?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.mng5019</groupId>
+  <artifactId>maven-it-plugin</artifactId>
+  <version>0.1</version>
+  <packaging>maven-plugin</packaging>
+
+  <prerequisites>
+    <maven>3.0</maven>
+  </prerequisites>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>3.0</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <version>3.0</version>
+      <scope>provided</scope>
+    </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>
+
+  <distributionManagement>
+    <repository>
+      <id>maven-core-it</id>
+      <url>file:///${basedir}/repo</url>
+    </repository>
+  </distributionManagement>
+</project>

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/settings-template.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/settings-template.xml?rev=1180680&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/settings-template.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5019/settings-template.xml Sun Oct  9 18:33:51 2011
@@ -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-5019/settings-template.xml
------------------------------------------------------------------------------
    svn:eol-style = native

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