Repository: maven-surefire Updated Branches: refs/heads/UnicodeTestNamesIT 807b41401 -> 09e9a904d (forced update)
[SUREFIRE-1183] Custom Test Report Titles and Descriptions Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/7a33fd67 Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/7a33fd67 Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/7a33fd67 Branch: refs/heads/UnicodeTestNamesIT Commit: 7a33fd67b066908ef4aad6eb044c40eb4fe29482 Parents: 2f16bc7 Author: Gerald M??cke <ger...@inkstand.io> Authored: Tue Oct 13 21:47:05 2015 +0200 Committer: Tibor17 <tibordig...@apache.org> Committed: Sun Jan 7 21:42:46 2018 +0100 ---------------------------------------------------------------------- .../report/AbstractSurefireReportMojo.java | 19 +- .../surefire/report/FailsafeReportMojo.java | 49 ++++- .../report/SurefireReportGenerator.java | 18 +- .../surefire/report/SurefireReportMojo.java | 40 +++- .../surefire/report/SurefireReportOnlyMojo.java | 2 + .../surefire/report/Surefire1183Test.java | 122 +++++++++++ .../TEST-com.shape.CircleTest.xml | 200 +++++++++++++++++++ .../resources/surefire-1183/plugin-config.xml | 39 ++++ 8 files changed, 477 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7a33fd67/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java ---------------------------------------------------------------------- diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java index ab27b18..b6d4a9d 100644 --- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java +++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java @@ -36,6 +36,7 @@ import org.apache.maven.shared.utils.PathTool; import static java.util.Collections.addAll; import static org.apache.maven.plugins.surefire.report.SurefireReportParser.hasReportFiles; import static org.apache.maven.shared.utils.StringUtils.isEmpty; +import static org.apache.maven.shared.utils.StringUtils.isNotEmpty; /** * Abstract base class for reporting test results using Surefire. @@ -114,6 +115,14 @@ public abstract class AbstractSurefireReportMojo return false; } + public abstract void setTitle( String title ); + + public abstract String getTitle(); + + public abstract void setDescription( String description ); + + public abstract String getDescription(); + /** * {@inheritDoc} */ @@ -127,7 +136,7 @@ public abstract class AbstractSurefireReportMojo } new SurefireReportGenerator( getReportsDirectories(), locale, showSuccess, determineXrefLocation(), - getConsoleLogger() ) + getConsoleLogger(), isNotEmpty( getTitle() ) ? getTitle() : null ) .doGenerateReport( getBundle( locale ), getSink() ); } @@ -302,7 +311,9 @@ public abstract class AbstractSurefireReportMojo @Override public String getName( Locale locale ) { - return getBundle( locale ).getString( "report.surefire.name" ); + return isEmpty( getTitle() ) + ? getBundle( locale ).getString( "report.surefire.name" ) + : getTitle(); } /** @@ -311,7 +322,9 @@ public abstract class AbstractSurefireReportMojo @Override public String getDescription( Locale locale ) { - return getBundle( locale ).getString( "report.surefire.description" ); + return isEmpty( getDescription() ) + ? getBundle( locale ).getString( "report.surefire.description" ) + : getDescription(); } /** http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7a33fd67/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/FailsafeReportMojo.java ---------------------------------------------------------------------- diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/FailsafeReportMojo.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/FailsafeReportMojo.java index c8fca02..2dd7f2d 100644 --- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/FailsafeReportMojo.java +++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/FailsafeReportMojo.java @@ -26,6 +26,7 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; +import static org.apache.maven.shared.utils.StringUtils.isEmpty; /** * Creates a nicely formatted Failsafe Test Report in html format. @@ -37,6 +38,7 @@ import org.apache.maven.project.MavenProject; * @since 2.10 */ @Mojo( name = "failsafe-report-only" ) +@SuppressWarnings( "unused" ) public class FailsafeReportMojo extends AbstractSurefireReportMojo { @@ -62,6 +64,20 @@ public class FailsafeReportMojo @Parameter( defaultValue = "false", property = "skipFailsafeReport" ) private boolean skipFailsafeReport; + /** + * A custom title of the report for the menu and the project reports page. + * @since 2.21.0 + */ + @Parameter( defaultValue = "", property = "failsafe.report.title" ) + private String title; + + /** + * A custom description for the project reports page. + * @since 2.21.0 + */ + @Parameter( defaultValue = "", property = "failsafe.report.description" ) + private String description; + @Override protected File getSurefireReportsDirectory( MavenProject subProject ) { @@ -87,13 +103,39 @@ public class FailsafeReportMojo return alwaysGenerateFailsafeReport; } + @Override + public void setTitle( String title ) + { + this.title = title; + } + + @Override + public String getTitle() + { + return title; + } + + @Override + public void setDescription( String description ) + { + this.description = description; + } + + @Override + public String getDescription() + { + return description; + } + /** * {@inheritDoc} */ @Override public String getName( Locale locale ) { - return getBundle( locale ).getString( "report.failsafe.name" ); + return isEmpty( getTitle() ) + ? getBundle( locale ).getString( "report.failsafe.name" ) + : getTitle(); } /** @@ -102,10 +144,11 @@ public class FailsafeReportMojo @Override public String getDescription( Locale locale ) { - return getBundle( locale ).getString( "report.failsafe.description" ); + return isEmpty( getDescription() ) + ? getDescription() + : getBundle( locale ).getString( "report.failsafe.description" ); } - /* * This is currently a copy of the getBundle() method of the AbstractSurefireReportMojo class, * cause the failsafe report only different in two names for the bundles. http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7a33fd67/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java ---------------------------------------------------------------------- diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java index 530398c..5929f79 100644 --- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java +++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportGenerator.java @@ -40,9 +40,10 @@ import static org.apache.maven.doxia.sink.SinkEventAttributes.ID; import static org.apache.maven.doxia.sink.SinkEventAttributes.NAME; import static org.apache.maven.doxia.sink.SinkEventAttributes.STYLE; import static org.apache.maven.doxia.sink.SinkEventAttributes.TYPE; +import static org.apache.maven.shared.utils.StringUtils.isEmpty; /** - * + * This generator creates HTML Report from Surefire and Failsafe XML Report. */ public final class SurefireReportGenerator { @@ -57,15 +58,22 @@ public final class SurefireReportGenerator private final boolean showSuccess; private final String xrefLocation; - + private final String title; private List<ReportTestSuite> testSuites; public SurefireReportGenerator( List<File> reportsDirectories, Locale locale, boolean showSuccess, - String xrefLocation, ConsoleLogger consoleLogger ) + String xrefLocation, ConsoleLogger consoleLogger, String title ) { report = new SurefireReportParser( reportsDirectories, locale, consoleLogger ); this.showSuccess = showSuccess; this.xrefLocation = xrefLocation; + this.title = title; + } + + public SurefireReportGenerator( List<File> reportsDirectories, Locale locale, boolean showSuccess, + String xrefLocation, ConsoleLogger consoleLogger ) + { + this( reportsDirectories, locale, showSuccess, xrefLocation, consoleLogger, null ); } public void doGenerateReport( ResourceBundle bundle, Sink sink ) @@ -76,7 +84,7 @@ public final class SurefireReportGenerator sink.head(); sink.title(); - sink.text( bundle.getString( "report.surefire.header" ) ); + sink.text( isEmpty( title ) ? bundle.getString( "report.surefire.header" ) : title ); sink.title_(); sink.head_(); @@ -91,7 +99,7 @@ public final class SurefireReportGenerator sink.section1(); sink.sectionTitle1(); - sink.text( bundle.getString( "report.surefire.header" ) ); + sink.text( isEmpty( title ) ? bundle.getString( "report.surefire.header" ) : title ); sink.sectionTitle1_(); sink.section1_(); http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7a33fd67/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportMojo.java ---------------------------------------------------------------------- diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportMojo.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportMojo.java index 906feb9..2329095 100644 --- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportMojo.java +++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportMojo.java @@ -26,7 +26,6 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; - /** * Creates a nicely formatted Surefire Test Report in html format. * @@ -34,6 +33,7 @@ import org.apache.maven.project.MavenProject; */ @Mojo( name = "report", inheritByDefault = false ) @Execute( lifecycle = "surefire", phase = LifecyclePhase.TEST ) +@SuppressWarnings( "unused" ) public class SurefireReportMojo extends AbstractSurefireReportMojo { @@ -59,6 +59,20 @@ public class SurefireReportMojo @Parameter( defaultValue = "false", property = "skipSurefireReport" ) private boolean skipSurefireReport; + /** + * A custom title of the report for the menu and the project reports page. + * @since 2.21.0 + */ + @Parameter( defaultValue = "", property = "surefire.report.title" ) + private String title; + + /** + * A custom description for the project reports page. + * @since 2.21.0 + */ + @Parameter( defaultValue = "", property = "surefire.report.description" ) + private String description; + @Override protected File getSurefireReportsDirectory( MavenProject subProject ) { @@ -83,4 +97,28 @@ public class SurefireReportMojo { return alwaysGenerateSurefireReport; } + + @Override + public void setTitle( String title ) + { + this.title = title; + } + + @Override + public String getTitle() + { + return title; + } + + @Override + public void setDescription( String description ) + { + this.description = description; + } + + @Override + public String getDescription() + { + return description; + } } http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7a33fd67/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportOnlyMojo.java ---------------------------------------------------------------------- diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportOnlyMojo.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportOnlyMojo.java index b443439..4a2f2bd 100644 --- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportOnlyMojo.java +++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportOnlyMojo.java @@ -34,7 +34,9 @@ import org.apache.maven.plugins.annotations.Mojo; */ @Mojo( name = "report-only" ) @Execute( phase = LifecyclePhase.NONE ) +@SuppressWarnings( "unused" ) public class SurefireReportOnlyMojo extends SurefireReportMojo { + } http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7a33fd67/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire1183Test.java ---------------------------------------------------------------------- diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire1183Test.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire1183Test.java new file mode 100644 index 0000000..7a47e16 --- /dev/null +++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire1183Test.java @@ -0,0 +1,122 @@ +/* + * 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. + */ + +package org.apache.maven.plugins.surefire.report; + +import org.apache.maven.doxia.site.decoration.DecorationModel; +import org.apache.maven.doxia.siterenderer.Renderer; +import org.apache.maven.doxia.siterenderer.RendererException; +import org.apache.maven.doxia.siterenderer.SiteRenderingContext; +import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink; +import org.apache.maven.plugin.testing.AbstractMojoTestCase; +import org.apache.maven.shared.utils.WriterFactory; +import org.apache.maven.shared.utils.io.FileUtils; +import org.apache.maven.shared.utils.io.IOUtil; + +import java.io.File; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.io.Writer; +import java.net.URL; +import java.net.URLDecoder; +import java.util.Locale; + +/** + * Prevent fom NPE if failure type and message is null however detail presents. + */ +public class Surefire1183Test extends AbstractMojoTestCase +{ + private Renderer renderer; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + renderer = (Renderer) lookup( Renderer.ROLE ); + } + + private File getTestBaseDir() + throws UnsupportedEncodingException + { + URL resource = getClass().getResource( "/surefire-1183" ); + // URLDecoder.decode necessary for JDK 1.5+, where spaces are escaped to %20 + return new File( URLDecoder.decode ( resource.getPath(), "UTF-8" ) ).getAbsoluteFile(); + } + + /** + * Renderer the sink from the report mojo. + * + * @param mojo not null + * @param outputHtml not null + * @throws RendererException if any + * @throws IOException if any + */ + private void renderer( SurefireReportMojo mojo, File outputHtml ) + throws RendererException, IOException + { + Writer writer = null; + SiteRenderingContext context = new SiteRenderingContext(); + context.setDecoration( new DecorationModel() ); + context.setTemplateName( "org/apache/maven/doxia/siterenderer/resources/default-site.vm" ); + context.setLocale( Locale.ENGLISH ); + + try + { + outputHtml.getParentFile().mkdirs(); + writer = WriterFactory.newXmlWriter ( outputHtml ); + + renderer.generateDocument( writer, (SiteRendererSink ) mojo.getSink(), context ); + } + finally + { + IOUtil.close ( writer ); + } + } + + public void testCustomTitleAndDescriptionReport() + throws Exception + { + File testPom = new File( getTestBaseDir(), "plugin-config.xml" ); + SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); + + File outputDir = (File) getVariableValueFromObject( mojo, "outputDirectory" ); + String outputName = (String) getVariableValueFromObject( mojo, "outputName" ); + File reportsDir = (File) getVariableValueFromObject( mojo, "reportsDirectory" ); + String title = (String) getVariableValueFromObject( mojo, "title" ); + String description = (String) getVariableValueFromObject( mojo, "description" ); + + assertEquals( new File( getBasedir() + "/target/site/surefire-1183" ), outputDir ); + assertEquals( new File( getBasedir() + "/src/test/resources/surefire-1183/acceptancetest-reports" ) + .getAbsolutePath(), reportsDir.getAbsolutePath() ); + assertEquals( "acceptance-test-report", outputName ); + assertEquals( "Acceptance Test", title ); + assertEquals( "Acceptance Test Description", description ); + + mojo.execute(); + + File report = new File( getBasedir(), "target/site/acceptance-test-report.html" ); + renderer( mojo, report ); + + assertTrue( report.exists() ); + + String htmlContent = FileUtils.fileRead ( report ); + assertTrue( htmlContent.contains ( "<h2><a name=\"Acceptance_Test\"></a>Acceptance Test</h2></div>" ) ); + } +} http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7a33fd67/maven-surefire-report-plugin/src/test/resources/surefire-1183/acceptancetest-reports/TEST-com.shape.CircleTest.xml ---------------------------------------------------------------------- diff --git a/maven-surefire-report-plugin/src/test/resources/surefire-1183/acceptancetest-reports/TEST-com.shape.CircleTest.xml b/maven-surefire-report-plugin/src/test/resources/surefire-1183/acceptancetest-reports/TEST-com.shape.CircleTest.xml new file mode 100644 index 0000000..1ce1d3d --- /dev/null +++ b/maven-surefire-report-plugin/src/test/resources/surefire-1183/acceptancetest-reports/TEST-com.shape.CircleTest.xml @@ -0,0 +1,200 @@ +<?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. + --> + +<testsuite errors="1" tests="8" time="0.201" failures="1" name="com.shape.CircleTest"> + <properties> + <property value="Java(TM) 2 Runtime Environment, Standard Edition" name="java.runtime.name"/> + <property value="c:\japps\jdk1.5.0_04\jre\bin" name="sun.boot.library.path"/> + <property value="1.5.0_04-b05" name="java.vm.version"/> + <property value="Sun Microsystems Inc." name="java.vm.vendor"/> + <property value="http://java.sun.com/" name="java.vendor.url"/> + <property value=";" name="path.separator"/> + <property value="Java HotSpot(TM) Client VM" name="java.vm.name"/> + <property value="sun.io" name="file.encoding.pkg"/> + <property value="US" name="user.country"/> + <property value="Service Pack 2" name="sun.os.patch.level"/> + <property value="Java Virtual Machine Specification" name="java.vm.specification.name"/> + <property value="C:\JAppsCode\mergere-maven\plugins\sample-projects\junit-report-tester" name="user.dir"/> + <property value="1.5.0_04-b05" name="java.runtime.version"/> + <property value="sun.awt.Win32GraphicsEnvironment" name="java.awt.graphicsenv"/> + <property value="C:\JAppsCode\mergere-maven\plugins\sample-projects\junit-report-tester" name="basedir"/> + <property value="c:\japps\jdk1.5.0_04\jre\lib\endorsed" name="java.endorsed.dirs"/> + <property value="x86" name="os.arch"/> + <property value="C:\DOCUME~1\Jontri\LOCALS~1\Temp\" name="java.io.tmpdir"/> + <property value=" +" name="line.separator"/> + <property value="Sun Microsystems Inc." name="java.vm.specification.vendor"/> + <property value="" name="user.variant"/> + <property value="Windows XP" name="os.name"/> + <property value="C:\JApps\maven-2.0-beta-1\bin\m2.conf" name="classworlds.conf"/> + <property value="Cp1252" name="sun.jnu.encoding"/> + <property + value="c:\japps\jdk1.5.0_04\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\JApps\maven-2.0-beta-1\bin;C:\JApps\maven-1.0.2\bin;c:\BatchFile;C:\Program Files\cvsnt;C:\JApps\svn-1.1.4\bin;C:\JApps\ant-1.6.2\bin;" + name="java.library.path"/> + <property value="Java Platform API Specification" name="java.specification.name"/> + <property value="49.0" name="java.class.version"/> + <property value="HotSpot Client Compiler" name="sun.management.compiler"/> + <property value="5.1" name="os.version"/> + <property value="C:\Documents and Settings\Jontri" name="user.home"/> + <property value="Asia/Shanghai" name="user.timezone"/> + <property value="sun.awt.windows.WPrinterJob" name="java.awt.printerjob"/> + <property value="Cp1252" name="file.encoding"/> + <property value="1.5" name="java.specification.version"/> + <property value="Jontri" name="user.name"/> + <property value="C:\JApps\maven-2.0-beta-1\core\boot\classworlds-1.1-alpha-2.jar" name="java.class.path"/> + <property value="1.0" name="java.vm.specification.version"/> + <property value="32" name="sun.arch.data.model"/> + <property value="c:\japps\jdk1.5.0_04\jre" name="java.home"/> + <property value="Sun Microsystems Inc." name="java.specification.vendor"/> + <property value="en" name="user.language"/> + <property value="sun.awt.windows.WToolkit" name="awt.toolkit"/> + <property value="mixed mode, sharing" name="java.vm.info"/> + <property value="1.5.0_04" name="java.version"/> + <property value="c:\japps\jdk1.5.0_04\jre\lib\ext" name="java.ext.dirs"/> + <property + value="c:\japps\jdk1.5.0_04\jre\lib\rt.jar;c:\japps\jdk1.5.0_04\jre\lib\i18n.jar;c:\japps\jdk1.5.0_04\jre\lib\sunrsasign.jar;c:\japps\jdk1.5.0_04\jre\lib\jsse.jar;c:\japps\jdk1.5.0_04\jre\lib\jce.jar;c:\japps\jdk1.5.0_04\jre\lib\charsets.jar;c:\japps\jdk1.5.0_04\jre\classes" + name="sun.boot.class.path"/> + <property value="Sun Microsystems Inc." name="java.vendor"/> + <property value="C:\JApps\maven-2.0-beta-1" name="maven.home"/> + <property value="C:\Documents and Settings\Jontri\.m2\repository" name="localRepository"/> + <property value="\" name="file.separator"/> + <property value="http://java.sun.com/cgi-bin/bugreport.cgi" name="java.vendor.url.bug"/> + <property value="little" name="sun.cpu.endian"/> + <property value="UnicodeLittle" name="sun.io.unicode.encoding"/> + <property value="windows" name="sun.desktop"/> + <property value="pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86" name="sun.cpu.isalist"/> + </properties> + <testcase time="0.01" name="testX"/> + <testcase time="0" name="testY"/> + <testcase time="0" name="testXY"/> + <testcase time="0.01" name="testRadius"> + <failure type="junit.framework.AssertionFailedError" message="expected:<20> but was:<10>"> + junit.framework.AssertionFailedError: expected:<20> but was:<10> + at junit.framework.Assert.fail(Assert.java:47) + at junit.framework.Assert.failNotEquals(Assert.java:282) + at junit.framework.Assert.assertEquals(Assert.java:64) + at junit.framework.Assert.assertEquals(Assert.java:201) + at junit.framework.Assert.assertEquals(Assert.java:207) + at com.shape.CircleTest.testRadius(CircleTest.java:34) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:585) + at junit.framework.TestCase.runTest(TestCase.java:154) + at junit.framework.TestCase.runBare(TestCase.java:127) + at junit.framework.TestResult$1.protect(TestResult.java:106) + at junit.framework.TestResult.runProtected(TestResult.java:124) + at junit.framework.TestResult.run(TestResult.java:109) + at junit.framework.TestCase.run(TestCase.java:118) + at junit.framework.TestSuite.runTest(TestSuite.java:208) + at junit.framework.TestSuite.run(TestSuite.java:203) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:585) + at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) + at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) + at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) + at org.codehaus.surefire.Surefire.run(Surefire.java:152) + at org.codehaus.surefire.Surefire.run(Surefire.java:76) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:585) + at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) + at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) + at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) + at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) + at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:585) + at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) + at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) + at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) + at org.codehaus.classworlds.Launcher.main(Launcher.java:375) + </failure> + <system-out>[OUT] : Getting the diameter + </system-out> + <system-err>[ERR] : Getting the Circumference + </system-err> + </testcase> + <testcase time="0.02" name="testProperties"> + <error type="java.lang.ArithmeticException" message="/ by zero">java.lang.ArithmeticException: / by zero + at com.shape.CircleTest.testProperties(CircleTest.java:44) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:585) + at junit.framework.TestCase.runTest(TestCase.java:154) + at junit.framework.TestCase.runBare(TestCase.java:127) + at junit.framework.TestResult$1.protect(TestResult.java:106) + at junit.framework.TestResult.runProtected(TestResult.java:124) + at junit.framework.TestResult.run(TestResult.java:109) + at junit.framework.TestCase.run(TestCase.java:118) + at junit.framework.TestSuite.runTest(TestSuite.java:208) + at junit.framework.TestSuite.run(TestSuite.java:203) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:585) + at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) + at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) + at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) + at org.codehaus.surefire.Surefire.run(Surefire.java:152) + at org.codehaus.surefire.Surefire.run(Surefire.java:76) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:585) + at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) + at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) + at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) + at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) + at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) + at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:585) + at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) + at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) + at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) + at org.codehaus.classworlds.Launcher.main(Launcher.java:375) + </error> + <system-out>[OUT] : Getting the diameter + </system-out> + <system-err>[ERR] : Getting the Circumference + </system-err> + </testcase> + <testcase time="0" name="testPI"/> + <testcase time="0.01" name="testCircumference"/> + <testcase time="0" name="testDiameter"/> +</testsuite> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/7a33fd67/maven-surefire-report-plugin/src/test/resources/surefire-1183/plugin-config.xml ---------------------------------------------------------------------- diff --git a/maven-surefire-report-plugin/src/test/resources/surefire-1183/plugin-config.xml b/maven-surefire-report-plugin/src/test/resources/surefire-1183/plugin-config.xml new file mode 100644 index 0000000..fe129e4 --- /dev/null +++ b/maven-surefire-report-plugin/src/test/resources/surefire-1183/plugin-config.xml @@ -0,0 +1,39 @@ +<!-- + ~ 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> + + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-report-plugin</artifactId> + <configuration> + <project + implementation="org.apache.maven.plugins.surefire.report.stubs.SurefireRepMavenProjectStub"/> + <title>Acceptance Test</title> + <description>Acceptance Test Description</description> + <outputName>acceptance-test-report</outputName> + <outputDirectory>${basedir}/target/site/surefire-1183</outputDirectory> + <reportsDirectory>${basedir}/src/test/resources/surefire-1183/acceptancetest-reports + </reportsDirectory> + </configuration> + </plugin> + </plugins> + </build> +</project>