Author: dfabulich
Date: Mon Nov 26 00:50:02 2007
New Revision: 598168
URL: http://svn.apache.org/viewvc?rev=598168&view=rev
Log:
[SUREFIRE-268] New 'aggregate' option allows you to aggregate surefire reports
like javadoc and jxr
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportTest.java
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/pom.xml
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/src/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/src/test/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/src/test/java/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/src/test/java/aggregateReport/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/src/test/java/aggregateReport/FailingTest.java
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/pom.xml
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/src/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/src/test/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/src/test/java/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/src/test/java/aggregateReport/
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/src/test/java/aggregateReport/BasicTest.java
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/pom.xml
Modified:
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportMojo.java
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java
maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/HelperAssertions.java
Modified:
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java?rev=598168&r1=598167&r2=598168&view=diff
==============================================================================
---
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
(original)
+++
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java
Mon Nov 26 00:50:02 2007
@@ -42,9 +42,9 @@
private String xrefLocation;
- public SurefireReportGenerator( File reportsDirectory, Locale locale,
boolean showSuccess, String xrefLocation )
+ public SurefireReportGenerator( File[] reportsDirectories, Locale locale,
boolean showSuccess, String xrefLocation )
{
- report = new SurefireReportParser( reportsDirectory, locale );
+ report = new SurefireReportParser( reportsDirectories, locale );
this.xrefLocation = xrefLocation;
Modified:
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportMojo.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportMojo.java?rev=598168&r1=598167&r2=598168&view=diff
==============================================================================
---
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportMojo.java
(original)
+++
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportMojo.java
Mon Nov 26 00:50:02 2007
@@ -19,22 +19,21 @@
* under the License.
*/
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
import org.apache.maven.model.ReportPlugin;
import org.apache.maven.project.MavenProject;
import org.apache.maven.reporting.AbstractMavenReport;
import org.apache.maven.reporting.MavenReportException;
import org.codehaus.doxia.site.renderer.SiteRenderer;
-import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.PathTool;
import org.codehaus.plexus.util.StringUtils;
-import java.io.File;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
/**
* Creates a nicely formatted Surefire Test Report in html format.
@@ -43,6 +42,7 @@
* @version $Id$
* @goal report
* @execute phase="test" lifecycle="surefire"
+ * @aggregator
*/
public class SurefireReportMojo
extends AbstractMavenReport
@@ -79,13 +79,29 @@
private boolean showSuccess;
/**
- * This directory contains the XML Report files that will be parsed and
rendered to HTML format.
+ * Directories containing the XML Report files that will be parsed and
rendered to HTML format.
*
+ * @parameter
+ */
+ private File[] reportsDirectories;
+
+ /**
+ * (Deprecated, use reportsDirectories) This directory contains the XML
Report files that will be parsed and rendered to HTML format.
+ *
+ * @deprecated
* @parameter expression="${project.build.directory}/surefire-reports"
- * @required
*/
private File reportsDirectory;
+
+ /**
+ * The projects in the reactor for aggregation report.
+ *
+ * @parameter expression="${reactorProjects}"
+ * @readonly
+ */
+ private List reactorProjects;
+
/**
* The filename to use for the report.
*
@@ -107,12 +123,60 @@
* @parameter expression="${linkXRef}" default-value="true"
*/
private boolean linkXRef;
+
+ /**
+ * Whether to build an aggregated report at the root, or build individual
reports.
+ *
+ * @parameter expression="${aggregate}" default-value="false"
+ */
+ private boolean aggregate;
public void executeReport( Locale locale )
throws MavenReportException
{
+ if ( reportsDirectory != null )
+ {
+ if ( reportsDirectories == null )
+ {
+ reportsDirectories = new File[] { reportsDirectory };
+ }
+ else
+ {
+ File[] oldReports = reportsDirectories;
+ reportsDirectories = new File[oldReports.length+1];
+ System.arraycopy( oldReports, 0, reportsDirectories, 0,
oldReports.length );
+ reportsDirectories[oldReports.length] = reportsDirectory;
+ }
+ }
+ if ( aggregate )
+ {
+ if ( !project.isExecutionRoot() ) return;
+ if ( reportsDirectories == null )
+ {
+ ArrayList reportsDirectoryList = new ArrayList();
+ // TODO guess the real location
+ for (Iterator i = reactorProjects.iterator(); i.hasNext();)
+ {
+ MavenProject subProject = (MavenProject) i.next();
+ if ( project.equals( subProject ) ) continue;
+ String buildDir = subProject.getBuild().getDirectory();
+ File reportsDirectory = new File( buildDir +
"/surefire-reports" );
+ reportsDirectoryList.add( reportsDirectory );
+ }
+ reportsDirectories = (File[]) reportsDirectoryList.toArray(
new File[0] );
+ }
+ }
+ else
+ {
+ if ( reportsDirectories == null )
+ {
+ reportsDirectories = new File[] { new File(
project.getBuild().getDirectory() + "/surefire-reports" ) };
+ }
+ }
+
+
SurefireReportGenerator report =
- new SurefireReportGenerator( reportsDirectory, locale,
showSuccess, determineXrefLocation() );
+ new SurefireReportGenerator( reportsDirectories, locale,
showSuccess, determineXrefLocation() );
report.doGenerateReport( getBundle( locale ), getSink() );
}
@@ -192,24 +256,4 @@
return ResourceBundle.getBundle( "surefire-report", locale,
this.getClass().getClassLoader() );
}
- /**
- * @see org.apache.maven.reporting.AbstractMavenReport#canGenerateReport()
- */
- public boolean canGenerateReport()
- {
- try
- {
- if ( reportsDirectory.exists() && reportsDirectory.isDirectory() )
- {
- List fileList = FileUtils.getFileNames( reportsDirectory,
"**/TEST-*.xml", "", true );
- return !fileList.isEmpty();
- }
- }
- catch ( IOException e )
- {
- getLog().error( "Error accessing reports directory!" );
- }
-
- return false;
- }
}
Modified:
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java?rev=598168&r1=598167&r2=598168&view=diff
==============================================================================
---
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java
(original)
+++
maven/surefire/trunk/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java
Mon Nov 26 00:50:02 2007
@@ -19,12 +19,6 @@
* under the License.
*/
-import org.apache.maven.reporting.MavenReportException;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.StringUtils;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;
import java.text.NumberFormat;
@@ -35,11 +29,18 @@
import java.util.Locale;
import java.util.Map;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.maven.reporting.MavenReportException;
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.codehaus.plexus.util.StringUtils;
+import org.xml.sax.SAXException;
+
public class SurefireReportParser
{
private NumberFormat numberFormat = NumberFormat.getInstance();
- private File reportsDirectory;
+ private File[] reportsDirectories;
private List testSuites = new ArrayList();
@@ -51,9 +52,9 @@
{
}
- public SurefireReportParser( File reportsDirectory, Locale locale )
+ public SurefireReportParser( File[] reportsDirectories, Locale locale )
{
- this.reportsDirectory = reportsDirectory;
+ this.reportsDirectories = reportsDirectories;
setLocale( locale );
}
@@ -61,35 +62,42 @@
public List parseXMLReportFiles()
throws MavenReportException
{
- if ( reportsDirectory.exists() )
+ List xmlReportFileList = new ArrayList();
+ for ( int i = 0; i < reportsDirectories.length; i++ )
{
+ File reportsDirectory = reportsDirectories[i];
+ if ( !reportsDirectory.exists() ) continue;
String[] xmlReportFiles = getIncludedFiles( reportsDirectory,
"*.xml", "*.txt, testng-failed.xml, testng-results.xml" );
-
- for ( int index = 0; index < xmlReportFiles.length; index++ )
+ for ( int j = 0; j < xmlReportFiles.length; j++ )
{
- ReportTestSuite testSuite = new ReportTestSuite();
-
- String currentReport = xmlReportFiles[index];
+ File xmlReport = new File( reportsDirectory, xmlReportFiles[j]
);
+ xmlReportFileList.add( xmlReport );
+ }
+ }
+ for ( int index = 0; index < xmlReportFileList.size(); index++ )
+ {
+ ReportTestSuite testSuite = new ReportTestSuite();
- try
- {
- testSuite.parse( reportsDirectory + "/" + currentReport );
- }
- catch ( ParserConfigurationException e )
- {
- throw new MavenReportException( "Error setting up parser
for JUnit XML report", e );
- }
- catch ( SAXException e )
- {
- throw new MavenReportException( "Error parsing JUnit XML
report " + currentReport, e );
- }
- catch ( IOException e )
- {
- throw new MavenReportException( "Error reading JUnit XML
report " + currentReport, e );
- }
+ File currentReport = (File) xmlReportFileList.get( index );
- testSuites.add( testSuite );
+ try
+ {
+ testSuite.parse( currentReport.getAbsolutePath() );
+ }
+ catch ( ParserConfigurationException e )
+ {
+ throw new MavenReportException( "Error setting up parser for
JUnit XML report", e );
}
+ catch ( SAXException e )
+ {
+ throw new MavenReportException( "Error parsing JUnit XML
report " + currentReport, e );
+ }
+ catch ( IOException e )
+ {
+ throw new MavenReportException( "Error reading JUnit XML
report " + currentReport, e );
+ }
+
+ testSuites.add( testSuite );
}
return testSuites;
@@ -161,12 +169,17 @@
public void setReportsDirectory( File reportsDirectory )
{
- this.reportsDirectory = reportsDirectory;
+ this.reportsDirectories = new File[] { reportsDirectory };
+ }
+
+ public void setReportsDirectories( File[] reportsDirectories )
+ {
+ this.reportsDirectories = reportsDirectories;
}
- public File getReportsDirectory()
+ public File[] getReportsDirectories()
{
- return this.reportsDirectory;
+ return this.reportsDirectories;
}
public final void setLocale( Locale locale )
Modified:
maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java?rev=598168&r1=598167&r2=598168&view=diff
==============================================================================
---
maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
(original)
+++
maven/surefire/trunk/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
Mon Nov 26 00:50:02 2007
@@ -138,13 +138,6 @@
.floatValue(), 0 );
}
- public void testSetReportsDirectory()
- {
- report.setReportsDirectory( new File( "Reports_Directory" ) );
-
- assertEquals( new File( "Reports_Directory" ),
report.getReportsDirectory() );
- }
-
public void testGetSuitesGroupByPackage()
{
ReportTestSuite tSuite1 = new ReportTestSuite();
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportTest.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportTest.java?rev=598168&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportTest.java
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AggregateReportTest.java
Mon Nov 26 00:50:02 2007
@@ -0,0 +1,45 @@
+package org.apache.maven.surefire.its;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.integrationtests.AbstractMavenIntegrationTestCase;
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * Test report aggregation
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Dan Fabulich</a>
+ *
+ */
+public class AggregateReportTest
+ extends AbstractMavenIntegrationTestCase
+{
+ public void testAggregateReport ()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(),
"/aggregate-report" );
+
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ List goals = new ArrayList();
+ goals.add( "jxr:test-jxr" );
+ goals.add( "surefire-report:report" );
+ verifier.executeGoals( goals );
+ //DGF even though the build will succeed, the log will contain errors
(from the failure)
+ //verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ File surefireReportHtml = new File( testDir,
"target/site/surefire-report.html");
+ assertTrue( "surefire report missing: " +
surefireReportHtml.getAbsolutePath(), surefireReportHtml.exists() );
+
+ // TODO HtmlUnit tests on the surefire report
+
+ File[] testDirs = new File[2];
+ testDirs[0] = new File( testDir, "child1" );
+ testDirs[1] = new File( testDir, "child2" );
+ ITSuiteResults suite = HelperAssertions.parseTestResults( testDirs );
+ HelperAssertions.assertTestSuiteResults( 2, 0, 1, 0, suite );
+ }
+}
Modified:
maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/HelperAssertions.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/HelperAssertions.java?rev=598168&r1=598167&r2=598168&view=diff
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/HelperAssertions.java
(original)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/HelperAssertions.java
Mon Nov 26 00:50:02 2007
@@ -22,27 +22,39 @@
public static void assertTestSuiteResults( int total, int errors, int
failures, int skipped,
File testDir ) throws
MavenReportException {
- ITSuiteResults suite = parseTestResults( testDir );
+ ITSuiteResults suite = parseTestResults( new File[] { testDir } );
assertTestSuiteResults( total, errors, failures, skipped, suite );
}
public static ITSuiteResults parseTestResults( File testDir )
throws MavenReportException
{
+ return parseTestResults( new File[] { testDir } );
+ }
+
+ public static ITSuiteResults parseTestResults( File[] testDirs )
+ throws MavenReportException
+ {
SurefireReportParser parser = new SurefireReportParser();
- File reportsDir = new File( testDir, "target/surefire-reports" );
- Assert.assertTrue( "Reports directory is missing: " +
reportsDir.getAbsolutePath(), reportsDir.exists() );
- parser.setReportsDirectory( reportsDir );
+ File[] reportsDirs = new File[testDirs.length];
+ for ( int i = 0; i < testDirs.length; i++ )
+ {
+ File testDir = testDirs[i];
+ File reportsDir = new File( testDir, "target/surefire-reports" );
+ Assert.assertTrue( "Reports directory is missing: " +
reportsDir.getAbsolutePath(), reportsDir.exists() );
+ reportsDirs[i] = reportsDir;
+ }
+ parser.setReportsDirectories( reportsDirs );
List reports;
try {
reports = parser.parseXMLReportFiles();
} catch (Exception e) {
- throw new RuntimeException("Couldn't parse XML reports: " +
reportsDir.getAbsolutePath(), e);
+ throw new RuntimeException("Couldn't parse XML reports", e);
}
Assert.assertTrue( "No reports!", reports.size() > 0 );
int total = 0, errors = 0, failures = 0, skipped = 0;
for (int i = 0; i < reports.size(); i++) {
- ReportTestSuite suite = (ReportTestSuite) reports.get( 0 );
+ ReportTestSuite suite = (ReportTestSuite) reports.get( i );
total += suite.getNumberOfTests();
errors += suite.getNumberOfErrors();
failures += suite.getNumberOfFailures();
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/pom.xml
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/pom.xml?rev=598168&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/pom.xml
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/pom.xml
Mon Nov 26 00:50:02 2007
@@ -0,0 +1,48 @@
+<?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.plugins.surefire</groupId>
+ <artifactId>aggregate-child1</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>child1 for aggregate-reports</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+
+</project>
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/src/test/java/aggregateReport/FailingTest.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/src/test/java/aggregateReport/FailingTest.java?rev=598168&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/src/test/java/aggregateReport/FailingTest.java
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child1/src/test/java/aggregateReport/FailingTest.java
Mon Nov 26 00:50:02 2007
@@ -0,0 +1,14 @@
+package aggregateReport;
+
+import junit.framework.TestCase;
+
+public class FailingTest
+ extends TestCase
+{
+
+ public void testFailure()
+ {
+ fail( "This test is supposed to fail" );
+ }
+
+}
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/pom.xml
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/pom.xml?rev=598168&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/pom.xml
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/pom.xml
Mon Nov 26 00:50:02 2007
@@ -0,0 +1,48 @@
+<?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.plugins.surefire</groupId>
+ <artifactId>aggregate-child2</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>child2 for aggregate-reports</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+
+</project>
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/src/test/java/aggregateReport/BasicTest.java
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/src/test/java/aggregateReport/BasicTest.java?rev=598168&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/src/test/java/aggregateReport/BasicTest.java
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/child2/src/test/java/aggregateReport/BasicTest.java
Mon Nov 26 00:50:02 2007
@@ -0,0 +1,69 @@
+package aggregateReport;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class BasicTest
+ extends TestCase
+{
+
+ private boolean setUpCalled = false;
+
+ private static boolean tearDownCalled = false;
+
+ public BasicTest( String name, String extraName )
+ {
+ super( name );
+ }
+
+ public static Test suite()
+ {
+ System.out.println("suite");
+ TestSuite suite = new TestSuite();
+ Test test = new BasicTest( "testSetUp", "dummy" );
+ suite.addTest( test );
+ TestSetup setup = new TestSetup( suite )
+ {
+
+ protected void setUp()
+ {
+ //oneTimeSetUp();
+ }
+
+ protected void tearDown()
+ {
+ oneTimeTearDown();
+ }
+
+ };
+
+ return setup;
+ }
+
+ protected void setUp()
+ {
+ setUpCalled = true;
+ tearDownCalled = false;
+ System.out.println( "Called setUp" );
+ }
+
+ protected void tearDown()
+ {
+ setUpCalled = false;
+ tearDownCalled = true;
+ System.out.println( "Called tearDown" );
+ }
+
+ public void testSetUp()
+ {
+ assertTrue( "setUp was not called", setUpCalled );
+ }
+
+ public static void oneTimeTearDown()
+ {
+ assertTrue( "tearDown was not called", tearDownCalled );
+ }
+
+}
Added:
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/pom.xml
URL:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/pom.xml?rev=598168&view=auto
==============================================================================
---
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/pom.xml
(added)
+++
maven/surefire/trunk/surefire-integration-tests/src/test/resources/aggregate-report/pom.xml
Mon Nov 26 00:50:02 2007
@@ -0,0 +1,63 @@
+<?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.plugins.surefire</groupId>
+ <artifactId>aggregate-report</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Test for aggregate-report</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>child1</module>
+ <module>child2</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <testFailureIgnore>true</testFailureIgnore>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
\ No newline at end of file