Author: bentmann
Date: Thu Mar 25 21:56:20 2010
New Revision: 927605

URL: http://svn.apache.org/viewvc?rev=927605&view=rev
Log:
[MNG-4162] Removal of all reporting logic from the core of Maven

o Added IT

Added:
    
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4162ReportingMigrationTest.java
   (with props)
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4162/
    
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4162/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=927605&r1=927604&r2=927605&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
 Thu Mar 25 21:56:20 2010
@@ -205,6 +205,7 @@ public class IntegrationTestSuite
         suite.addTestSuite( MavenITmng4180PerDependencyExclusionsTest.class );
         suite.addTestSuite( MavenITmng4172EmptyDependencySetTest.class );
         suite.addTestSuite( MavenITmng4166HideCoreCommonsCliTest.class );
+        suite.addTestSuite( MavenITmng4162ReportingMigrationTest.class );
         suite.addTestSuite( MavenITmng4150VersionRangeTest.class );
         suite.addTestSuite( 
MavenITmng4148DepPomInterpWithSettingsProfilesTest.class );
         suite.addTestSuite( MavenITmng4129PluginExecutionInheritanceTest.class 
);

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4162ReportingMigrationTest.java
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4162ReportingMigrationTest.java?rev=927605&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4162ReportingMigrationTest.java
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4162ReportingMigrationTest.java
 Thu Mar 25 21:56:20 2010
@@ -0,0 +1,76 @@
+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;
+import java.util.Properties;
+
+/**
+ * This is a test set for <a 
href="http://jira.codehaus.org/browse/MNG-4162";>MNG-4162</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4162ReportingMigrationTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng4162ReportingMigrationTest()
+    {
+        super( "[3.0-alpha-8,)" );
+    }
+
+    /**
+     * Verify that the legacy reporting section is automatically converted 
into ordinary plugin configuration of the
+     * Maven Site Plugin to ease migration.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), 
"/mng-4162" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        String p = 
"project.build.plugins.0.executions.0.configuration.children.";
+
+        Properties props = verifier.loadProperties( "target/site.properties" );
+        assertTrue( props.getProperty( p + "outputDirectory.0.value" 
).endsWith( "other-site" ) );
+        assertEquals( "maven-surefire-report-plugin",
+            props.getProperty( p + 
"reportPlugins.0.children.reportPlugin.0.children.artifactId.0.value" ) );
+        assertEquals( "maven-project-info-reports-plugin",
+            props.getProperty( p + 
"reportPlugins.0.children.reportPlugin.1.children.artifactId.0.value" ) );
+        assertEquals( "report",
+            props.getProperty( p + 
"reportPlugins.0.children.reportPlugin.0.children.reportSets.0.children.reportSet.0.children.reports.0.children.report.0.value"
 ) );
+        assertEquals( "report-only",
+            props.getProperty( p + 
"reportPlugins.0.children.reportPlugin.0.children.reportSets.0.children.reportSet.1.children.reports.0.children.report.0.value"
 ) );
+        assertEquals( "true",
+            props.getProperty( p + 
"reportPlugins.0.children.reportPlugin.0.children.reportSets.0.children.reportSet.0.children.configuration.0.children.skipTests.0.value"
 ) );
+        assertEquals( "false",
+            props.getProperty( p + 
"reportPlugins.0.children.reportPlugin.0.children.reportSets.0.children.reportSet.1.children.configuration.0.children.skipTests.0.value"
 ) );
+    }
+
+}

Propchange: 
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4162ReportingMigrationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4162/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4162/pom.xml?rev=927605&view=auto
==============================================================================
--- 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4162/pom.xml
 (added)
+++ 
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4162/pom.xml
 Thu Mar 25 21:56:20 2010
@@ -0,0 +1,105 @@
+<?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.mng4162</groupId>
+  <artifactId>test</artifactId>
+  <version>1.0</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-4162</name>
+  <description>
+    Verify that the legacy reporting section is automatically converted into 
ordinary plugin configuration of the
+    Maven Site Plugin to ease migration.
+  </description>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-site-plugin</artifactId>
+        <version>0.1-stub-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>site</id>
+            <phase>site</phase>
+            <goals>
+              <goal>site</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-expression</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <outputFile>target/site.properties</outputFile>
+          <expressions>
+            
<expression>project/build/plugins/0/executions/0/configuration</expression>
+          </expressions>
+        </configuration>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>eval</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <reporting>
+    <outputDirectory>target/other-site</outputDirectory>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+        <version>2.5</version>
+        <configuration>
+          <skipTests>true</skipTests>
+        </configuration>
+        <reportSets>
+          <reportSet>
+            <id>set-a</id>
+            <reports>
+              <report>report</report>
+            </reports>
+          </reportSet>
+          <reportSet>
+            <id>set-b</id>
+            <configuration>
+              <skipTests>false</skipTests>
+            </configuration>
+            <reports>
+              <report>report-only</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+</project>

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

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


Reply via email to