You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2009/02/14 00:02:11 UTC
svn commit: r744276 - in /maven/plugins/trunk/maven-invoker-plugin: ./
src/it/invoker-report/ src/it/invoker-report/src/it/failed-one/
src/it/invoker-report/src/it/groovy/
src/main/java/org/apache/maven/plugin/invoker/ src/main/resources/
src/main/reso...
Author: olamy
Date: Fri Feb 13 23:02:07 2009
New Revision: 744276
URL: http://svn.apache.org/viewvc?rev=744276&view=rev
Log:
[MINVOKER-77] Add a invoker report mojo which display invoker its result
Added:
maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/ (props changed)
- copied from r743124, maven/plugins/trunk/maven-invoker-plugin/src/it/script-context/
maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/invoker.properties (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/
maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/invoker.properties (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/pom.xml (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/verify.bsh (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/groovy/invoker.properties (with props)
maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerReport.java (with props)
maven/plugins/trunk/maven-invoker-plugin/src/main/resources/
maven/plugins/trunk/maven-invoker-plugin/src/main/resources/META-INF/
maven/plugins/trunk/maven-invoker-plugin/src/main/resources/META-INF/maven/
maven/plugins/trunk/maven-invoker-plugin/src/main/resources/META-INF/maven/lifecycle.xml (with props)
maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report.properties (with props)
maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report_en.properties (with props)
Modified:
maven/plugins/trunk/maven-invoker-plugin/pom.xml
maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/pom.xml
maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/verify.bsh
maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
Modified: maven/plugins/trunk/maven-invoker-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/pom.xml?rev=744276&r1=744275&r2=744276&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-invoker-plugin/pom.xml Fri Feb 13 23:02:07 2009
@@ -52,6 +52,11 @@
<url>http://jira.codehaus.org/browse/MINVOKER</url>
</issueManagement>
+ <properties>
+ <doxiaVersion>1.0-alpha-11</doxiaVersion>
+ <doxia-sitetoolsVersion>1.0-alpha-11</doxia-sitetoolsVersion>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
@@ -84,6 +89,56 @@
<version>2.0.6</version>
</dependency>
<dependency>
+ <groupId>org.apache.maven.reporting</groupId>
+ <artifactId>maven-reporting-api</artifactId>
+ <version>2.0.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.reporting</groupId>
+ <artifactId>maven-reporting-impl</artifactId>
+ <version>2.0.4.1</version>
+ </dependency>
+
+ <!-- Doxia -->
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-core</artifactId>
+ <version>${doxiaVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-xhtml</artifactId>
+ <version>${doxiaVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-sink-api</artifactId>
+ <version>${doxiaVersion}</version>
+ </dependency>
+
+ <!-- Doxia-sitetools -->
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-decoration-model</artifactId>
+ <version>${doxia-sitetoolsVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-site-renderer</artifactId>
+ <version>${doxia-sitetoolsVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
<groupId>org.beanshell</groupId>
<artifactId>bsh</artifactId>
<version>2.0b4</version>
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/
------------------------------------------------------------------------------
svn:mergeinfo =
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/invoker.properties?rev=744276&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/invoker.properties (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/invoker.properties Fri Feb 13 23:02:07 2009
@@ -0,0 +1 @@
+invoker.goals = clean site
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/invoker.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/pom.xml?rev=744276&r1=743124&r2=744276&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/pom.xml (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/pom.xml Fri Feb 13 23:02:07 2009
@@ -35,7 +35,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
- <build>
+ <!--build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -62,6 +62,16 @@
</executions>
</plugin>
</plugins>
- </build>
+ </build-->
+ <reporting>
+ <excludeDefaults>true</excludeDefaults>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>@project.version@</version>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/invoker.properties?rev=744276&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/invoker.properties (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/invoker.properties Fri Feb 13 23:02:07 2009
@@ -0,0 +1,3 @@
+invoker.name= Failed
+invoker.description = failed Description
+invoker.goals = clean site
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/invoker.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/pom.xml?rev=744276&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/pom.xml Fri Feb 13 23:02:07 2009
@@ -0,0 +1,32 @@
+<?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>test</groupId>
+ <artifactId>groovy</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+</project>
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/verify.bsh?rev=744276&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/verify.bsh (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/verify.bsh Fri Feb 13 23:02:07 2009
@@ -0,0 +1 @@
+return false;
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/verify.bsh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/failed-one/verify.bsh
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/groovy/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/groovy/invoker.properties?rev=744276&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/groovy/invoker.properties (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/groovy/invoker.properties Fri Feb 13 23:02:07 2009
@@ -0,0 +1,2 @@
+invoker.name= Groovy It
+invoker.description = Groovy Description
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/groovy/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/groovy/invoker.properties
------------------------------------------------------------------------------
svn:executable = *
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/src/it/groovy/invoker.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/verify.bsh?rev=744276&r1=743124&r2=744276&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/verify.bsh (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invoker-report/verify.bsh Fri Feb 13 23:02:07 2009
@@ -1,21 +1,13 @@
import java.io.*;
import java.util.*;
-import java.util.regex.*;
-File touchFile;
+File reportFile = new File( basedir, "target/site/invoker-report.html");
-touchFile = new File( basedir, "src/it/beanshell/touch.txt" );
-System.out.println( "Checking for existence of touch file: " + touchFile );
-if ( !touchFile.exists() )
+System.out.println( "Checking for existence of report file: " + reportFile );
+if ( !reportFile.exists() )
{
- throw new FileNotFoundException( "Did not find marker file: " + touchFile );
+ System.out.println( "FAILED!" );
+ return false;
}
-touchFile = new File( basedir, "src/it/groovy/touch.txt" );
-System.out.println( "Checking for existence of touch file: " + touchFile );
-if ( !touchFile.exists() )
-{
- throw new FileNotFoundException( "Did not find marker file: " + touchFile );
-}
-
-return true;
+return true;
\ No newline at end of file
Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java?rev=744276&r1=744275&r2=744276&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java Fri Feb 13 23:02:07 2009
@@ -987,6 +987,7 @@
catch ( BuildFailureException e )
{
failures.add( project );
+ project.setType( e.getType() );
}
}
}
Added: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerReport.java?rev=744276&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerReport.java (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerReport.java Fri Feb 13 23:02:07 2009
@@ -0,0 +1,320 @@
+package org.apache.maven.plugin.invoker;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.siterenderer.Renderer;
+import org.apache.maven.plugin.invoker.model.BuildJob;
+import org.apache.maven.plugin.invoker.model.io.xpp3.BuildJobXpp3Reader;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.reporting.AbstractMavenReport;
+import org.apache.maven.reporting.MavenReportException;
+import org.codehaus.plexus.i18n.I18N;
+import org.codehaus.plexus.util.ReaderFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+/*
+ * 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.
+ */
+
+/**
+ * Generate a report based on the results of it tests.
+ * Fork an invoker:run
+ * @execute phase="test" lifecycle="invoker-report"
+ * @goal report
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @since 1.4
+ */
+public class InvokerReport
+ extends AbstractMavenReport
+{
+
+ /**
+ * The Maven Project.
+ *
+ * @parameter expression="${project}"
+ * @required
+ * @readonly
+ */
+ protected MavenProject project;
+
+ /**
+ * Doxia Site Renderer component.
+ *
+ * @component
+ */
+ protected Renderer siteRenderer;
+
+ /**
+ * Internationalization component.
+ *
+ * @component
+ */
+ protected I18N i18n;
+
+ /**
+ * The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from
+ * the command line. If the goal is run indirectly as part of a site generation, the output directory configured in
+ * the Maven Site Plugin is used instead.
+ *
+ * @parameter expression="${project.reporting.outputDirectory}"
+ * @required
+ */
+ protected File outputDirectory;
+
+ /**
+ * Base directory where all build reports are written to.
+ *
+ * @parameter expression="${invoker.reportsDirectory}" default-value="${project.build.directory}/invoker-reports"
+ */
+ private File reportsDirectory;
+
+ protected void executeReport( Locale locale )
+ throws MavenReportException
+ {
+ Sink sink = getSink();
+ sink.section1();
+ sink.sectionTitle1();
+ sink.text( i18n.getString( "invoker-report", locale, "report.invoker.result.title" ) );
+ sink.sectionTitle1_();
+ sink.section1_();
+
+ // ----------------------------------
+ // build buildJob beans
+ // ----------------------------------
+ File[] reportFiles = reportsDirectory.listFiles();
+ if ( reportFiles == null || reportFiles.length < 1 )
+ {
+ getLog().info( "no invoker report files found, skip report generation" );
+ return;
+ }
+ List buildJobs = new ArrayList( reportFiles.length );
+ try
+ {
+ for ( int i = 0, size = reportFiles.length; i < size; i++ )
+ {
+ BuildJobXpp3Reader reader = new BuildJobXpp3Reader();
+ buildJobs.add( reader.read( ReaderFactory.newXmlReader( reportFiles[i] ) ) );
+ }
+ }
+ catch ( XmlPullParserException e )
+ {
+ throw new MavenReportException( e.getMessage(), e );
+ }
+ catch ( IOException e )
+ {
+ throw new MavenReportException( e.getMessage(), e );
+ }
+
+ // ----------------------------------
+ // summary
+ // ----------------------------------
+
+ constructSummarySection( buildJobs, locale );
+
+ // ----------------------------------
+ // per file/it detail
+ // ----------------------------------
+
+ sink.section1();
+ sink.sectionTitle1();
+
+ sink.text( i18n.getString( "invoker-report", locale, "report.invoker.detail.title" ));
+
+ sink.sectionTitle1_();
+
+ sink.section1_();
+
+ // detail tests table header
+ sink.table();
+
+ sink.tableRow();
+ // -------------------------------------------
+ // name | Result | time | message
+ // -------------------------------------------
+ sinkTableHeader( sink, getText( locale, "report.invoker.detail.name") );
+ sinkTableHeader( sink, getText( locale, "report.invoker.detail.result") );
+ sinkTableHeader( sink, getText( locale, "report.invoker.detail.time") );
+ sinkTableHeader( sink, getText( locale, "report.invoker.detail.message") );
+
+ sink.tableRow_();
+
+
+ for ( Iterator iterator = buildJobs.iterator(); iterator.hasNext(); )
+ {
+ BuildJob buildJob = (BuildJob) iterator.next();
+ renderBuildJob( buildJob, locale );
+ }
+
+ sink.table_();
+
+ sink.flush();
+ sink.close();
+ }
+
+ protected void constructSummarySection( List /* BuildJob */ buildJobs, Locale locale )
+ {
+ Sink sink = getSink();
+
+ sink.section1();
+ sink.sectionTitle1();
+
+ sink.text( i18n.getString( "invoker-report", locale, "report.invoker.summary.title" ));
+
+ sink.sectionTitle1_();
+ sink.section1_();
+
+ // ------------------------------------------------------------------------
+ // Building a table with
+ // it number | succes nb | failed nb | Success rate | total time | avg time
+ // ------------------------------------------------------------------------
+
+ sink.table();
+ sink.tableRow();
+
+ sinkTableHeader(sink, getText( locale, "report.invoker.summary.number" ));
+ sinkTableHeader(sink, getText( locale, "report.invoker.summary.success" ));
+ sinkTableHeader(sink, getText( locale, "report.invoker.summary.failed" ));
+ sinkTableHeader(sink, getText( locale, "report.invoker.summary.success.rate" ));
+ sinkTableHeader(sink, getText( locale, "report.invoker.summary.time.total" ));
+ sinkTableHeader(sink, getText( locale, "report.invoker.summary.time.avg" ));
+
+ int number = buildJobs.size();
+ int success = 0;
+ int failed = 0;
+ double totalTime = 0;
+
+ for (Iterator iterator = buildJobs.iterator(); iterator.hasNext();)
+ {
+ BuildJob buildJob = (BuildJob) iterator.next();
+ totalTime += buildJob.getTime();
+ }
+
+ sink.tableRow_();
+ sink.tableRow();
+
+ sinkCell( sink, Integer.toString( number ) );
+ sinkCell( sink, Integer.toString( success ) );
+ sinkCell( sink, Integer.toString( failed ) );
+
+ if ( number > 0 )
+ {
+ sinkCell( sink, Integer.toString( ( success * 100 ) / number ) );
+ }
+ else
+ {
+ sinkCell( sink, "N/A" );
+ }
+
+ sinkCell( sink, Double.toString( totalTime ) );
+
+ sinkCell( sink, Double.toString( totalTime / number ) );
+
+ sink.tableRow_();
+ sink.table_();
+
+ }
+
+ protected void renderBuildJob(BuildJob buildJob, Locale locale)
+ {
+ Sink sink = getSink();
+ sink.tableRow();
+ StringBuffer buffer = new StringBuffer();
+ if ( !StringUtils.isEmpty( buildJob.getName() ) && !StringUtils.isEmpty( buildJob.getDescription() ) )
+ {
+ buffer.append( buildJob.getName() );
+ buffer.append( " : " );
+ buffer.append( buildJob.getDescription() );
+ }
+ else
+ {
+ buffer.append( buildJob.getProject() );
+ }
+ sinkCell( sink, buffer.toString() );
+ // FIXME image
+ sinkCell( sink, buildJob.getType() );
+ sinkCell( sink, Double.toString( buildJob.getTime() ) );
+ sinkCell( sink, buildJob.getFailureMessage() );
+ sink.tableRow_();
+
+ }
+
+ protected String getOutputDirectory()
+ {
+ return outputDirectory.getAbsolutePath();
+ }
+
+ protected MavenProject getProject()
+ {
+ return project;
+ }
+
+ protected Renderer getSiteRenderer()
+ {
+ return siteRenderer;
+ }
+
+ public String getDescription( Locale locale )
+ {
+ return i18n.getString( "invoker-report", locale, "report.invoker.result.description" );
+ }
+
+ public String getName( Locale locale )
+ {
+ return i18n.getString( "invoker-report", locale, "report.invoker.result.name" );
+ }
+
+ public String getOutputName()
+ {
+ return "invoker-report";
+ }
+
+ public boolean canGenerateReport()
+ {
+ if ( reportsDirectory == null )
+ {
+ return false;
+ }
+ return reportsDirectory.exists() && reportsDirectory.listFiles().length > 0;
+ }
+
+ private String getText( Locale locale, String key )
+ {
+ return i18n.getString( "invoker-report", locale, key );
+ }
+
+ private void sinkTableHeader( Sink sink, String header )
+ {
+ sink.tableHeaderCell();
+ sink.text( header );
+ sink.tableHeaderCell_();
+ }
+
+ private void sinkCell( Sink sink, String text )
+ {
+ sink.tableCell();
+ sink.text( text );
+ sink.tableCell_();
+ }
+}
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerReport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerReport.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/main/resources/META-INF/maven/lifecycle.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/resources/META-INF/maven/lifecycle.xml?rev=744276&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/resources/META-INF/maven/lifecycle.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/resources/META-INF/maven/lifecycle.xml Fri Feb 13 23:02:07 2009
@@ -0,0 +1,22 @@
+<lifecycles>
+ <lifecycle>
+ <id>invoker-report</id>
+ <phases>
+ <phase>
+ <id>test</id>
+ <executions>
+ <execution>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <ignoreFailures>true</ignoreFailures>
+ <disableReports>false</disableReports>
+ </configuration>
+ </execution>
+ </executions>
+ </phase>
+ </phases>
+ </lifecycle>
+</lifecycles>
+
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/main/resources/META-INF/maven/lifecycle.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/main/resources/META-INF/maven/lifecycle.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report.properties?rev=744276&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report.properties (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report.properties Fri Feb 13 23:02:07 2009
@@ -0,0 +1,31 @@
+# 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.
+report.invoker.result.description = Generate a report based on the results of it tests.
+report.invoker.result.name = Invoker Tests Results
+report.invoker.result.title = Invoker Report
+report.invoker.summary.title = Summary
+report.invoker.summary.number = Tests
+report.invoker.summary.success = Success
+report.invoker.summary.failed = Failures
+report.invoker.summary.success.rate = Success Rate
+report.invoker.summary.time.total = Total Time
+report.invoker.summary.time.avg = Avg Time
+report.invoker.detail.title = Tests Details
+report.invoker.detail.name = Name
+report.invoker.detail.result = Result
+report.invoker.detail.time = Time
+report.invoker.detail.message = Message
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report_en.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report_en.properties?rev=744276&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report_en.properties (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report_en.properties Fri Feb 13 23:02:07 2009
@@ -0,0 +1,23 @@
+# 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.
+
+# NOTE:
+# This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It
+# must be provided nevertheless such that a request for locale "en" will not errorneously pick up the bundle for the
+# JVM's default locale (which need not be "en"). See the method javadoc about
+# ResourceBundle.getBundle(String, Locale, ClassLoader)
+# for a full description of the lookup strategy.
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report_en.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/main/resources/invoker-report_en.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision