You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kr...@apache.org on 2012/12/06 20:16:44 UTC
[1/6] git commit: o Reformatted entire code base to code style
Updated Branches:
refs/heads/master 00e31e5a8 -> a303827d6
o Reformatted entire code base to code style
Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/a303827d
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/a303827d
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/a303827d
Branch: refs/heads/master
Commit: a303827d673a4821e2c7aadd8e54eab1171c070c
Parents: 00e31e5
Author: Kristian Rosenvold <kr...@apache.org>
Authored: Thu Dec 6 20:13:31 2012 +0100
Committer: Kristian Rosenvold <kr...@apache.org>
Committed: Thu Dec 6 20:13:31 2012 +0100
----------------------------------------------------------------------
maven-failsafe-plugin/pom.xml | 3 +-
.../src/it/multiple-summaries-failing/pom.xml | 70 +-
.../src/it/multiple-summaries/pom.xml | 60 +-
.../maven/plugin/failsafe/IntegrationTestMojo.java | 21 +-
.../apache/maven/plugin/failsafe/VerifyMojo.java | 12 +-
.../plugin/surefire/AbstractSurefireMojo.java | 45 +-
.../maven/plugin/surefire/ClasspathCache.java | 8 +-
.../plugin/surefire/InPluginVMSurefireStarter.java | 1 -
.../surefire/StartupReportConfiguration.java | 2 +-
.../maven/plugin/surefire/SurefireHelper.java | 12 +-
.../maven/plugin/surefire/SurefireProperties.java | 8 +-
.../surefire/booterclient/BooterSerializer.java | 14 +-
.../surefire/booterclient/ForkConfiguration.java | 26 +-
.../plugin/surefire/booterclient/ForkStarter.java | 10 +-
.../lazytestprovider/FlushReceiver.java | 19 +-
.../lazytestprovider/FlushReceiverProvider.java | 14 +-
.../OutputStreamFlushableCommandline.java | 77 +-
.../lazytestprovider/TestProvidingInputStream.java | 126 ++--
.../surefire/booterclient/output/ForkClient.java | 22 +-
.../surefire/report/ConsoleOutputFileReporter.java | 11 +-
.../plugin/surefire/report/ConsoleReporter.java | 5 +-
.../surefire/report/DefaultReporterFactory.java | 3 +-
.../surefire/report/DirectConsoleOutput.java | 4 +-
.../maven/plugin/surefire/report/FileReporter.java | 5 +-
.../surefire/report/PrettyPrintXMLWriter.java | 6 +-
.../surefire/report/StatelessXmlReporter.java | 13 +-
.../plugin/surefire/report/TestSetRunListener.java | 17 +-
.../report/TestcycleConsoleOutputReceiver.java | 5 +-
.../plugin/surefire/report/WrappedReportEntry.java | 33 +-
.../surefire/runorder/StatisticsReporter.java | 5 +-
.../maven/surefire/report/RunStatistics.java | 5 +-
...ooterDeserializerProviderConfigurationTest.java | 67 +-
...BooterDeserializerStartupConfigurationTest.java | 10 +-
.../booterclient/ForkConfigurationTest.java | 15 +-
.../booterclient/ForkingRunListenerTest.java | 16 +-
.../surefire/report/StatelessXMLReporterTest.java | 5 +-
.../surefire/report/WrappedReportEntryTest.java | 6 +-
.../runorder/RunEntryStatisticsMapTest.java | 2 +-
.../report/ConsoleOutputFileReporterTest.java | 4 +-
.../maven/surefire/report/FileReporterTest.java | 6 +-
maven-surefire-plugin/pom.xml | 3 +-
maven-surefire-plugin/src/assembly/site-source.xml | 5 +-
.../maven/plugin/surefire/SurefirePlugin.java | 5 +-
maven-surefire-plugin/src/site/apt/api.apt.vm | 105 ++-
.../src/site/apt/developing.apt.vm | 148 ++--
.../src/site/apt/examples/class-loading.apt.vm | 414 +++++----
.../site/apt/examples/configuring-classpath.apt.vm | 251 +++---
.../src/site/apt/examples/debugging.apt.vm | 180 ++--
.../site/apt/examples/inclusion-exclusion.apt.vm | 279 +++---
.../src/site/apt/examples/junit.apt.vm | 458 +++++-----
.../src/site/apt/examples/pojo-test.apt.vm | 94 +-
.../src/site/apt/examples/providers.apt.vm | 97 +-
.../src/site/apt/examples/single-test.apt.vm | 170 ++--
.../src/site/apt/examples/skipping-test.apt.vm | 224 +++---
.../src/site/apt/examples/system-properties.apt.vm | 274 +++---
.../src/site/apt/examples/testng.apt.vm | 402 +++++----
.../src/site/apt/featurematrix.apt.vm | 49 +-
maven-surefire-plugin/src/site/apt/index.apt.vm | 175 ++--
maven-surefire-plugin/src/site/apt/usage.apt.vm | 710 ++++++++-------
.../maven/plugin/surefire/SurefirePluginTest.java | 12 +-
maven-surefire-report-plugin/pom.xml | 3 +-
.../surefire/report/FailsafeReportMojo.java | 1 -
.../surefire/report/SurefireReportGenerator.java | 6 +-
.../surefire/report/SurefireReportMojo.java | 1 -
.../surefire/report/SurefireReportOnlyMojo.java | 1 -
.../surefire/report/SurefireReportParser.java | 4 +-
.../surefire/report/TestSuiteXmlParser.java | 2 +-
.../site/apt/examples/changing-report-name.apt.vm | 63 +-
.../src/site/apt/examples/cross-referencing.apt.vm | 111 ++-
.../apt/examples/report-custom-location.apt.vm | 99 ++-
.../src/site/apt/examples/show-failures.apt.vm | 77 +-
.../src/site/apt/usage.apt.vm | 62 +-
.../surefire/report/ReportTestCaseTest.java | 1 -
.../surefire/report/SurefireReportMojoTest.java | 3 +-
.../surefire/report/TestSuiteXmlParserTest.java | 69 +-
.../report/stubs/SurefireRepMavenProjectStub.java | 1 -
.../report/stubs/SurefireRepMavenProjectStub2.java | 1 -
.../test/resources/test-reports/TEST-AntUnit.xml | 3 +-
.../TEST-classWithNoTests.NoMethodsTestCase.xml | 20 +-
...EST-junit.twoTestCaseSuite.WrapperTestSuite.xml | 18 +-
pom.xml | 2 +-
.../maven/plugin/surefire/runorder/Priority.java | 1 +
.../maven/surefire/SpecificTestClassFilter.java | 2 +-
.../surefire/booter/ForkingReporterFactory.java | 3 +-
.../maven/surefire/booter/ForkingRunListener.java | 1 -
.../maven/surefire/report/ReporterFactory.java | 1 +
.../org/apache/maven/surefire/suite/RunResult.java | 184 +++--
.../surefire/util/DefaultDirectoryScanner.java | 3 +-
.../apache/maven/surefire/util/LazyTestsToRun.java | 269 +++---
surefire-api/src/site/site.xml | 3 +-
.../apache/maven/surefire/suite/RunResultTest.java | 89 ++-
surefire-booter/pom.xml | 3 +-
.../maven/surefire/booter/BooterConstants.java | 2 +-
.../maven/surefire/booter/BooterDeserializer.java | 14 +-
.../surefire/booter/ClasspathConfiguration.java | 1 -
.../apache/maven/surefire/booter/ForkedBooter.java | 23 +-
.../surefire/booter/ProviderConfiguration.java | 14 +-
.../surefire/booter/StartupConfiguration.java | 6 +-
.../booter/SurefireBooterForkException.java | 2 -
.../surefire/booter/SystemPropertyManager.java | 3 +-
surefire-grouper/pom.xml | 3 +-
surefire-integration-tests/pom.xml | 3 +-
.../org/apache/maven/surefire/its/ForkModeIT.java | 22 +-
.../maven/surefire/its/IncludesExcludesIT.java | 1 -
.../surefire/its/JUnit48TestCategoriesIT.java | 2 +-
.../maven/surefire/its/UnicodeTestNamesIT.java | 6 +-
.../maven/surefire/its/WorkingDirectoryIT.java | 3 +-
.../its/fixture/FailsafeOutputValidator.java | 3 +-
.../surefire/its/fixture/SurefireLauncher.java | 1 -
.../surefire/its/fixture/SurefireLauncherTest.java | 15 +-
.../surefire/its/fixture/SurefireReportParser.java | 2 +-
.../its/fixture/TestSuiteXmlParserTest.java | 15 +-
.../its/jiras/Surefire141PluggableProvidersIT.java | 3 +-
...fire735ForkFailWithRedirectConsoleOutputIT.java | 2 +-
.../jiras/Surefire806SpecifiedTestControlsIT.java | 2 +-
.../its/jiras/Surefire809GroupExpressionsIT.java | 4 +-
.../Surefire901MIssingResultfileWhenNoTestsIT.java | 1 -
.../Surefire907PerThreadWithoutThreadCountIT.java | 3 +-
.../jiras/Surefire926FailureWith2ProvidersIT.java | 2 -
surefire-providers/common-junit3/pom.xml | 3 +-
.../common/junit4/JUnit4Reflector40Test.java | 1 +
surefire-providers/common-junit48/pom.xml | 11 +-
surefire-providers/pom.xml | 3 +-
surefire-providers/src/site/site.xml | 2 +-
surefire-providers/surefire-junit3/pom.xml | 47 +-
.../maven/surefire/junit/JUnit3Provider.java | 7 +-
surefire-providers/surefire-junit4/pom.xml | 3 +-
.../maven/surefire/junit4/JUnit4Provider.java | 9 +-
surefire-providers/surefire-junit47/pom.xml | 3 +-
.../junitcore/ConcurrentReporterManager.java | 12 +-
.../surefire/junitcore/JUnitCoreProvider.java | 3 +-
.../surefire/junitcore/SynchronousRunner.java | 1 +
surefire-providers/surefire-testng-utils/pom.xml | 11 +-
.../testng/utils/GroupMatcherMethodSelector.java | 1 +
surefire-providers/surefire-testng/pom.xml | 3 +-
.../surefire/testng/TestNGDirectoryTestSuite.java | 111 ++--
.../maven/surefire/testng/TestNGProvider.java | 7 +-
.../testng/conf/TestNGMapConfigurator.java | 2 +-
.../testng/conf/TestNGMapConfiguratorTest.java | 1 -
surefire-setup-integration-tests/pom.xml | 5 +-
surefire-shadefire/pom.xml | 3 +-
141 files changed, 3416 insertions(+), 2946 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-failsafe-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml
index 6634cf8..03f58cd 100644
--- a/maven-failsafe-plugin/pom.xml
+++ b/maven-failsafe-plugin/pom.xml
@@ -18,7 +18,8 @@
~ 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/xsd/maven-4.0.0.xsd">
+<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-failsafe-plugin/src/it/multiple-summaries-failing/pom.xml
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/it/multiple-summaries-failing/pom.xml b/maven-failsafe-plugin/src/it/multiple-summaries-failing/pom.xml
index e9ca2f5..41e36d5 100644
--- a/maven-failsafe-plugin/src/it/multiple-summaries-failing/pom.xml
+++ b/maven-failsafe-plugin/src/it/multiple-summaries-failing/pom.xml
@@ -40,41 +40,41 @@
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
- <execution>
- <id>integration-test</id>
- <goals>
- <goal>integration-test</goal>
- </goals>
- <configuration>
- <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-1.xml</summaryFile>
- </configuration>
- </execution>
- <execution>
- <id>acceptance-test</id>
- <goals>
- <goal>integration-test</goal>
- </goals>
- <configuration>
- <includes>
- <include>**/AT*.java</include>
- <include>**/*AT.java</include>
- <include>**/*ATCase.java</include>
- </includes>
- <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-2.xml</summaryFile>
- </configuration>
- </execution>
- <execution>
- <id>verify</id>
- <goals>
- <goal>verify</goal>
- </goals>
- <configuration>
- <summaryFiles>
- <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-1.xml</summaryFile>
- <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-2.xml</summaryFile>
- </summaryFiles>
- </configuration>
- </execution>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ <configuration>
+ <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-1.xml</summaryFile>
+ </configuration>
+ </execution>
+ <execution>
+ <id>acceptance-test</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>**/AT*.java</include>
+ <include>**/*AT.java</include>
+ <include>**/*ATCase.java</include>
+ </includes>
+ <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-2.xml</summaryFile>
+ </configuration>
+ </execution>
+ <execution>
+ <id>verify</id>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ <configuration>
+ <summaryFiles>
+ <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-1.xml</summaryFile>
+ <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-2.xml</summaryFile>
+ </summaryFiles>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-failsafe-plugin/src/it/multiple-summaries/pom.xml
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/it/multiple-summaries/pom.xml b/maven-failsafe-plugin/src/it/multiple-summaries/pom.xml
index b646445..921af08 100644
--- a/maven-failsafe-plugin/src/it/multiple-summaries/pom.xml
+++ b/maven-failsafe-plugin/src/it/multiple-summaries/pom.xml
@@ -40,36 +40,36 @@
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
- <execution>
- <id>integration-test1</id>
- <goals>
- <goal>integration-test</goal>
- </goals>
- <configuration>
- <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-1.xml</summaryFile>
- </configuration>
- </execution>
- <execution>
- <id>integration-test2</id>
- <goals>
- <goal>integration-test</goal>
- </goals>
- <configuration>
- <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-2.xml</summaryFile>
- </configuration>
- </execution>
- <execution>
- <id>verify</id>
- <goals>
- <goal>verify</goal>
- </goals>
- <configuration>
- <summaryFiles>
- <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-1.xml</summaryFile>
- <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-2.xml</summaryFile>
- </summaryFiles>
- </configuration>
- </execution>
+ <execution>
+ <id>integration-test1</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ <configuration>
+ <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-1.xml</summaryFile>
+ </configuration>
+ </execution>
+ <execution>
+ <id>integration-test2</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ <configuration>
+ <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-2.xml</summaryFile>
+ </configuration>
+ </execution>
+ <execution>
+ <id>verify</id>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ <configuration>
+ <summaryFiles>
+ <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-1.xml</summaryFile>
+ <summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-2.xml</summaryFile>
+ </summaryFiles>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
index 32b95a3..fd1f5fb 100644
--- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
+++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
@@ -19,6 +19,11 @@ package org.apache.maven.plugin.failsafe;
* under the License.
*/
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.List;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
@@ -32,12 +37,6 @@ import org.apache.maven.shared.utils.StringUtils;
import org.apache.maven.surefire.suite.RunResult;
import org.apache.maven.surefire.util.NestedCheckedException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.List;
-
import static org.apache.maven.shared.utils.io.IOUtil.close;
/**
@@ -168,7 +167,7 @@ public class IntegrationTestMojo
@Parameter( property = "encoding", defaultValue = "${project.reporting.outputEncoding}" )
private String encoding;
- protected void handleSummary(RunResult summary, NestedCheckedException firstForkException)
+ protected void handleSummary( RunResult summary, NestedCheckedException firstForkException )
throws MojoExecutionException, MojoFailureException
{
writeSummary( summary, firstForkException );
@@ -190,7 +189,7 @@ public class IntegrationTestMojo
try
{
Object token = getPluginContext().get( FAILSAFE_IN_PROGRESS_CONTEXT_KEY );
- summary.writeSummary(summaryFile, token != null, getEncodingOrDefault());
+ summary.writeSummary( summaryFile, token != null, getEncodingOrDefault() );
}
catch ( IOException e )
{
@@ -219,7 +218,7 @@ public class IntegrationTestMojo
}
}
- @SuppressWarnings("deprecation")
+ @SuppressWarnings( "deprecation" )
protected boolean isSkipExecution()
{
return isSkip() || isSkipTests() || isSkipITs() || isSkipExec();
@@ -255,14 +254,14 @@ public class IntegrationTestMojo
this.skipITs = skipITs;
}
- @SuppressWarnings("deprecation")
+ @SuppressWarnings( "deprecation" )
@Deprecated
public boolean isSkipExec()
{
return skipExec;
}
- @SuppressWarnings("deprecation")
+ @SuppressWarnings( "deprecation" )
@Deprecated
public void setSkipExec( boolean skipExec )
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
index c20752c..9a2c2c0 100644
--- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
+++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
@@ -19,6 +19,12 @@ package org.apache.maven.plugin.failsafe;
* under the License.
*/
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
@@ -33,8 +39,6 @@ import org.apache.maven.shared.utils.io.IOUtil;
import org.apache.maven.surefire.suite.RunResult;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import java.io.*;
-
/**
* Verify integration tests ran using Surefire.
*
@@ -207,7 +211,7 @@ public class VerifyMojo
fileInputStream = new FileInputStream( summaryFile );
bufferedInputStream = new BufferedInputStream( fileInputStream );
reader = new InputStreamReader( bufferedInputStream, encoding );
- return RunResult.fromInputStream(bufferedInputStream, encoding);
+ return RunResult.fromInputStream( bufferedInputStream, encoding );
}
finally
{
@@ -228,7 +232,7 @@ public class VerifyMojo
if ( !getTestClassesDirectory().exists() )
{
- if ( getFailIfNoTests() != null && getFailIfNoTests())
+ if ( getFailIfNoTests() != null && getFailIfNoTests() )
{
throw new MojoFailureException( "No tests to run!" );
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index 7c0b906..979cfa4 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -576,10 +576,10 @@ public abstract class AbstractSurefireMojo
private Artifact surefireBooterArtifact;
private Toolchain toolchain;
-
+
/**
* The placeholder that is replaced by the executing thread's running number. The thread number
- * range starts with 1
+ * range starts with 1
*/
public static final String THREAD_NUMBER_PLACEHOLDER = "${surefire.threadNumber}";
@@ -696,8 +696,9 @@ public abstract class AbstractSurefireMojo
}
}
- if (firstForkException != null){
- current = RunResult.failure(current, firstForkException);
+ if ( firstForkException != null )
+ {
+ current = RunResult.failure( current, firstForkException );
}
handleSummary( current, firstForkException );
@@ -755,7 +756,7 @@ public abstract class AbstractSurefireMojo
final RunResult result;
if ( isForkModeNever() )
{
- createCopyAndReplaceThreadNumPlaceholder(effectiveProperties, 1).copyToSystemProperties();
+ createCopyAndReplaceThreadNumPlaceholder( effectiveProperties, 1 ).copyToSystemProperties();
InPluginVMSurefireStarter surefireStarter =
createInprocessStarter( provider, classLoaderConfiguration, runOrderParameters );
@@ -787,12 +788,18 @@ public abstract class AbstractSurefireMojo
}
- public static SurefireProperties createCopyAndReplaceThreadNumPlaceholder(SurefireProperties effectiveSystemProperties, int threadNumber) {
- SurefireProperties filteredProperties = new SurefireProperties(effectiveSystemProperties);
- String threadNumberString = String.valueOf(threadNumber);
- for (Entry<Object,Object> entry : effectiveSystemProperties.entrySet()) {
- if (entry.getValue() instanceof String) {
- filteredProperties.put(entry.getKey(), ((String)entry.getValue()).replace(THREAD_NUMBER_PLACEHOLDER, threadNumberString));
+ public static SurefireProperties createCopyAndReplaceThreadNumPlaceholder(
+ SurefireProperties effectiveSystemProperties, int threadNumber )
+ {
+ SurefireProperties filteredProperties = new SurefireProperties( effectiveSystemProperties );
+ String threadNumberString = String.valueOf( threadNumber );
+ for ( Entry<Object, Object> entry : effectiveSystemProperties.entrySet() )
+ {
+ if ( entry.getValue() instanceof String )
+ {
+ filteredProperties.put( entry.getKey(),
+ ( (String) entry.getValue() ).replace( THREAD_NUMBER_PLACEHOLDER,
+ threadNumberString ) );
}
}
return filteredProperties;
@@ -1028,8 +1035,8 @@ public abstract class AbstractSurefireMojo
Properties providerProperties = getProperties();
return new ProviderConfiguration( directoryScannerParameters, runOrderParameters, failIfNoTests,
- reporterConfiguration, testNg, testSuiteDefinition, providerProperties,
- null, false );
+ reporterConfiguration, testNg, testSuiteDefinition, providerProperties, null,
+ false );
}
public String getStatisticsFileName( String configurationHash )
@@ -1133,9 +1140,9 @@ public abstract class AbstractSurefireMojo
getLog().debug( "Reading list from: " + file );
- if (!file.exists())
+ if ( !file.exists() )
{
- throw new RuntimeException( "Failed to load list from file: " + file);
+ throw new RuntimeException( "Failed to load list from file: " + file );
}
try
@@ -1371,8 +1378,8 @@ public abstract class AbstractSurefireMojo
private int getEffectiveForkCount()
{
- return ( ForkConfiguration.FORK_PERTHREAD.equals( getEffectiveForkMode() ) ||
- ForkConfiguration.FORK_ONCE_PERTHREAD.equals( getEffectiveForkMode() ) ) ? getThreadCount() : 1;
+ return ( ForkConfiguration.FORK_PERTHREAD.equals( getEffectiveForkMode() )
+ || ForkConfiguration.FORK_ONCE_PERTHREAD.equals( getEffectiveForkMode() ) ) ? getThreadCount() : 1;
}
private String getEffectiveDebugForkedProcess()
@@ -1756,8 +1763,8 @@ public abstract class AbstractSurefireMojo
void ensureThreadCountWithPerThread()
throws MojoFailureException
{
- if ( ( ForkConfiguration.FORK_PERTHREAD.equals( getEffectiveForkMode() ) ||
- ForkConfiguration.FORK_ONCE_PERTHREAD.equals( getEffectiveForkMode() )) && getThreadCount() < 1 )
+ if ( ( ForkConfiguration.FORK_PERTHREAD.equals( getEffectiveForkMode() )
+ || ForkConfiguration.FORK_ONCE_PERTHREAD.equals( getEffectiveForkMode() ) ) && getThreadCount() < 1 )
{
throw new MojoFailureException( "Fork modes perthread and onceperthread require a thread count" );
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.java
index fb1686f..1bcb065 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ClasspathCache.java
@@ -18,9 +18,8 @@ package org.apache.maven.plugin.surefire;
* under the License.
*/
-import org.apache.maven.surefire.booter.Classpath;
-
import java.util.concurrent.ConcurrentHashMap;
+import org.apache.maven.surefire.booter.Classpath;
/**
* @author Kristian Rosenvold
@@ -35,7 +34,8 @@ public class ClasspathCache
return classpaths.get( artifactId );
}
- public static void setCachedClasspath(String key, Classpath classpath){
- classpaths.put(key, classpath);
+ public static void setCachedClasspath( String key, Classpath classpath )
+ {
+ classpaths.put( key, classpath );
}
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/InPluginVMSurefireStarter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/InPluginVMSurefireStarter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/InPluginVMSurefireStarter.java
index 40e6941..1018917 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/InPluginVMSurefireStarter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/InPluginVMSurefireStarter.java
@@ -38,7 +38,6 @@ import org.apache.maven.surefire.util.DefaultScanResult;
* @author Emmanuel Venisse
* @author Dan Fabulich
* @author Kristian Rosenvold
- *
*/
public class InPluginVMSurefireStarter
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
index b29ed38..a9f1245 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
@@ -162,7 +162,7 @@ public class StartupReportConfiguration
public ConsoleReporter instantiateConsoleReporter()
{
- return shouldReportToConsole() ? new ConsoleReporter(originalSystemOut) : null;
+ return shouldReportToConsole() ? new ConsoleReporter( originalSystemOut ) : null;
}
private boolean shouldReportToConsole()
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
index 1c285e2..fdbe9bb 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
@@ -59,10 +59,10 @@ public final class SurefireHelper
return;
}
- String msg = timeoutOrOtherFailure ?
- "There was a timeout or other error in the fork" :
- "There are test failures.\n\nPlease refer to " + reportParameters.getReportsDirectory()
- + " for the individual test results.";
+ String msg = timeoutOrOtherFailure
+ ? "There was a timeout or other error in the fork"
+ : "There are test failures.\n\nPlease refer to " + reportParameters.getReportsDirectory()
+ + " for the individual test results.";
if ( reportParameters.isTestFailureIgnore() )
{
@@ -70,9 +70,9 @@ public final class SurefireHelper
}
else
{
- if (result.isFailure())
+ if ( result.isFailure() )
{
- throw new MojoExecutionException(msg );
+ throw new MojoExecutionException( msg );
}
else
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java
index 9a973fc..93e44a7 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java
@@ -35,7 +35,8 @@ import org.apache.maven.surefire.booter.KeyValueSource;
* A properties implementation that preserves insertion order.
*/
public class SurefireProperties
- extends Properties implements KeyValueSource
+ extends Properties
+ implements KeyValueSource
{
private final LinkedHashSet<Object> items = new LinkedHashSet<Object>();
@@ -196,10 +197,11 @@ public class SurefireProperties
{
Iterator iter = keySet().iterator();
Object key;
- while(iter.hasNext()){
+ while ( iter.hasNext() )
+ {
key = iter.next();
//noinspection unchecked
- target.put( key, get( key ));
+ target.put( key, get( key ) );
}
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/BooterSerializer.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/BooterSerializer.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/BooterSerializer.java
index 5b1dcbb..a80a8ae 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/BooterSerializer.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/BooterSerializer.java
@@ -21,9 +21,7 @@ package org.apache.maven.plugin.surefire.booterclient;
import java.io.File;
import java.io.IOException;
-import java.util.List;
import java.util.Properties;
-
import org.apache.maven.surefire.booter.BooterConstants;
import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
import org.apache.maven.surefire.booter.KeyValueSource;
@@ -52,7 +50,6 @@ import org.apache.maven.surefire.util.RunOrder;
* @author Brett Porter
* @author Dan Fabulich
* @author Kristian Rosenvold
- *
*/
class BooterSerializer
{
@@ -67,12 +64,12 @@ class BooterSerializer
/*
DOes not modify sourceProperties
*/
- public File serialize(KeyValueSource sourceProperties, ProviderConfiguration booterConfiguration, StartupConfiguration providerConfiguration,
- Object testSet, boolean readTestsFromInStream)
+ public File serialize( KeyValueSource sourceProperties, ProviderConfiguration booterConfiguration,
+ StartupConfiguration providerConfiguration, Object testSet, boolean readTestsFromInStream )
throws IOException
{
- PropertiesWrapper properties = new PropertiesWrapper(new Properties( ) );
+ PropertiesWrapper properties = new PropertiesWrapper( new Properties() );
sourceProperties.copyTo( properties.getProperties() );
providerConfiguration.getClasspathConfiguration().addForkProperties( properties );
@@ -84,8 +81,9 @@ class BooterSerializer
properties.setProperty( BooterConstants.TESTARTIFACT_CLASSIFIER, testNg.getClassifier() );
}
- properties.setProperty( BooterConstants.FORKTESTSET_PREFER_TESTS_FROM_IN_STREAM, Boolean.valueOf( readTestsFromInStream ) );
- properties.setProperty( BooterConstants.FORKTESTSET, getTypeEncoded( testSet ) );
+ properties.setProperty( BooterConstants.FORKTESTSET_PREFER_TESTS_FROM_IN_STREAM,
+ Boolean.valueOf( readTestsFromInStream ) );
+ properties.setProperty( BooterConstants.FORKTESTSET, getTypeEncoded( testSet ) );
TestRequest testSuiteDefinition = booterConfiguration.getTestSuiteDefinition();
if ( testSuiteDefinition != null )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkConfiguration.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkConfiguration.java
index 66a11a1..28c4fee 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkConfiguration.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkConfiguration.java
@@ -27,12 +27,10 @@ import java.util.Map;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
-
import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline;
import org.apache.maven.plugin.surefire.util.Relocator;
import org.apache.maven.shared.utils.StringUtils;
-import org.apache.maven.shared.utils.cli.Commandline;
import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
import org.apache.maven.surefire.booter.Classpath;
import org.apache.maven.surefire.booter.ForkedBooter;
@@ -55,7 +53,7 @@ public class ForkConfiguration
public static final String FORK_NEVER = "never";
public static final String FORK_PERTHREAD = "perthread";
-
+
public static final String FORK_ONCE_PERTHREAD = "onceperthread";
private final int forkCount;
@@ -108,7 +106,7 @@ public class ForkConfiguration
}
else if ( forkMode.equals( FORK_NEVER ) || forkMode.equals( FORK_ONCE ) ||
forkMode.equals( FORK_ALWAYS ) || forkMode.equals( FORK_PERTHREAD ) ||
- forkMode.equals( FORK_ONCE_PERTHREAD ))
+ forkMode.equals( FORK_ONCE_PERTHREAD ) )
{
return forkMode;
}
@@ -128,23 +126,26 @@ public class ForkConfiguration
* @throws org.apache.maven.surefire.booter.SurefireBooterForkException
* when unable to perform the fork
*/
- public OutputStreamFlushableCommandline createCommandLine( List<String> classPath, ClassLoaderConfiguration classpathConfiguration,
- boolean shadefire, int threadNumber )
+ public OutputStreamFlushableCommandline createCommandLine( List<String> classPath,
+ ClassLoaderConfiguration classpathConfiguration,
+ boolean shadefire, int threadNumber )
throws SurefireBooterForkException
{
- return createCommandLine( classPath, classpathConfiguration.isManifestOnlyJarRequestedAndUsable(), shadefire, threadNumber );
+ return createCommandLine( classPath, classpathConfiguration.isManifestOnlyJarRequestedAndUsable(), shadefire,
+ threadNumber );
}
- public OutputStreamFlushableCommandline createCommandLine( List<String> classPath, boolean useJar, boolean shadefire, int threadNumber )
+ public OutputStreamFlushableCommandline createCommandLine( List<String> classPath, boolean useJar,
+ boolean shadefire, int threadNumber )
throws SurefireBooterForkException
{
- OutputStreamFlushableCommandline cli = new OutputStreamFlushableCommandline();
+ OutputStreamFlushableCommandline cli = new OutputStreamFlushableCommandline();
cli.setExecutable( jvmExecutable );
if ( argLine != null )
{
- cli.createArg().setLine( replaceThreadNumberPlaceholder(stripNewLines( argLine ), threadNumber) );
+ cli.createArg().setLine( replaceThreadNumberPlaceholder( stripNewLines( argLine ), threadNumber ) );
}
if ( environmentVariables != null )
@@ -193,8 +194,9 @@ public class ForkConfiguration
return cli;
}
- private String replaceThreadNumberPlaceholder(String argLine, int threadNumber) {
- return argLine.replace(AbstractSurefireMojo.THREAD_NUMBER_PLACEHOLDER, String.valueOf(threadNumber));
+ private String replaceThreadNumberPlaceholder( String argLine, int threadNumber )
+ {
+ return argLine.replace( AbstractSurefireMojo.THREAD_NUMBER_PLACEHOLDER, String.valueOf( threadNumber ) );
}
/**
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
index 31f2475..b342b38 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
@@ -406,11 +406,11 @@ public class ForkStarter
}
catch ( CommandLineTimeOutException e )
{
- runResult = RunResult.timeout(fileReporterFactory.getGlobalRunStatistics().getRunResult());
+ runResult = RunResult.timeout( fileReporterFactory.getGlobalRunStatistics().getRunResult() );
}
catch ( CommandLineException e )
{
- runResult = RunResult.failure(fileReporterFactory.getGlobalRunStatistics().getRunResult(), e);
+ runResult = RunResult.failure( fileReporterFactory.getGlobalRunStatistics().getRunResult(), e );
throw new SurefireBooterForkException( "Error while executing forked tests.", e.getCause() );
}
finally
@@ -420,15 +420,15 @@ public class ForkStarter
{
runResult = fileReporterFactory.getGlobalRunStatistics().getRunResult();
}
- if (!runResult.isTimeout() && !forkClient.isSaidGoodBye())
+ if ( !runResult.isTimeout() && !forkClient.isSaidGoodBye() )
{
//noinspection ThrowFromFinallyBlock
throw new RuntimeException(
"The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?" +
- "\nCommand was" + cli.toString());
+ "\nCommand was" + cli.toString() );
}
- forkClient.close( runResult.isTimeout());
+ forkClient.close( runResult.isTimeout() );
}
return runResult;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/FlushReceiver.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/FlushReceiver.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/FlushReceiver.java
index 0c0bcdd..969affa 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/FlushReceiver.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/FlushReceiver.java
@@ -23,15 +23,16 @@ import java.io.IOException;
/**
* Something that can be flushed.
- *
- * @author Andreas Gudian
*
+ * @author Andreas Gudian
*/
-public interface FlushReceiver {
- /**
- * Performs a flush, releasing any buffered resources.
- *
- * @throws IOException in case the flush operation failed
- */
- void flush() throws IOException;
+public interface FlushReceiver
+{
+ /**
+ * Performs a flush, releasing any buffered resources.
+ *
+ * @throws IOException in case the flush operation failed
+ */
+ void flush()
+ throws IOException;
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/FlushReceiverProvider.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/FlushReceiverProvider.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/FlushReceiverProvider.java
index 052bb44..8c15fa6 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/FlushReceiverProvider.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/FlushReceiverProvider.java
@@ -21,14 +21,14 @@ package org.apache.maven.plugin.surefire.booterclient.lazytestprovider;
/**
* Provides a {@link FlushReceiver}.
- *
- * @author Andreas Gudian
*
+ * @author Andreas Gudian
*/
-public interface FlushReceiverProvider {
+public interface FlushReceiverProvider
+{
- /**
- * @return a {@link FlushReceiver}
- */
- FlushReceiver getFlushReceiver();
+ /**
+ * @return a {@link FlushReceiver}
+ */
+ FlushReceiver getFlushReceiver();
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandline.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandline.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandline.java
index 3149566..60b8325 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandline.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandline.java
@@ -21,7 +21,6 @@ package org.apache.maven.plugin.surefire.booterclient.lazytestprovider;
import java.io.IOException;
import java.io.OutputStream;
-
import org.apache.maven.shared.utils.cli.CommandLineException;
import org.apache.maven.shared.utils.cli.Commandline;
@@ -29,45 +28,55 @@ import org.apache.maven.shared.utils.cli.Commandline;
* A {@link Commandline} implementation that provides the output stream of
* the executed process in form of a {@link FlushReceiver}, for it to be
* flushed on demand.
- *
- * @author Andreas Gudian
*
+ * @author Andreas Gudian
*/
-public class OutputStreamFlushableCommandline extends Commandline implements FlushReceiverProvider {
- /**
- * Wraps an output stream in order to delegate a flush.
- *
- */
- private final class OutputStreamFlushReceiver implements FlushReceiver {
- private final OutputStream outputStream;
+public class OutputStreamFlushableCommandline
+ extends Commandline
+ implements FlushReceiverProvider
+{
+ /**
+ * Wraps an output stream in order to delegate a flush.
+ */
+ private final class OutputStreamFlushReceiver
+ implements FlushReceiver
+ {
+ private final OutputStream outputStream;
+
+ private OutputStreamFlushReceiver( OutputStream outputStream )
+ {
+ this.outputStream = outputStream;
+ }
+
+ public void flush()
+ throws IOException
+ {
+ outputStream.flush();
+ }
+ }
- private OutputStreamFlushReceiver(OutputStream outputStream) {
- this.outputStream = outputStream;
- }
+ private FlushReceiver flushReceiver;
- public void flush() throws IOException {
- outputStream.flush();
- }
- }
+ @Override
+ public Process execute()
+ throws CommandLineException
+ {
+ Process process = super.execute();
- private FlushReceiver flushReceiver;
-
- @Override
- public Process execute() throws CommandLineException {
- Process process = super.execute();
+ if ( process.getOutputStream() != null )
+ {
+ flushReceiver = new OutputStreamFlushReceiver( process.getOutputStream() );
+ }
- if (process.getOutputStream() != null) {
- flushReceiver = new OutputStreamFlushReceiver(process.getOutputStream());
- }
-
- return process;
- }
+ return process;
+ }
- /* (non-Javadoc)
- * @see org.apache.maven.plugin.surefire.booterclient.lazytestprovider.FlushReceiverProvider#getFlushReceiver()
- */
- public FlushReceiver getFlushReceiver() {
- return flushReceiver;
- }
+ /* (non-Javadoc)
+ * @see org.apache.maven.plugin.surefire.booterclient.lazytestprovider.FlushReceiverProvider#getFlushReceiver()
+ */
+ public FlushReceiver getFlushReceiver()
+ {
+ return flushReceiver;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStream.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStream.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStream.java
index 8b6f396..1e63234 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStream.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStream.java
@@ -27,70 +27,88 @@ import java.util.concurrent.Semaphore;
/**
* An {@link InputStream} that, when read, provides test class names out of
* a queue.
- * <p>
+ * <p/>
* The Stream provides only one test at a time, but only after {@link #provideNewTest()}
* has been invoked.
- * <p>
- * After providing each test class name, followed by a newline character, a flush is
+ * <p/>
+ * After providing each test class name, followed by a newline character, a flush is
* performed on the {@link FlushReceiver} provided by the {@link FlushReceiverProvider}
* that can be set using {@link #setFlushReceiverProvider(FlushReceiverProvider)}.
- *
- * @author Andreas Gudian
*
+ * @author Andreas Gudian
*/
-public class TestProvidingInputStream extends InputStream {
- private final Queue<String> testItemQueue;
- private byte[] currentBuffer;
- private int currentPos;
- private Semaphore semaphore = new Semaphore(0);
- private FlushReceiverProvider flushReceiverProvider;
+public class TestProvidingInputStream
+ extends InputStream
+{
+ private final Queue<String> testItemQueue;
+
+ private byte[] currentBuffer;
+
+ private int currentPos;
+
+ private Semaphore semaphore = new Semaphore( 0 );
+
+ private FlushReceiverProvider flushReceiverProvider;
+
+ /**
+ * C'tor
+ *
+ * @param testItemQueue source of the tests to be read from this stream
+ */
+ public TestProvidingInputStream( Queue<String> testItemQueue )
+ {
+ this.testItemQueue = testItemQueue;
+ }
- /**
- * C'tor
- *
- * @param testItemQueue source of the tests to be read from this stream
- */
- public TestProvidingInputStream(Queue<String> testItemQueue) {
- this.testItemQueue = testItemQueue;
- }
+ /**
+ * @param flushReceiverProvider the provider for a flush receiver.
+ */
+ public void setFlushReceiverProvider( FlushReceiverProvider flushReceiverProvider )
+ {
+ this.flushReceiverProvider = flushReceiverProvider;
+ }
- /**
- * @param flushReceiverProvider the provider for a flush receiver.
- */
- public void setFlushReceiverProvider(FlushReceiverProvider flushReceiverProvider) {
- this.flushReceiverProvider = flushReceiverProvider;
- }
+ @Override
+ public synchronized int read()
+ throws IOException
+ {
+ if ( null == currentBuffer )
+ {
+ if ( null != flushReceiverProvider && null != flushReceiverProvider.getFlushReceiver() )
+ {
+ flushReceiverProvider.getFlushReceiver().flush();
+ }
- @Override
- public synchronized int read() throws IOException {
- if (null == currentBuffer) {
- if (null != flushReceiverProvider && null != flushReceiverProvider.getFlushReceiver()) {
- flushReceiverProvider.getFlushReceiver().flush();
- }
-
- semaphore.acquireUninterruptibly();
+ semaphore.acquireUninterruptibly();
- String currentElement = testItemQueue.poll();
- if (null != currentElement) {
- currentBuffer = currentElement.getBytes();
- currentPos = 0;
- } else {
- return -1;
- }
- }
+ String currentElement = testItemQueue.poll();
+ if ( null != currentElement )
+ {
+ currentBuffer = currentElement.getBytes();
+ currentPos = 0;
+ }
+ else
+ {
+ return -1;
+ }
+ }
- if (currentPos < currentBuffer.length) {
- return (currentBuffer[currentPos++] & 0xff);
- } else {
- currentBuffer = null;
- return ('\n' & 0xff);
- }
- }
+ if ( currentPos < currentBuffer.length )
+ {
+ return ( currentBuffer[currentPos++] & 0xff );
+ }
+ else
+ {
+ currentBuffer = null;
+ return ( '\n' & 0xff );
+ }
+ }
- /**
- * Signal that a new test is to be provided.
- */
- public void provideNewTest() {
- semaphore.release();
- }
+ /**
+ * Signal that a new test is to be provided.
+ */
+ public void provideNewTest()
+ {
+ semaphore.release();
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java
index 2d77085..8b67139 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java
@@ -28,7 +28,6 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
-
import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestProvidingInputStream;
import org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
import org.apache.maven.shared.utils.cli.StreamConsumer;
@@ -38,7 +37,6 @@ import org.apache.maven.surefire.report.ConsoleLogger;
import org.apache.maven.surefire.report.ConsoleOutputReceiver;
import org.apache.maven.surefire.report.ReportEntry;
import org.apache.maven.surefire.report.ReporterException;
-import org.apache.maven.surefire.report.ReporterFactory;
import org.apache.maven.surefire.report.RunListener;
import org.apache.maven.surefire.report.StackTraceWriter;
import org.apache.maven.surefire.util.NestedRuntimeException;
@@ -54,6 +52,7 @@ public class ForkClient
{
private final DefaultReporterFactory providerReporterFactory;
+
private final TestProvidingInputStream testProvidingInputStream;
private final Map<Integer, RunListener> testSetReporters =
@@ -65,10 +64,11 @@ public class ForkClient
public ForkClient( DefaultReporterFactory providerReporterFactory, Properties testVmSystemProperties )
{
- this(providerReporterFactory, testVmSystemProperties, null);
+ this( providerReporterFactory, testVmSystemProperties, null );
}
-
- public ForkClient( DefaultReporterFactory providerReporterFactory, Properties testVmSystemProperties, TestProvidingInputStream testProvidingInputStream )
+
+ public ForkClient( DefaultReporterFactory providerReporterFactory, Properties testVmSystemProperties,
+ TestProvidingInputStream testProvidingInputStream )
{
this.providerReporterFactory = providerReporterFactory;
this.testVmSystemProperties = testVmSystemProperties;
@@ -146,11 +146,11 @@ public class ForkClient
getOrCreateConsoleLogger( channelNumber ).info( createConsoleMessage( remaining ) );
break;
case ForkingRunListener.BOOTERCODE_NEXT_TEST:
- if (null != testProvidingInputStream)
- {
- testProvidingInputStream.provideNewTest();
- }
- break;
+ if ( null != testProvidingInputStream )
+ {
+ testProvidingInputStream.provideNewTest();
+ }
+ break;
case ForkingRunListener.BOOTERCODE_BYE:
saidGoodBye = true;
break;
@@ -265,7 +265,7 @@ public class ForkClient
return (ConsoleLogger) getOrCreateReporter( channelNumber );
}
- public void close(boolean hadTimeout)
+ public void close( boolean hadTimeout )
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java
index e79717b..3d84b2a 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java
@@ -19,15 +19,14 @@ package org.apache.maven.plugin.surefire.report;
* under the License.
*/
-import org.apache.maven.surefire.report.ReportEntry;
-import org.apache.maven.surefire.report.ReporterException;
-import org.apache.maven.surefire.util.NestedRuntimeException;
-
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
+import org.apache.maven.surefire.report.ReportEntry;
+import org.apache.maven.surefire.report.ReporterException;
+import org.apache.maven.surefire.util.NestedRuntimeException;
/**
* Surefire output consumer proxy that writes test output to a {@link java.io.File} for each test suite.
@@ -65,13 +64,15 @@ public class ConsoleOutputFileReporter
{
}
- public void close(){
+ public void close()
+ {
if ( printWriter != null )
{
printWriter.close();
printWriter = null;
}
}
+
public void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
{
try
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java
index cecb461..52165af 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java
@@ -19,14 +19,13 @@ package org.apache.maven.plugin.surefire.report;
* under the License.
*/
-import org.apache.maven.surefire.report.ReportEntry;
-import org.apache.maven.surefire.report.ReporterException;
-
import java.io.BufferedOutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.List;
+import org.apache.maven.surefire.report.ReportEntry;
+import org.apache.maven.surefire.report.ReporterException;
/**
* Base class for console reporters.
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
index efcddf5..55784ff 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
@@ -49,7 +49,8 @@ public class DefaultReporterFactory
private final StatisticsReporter statisticsReporter;
- private final List<TestSetRunListener> listeners = Collections.synchronizedList(new ArrayList<TestSetRunListener>( ));
+ private final List<TestSetRunListener> listeners =
+ Collections.synchronizedList( new ArrayList<TestSetRunListener>() );
public DefaultReporterFactory( StartupReportConfiguration reportConfiguration )
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DirectConsoleOutput.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DirectConsoleOutput.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DirectConsoleOutput.java
index 12f4e42..9bc883f 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DirectConsoleOutput.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DirectConsoleOutput.java
@@ -20,7 +20,6 @@ package org.apache.maven.plugin.surefire.report;
*/
import java.io.PrintStream;
-
import org.apache.maven.surefire.report.ReportEntry;
/**
@@ -35,6 +34,7 @@ public class DirectConsoleOutput
implements TestcycleConsoleOutputReceiver
{
private final PrintStream sout;
+
private final PrintStream serr;
public DirectConsoleOutput( PrintStream sout, PrintStream serr )
@@ -47,7 +47,7 @@ public class DirectConsoleOutput
public void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
{
PrintStream stream = stdout ? sout : serr;
- stream.write(buf, off, len);
+ stream.write( buf, off, len );
}
public void testSetStarting( ReportEntry reportEntry )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporter.java
index 87557ef..3bab9f5 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporter.java
@@ -19,14 +19,13 @@ package org.apache.maven.plugin.surefire.report;
* under the License.
*/
-import org.apache.maven.surefire.report.ReportEntry;
-import org.apache.maven.surefire.report.ReporterException;
-
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
+import org.apache.maven.surefire.report.ReportEntry;
+import org.apache.maven.surefire.report.ReporterException;
/**
* Base class for file reporters.
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/PrettyPrintXMLWriter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/PrettyPrintXMLWriter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/PrettyPrintXMLWriter.java
index 25f0c83..ddb4ed9 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/PrettyPrintXMLWriter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/PrettyPrintXMLWriter.java
@@ -19,11 +19,11 @@ package org.apache.maven.plugin.surefire.report;
* under the License.
*/
-import org.apache.maven.shared.utils.xml.XMLWriter;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
-
import java.io.PrintWriter;
import java.util.LinkedList;
+import org.apache.maven.shared.utils.xml.XMLWriter;
+
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
public class PrettyPrintXMLWriter
implements XMLWriter
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
index 11c0c47..c306b1d 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
@@ -19,13 +19,6 @@ package org.apache.maven.plugin.surefire.report;
* under the License.
*/
-import org.apache.maven.shared.utils.xml.Xpp3Dom;
-import org.apache.maven.shared.utils.xml.Xpp3DomWriter;
-import org.apache.maven.surefire.report.ReportEntry;
-import org.apache.maven.surefire.report.ReporterException;
-import org.apache.maven.surefire.report.SafeThrowable;
-import org.apache.maven.shared.utils.io.IOUtil;
-
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
@@ -36,6 +29,12 @@ import java.io.UnsupportedEncodingException;
import java.util.Enumeration;
import java.util.Properties;
import java.util.StringTokenizer;
+import org.apache.maven.shared.utils.io.IOUtil;
+import org.apache.maven.shared.utils.xml.Xpp3Dom;
+import org.apache.maven.shared.utils.xml.Xpp3DomWriter;
+import org.apache.maven.surefire.report.ReportEntry;
+import org.apache.maven.surefire.report.ReporterException;
+import org.apache.maven.surefire.report.SafeThrowable;
/**
* XML format reporter writing to <code>TEST-<i>reportName</i>[-<i>suffix</i>].xml</code> file like written and read
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java
index 33ca938..aab6ad3 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java
@@ -19,6 +19,9 @@ package org.apache.maven.plugin.surefire.report;
* under the License.
*/
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import org.apache.maven.plugin.surefire.runorder.StatisticsReporter;
import org.apache.maven.surefire.report.ConsoleLogger;
import org.apache.maven.surefire.report.ConsoleOutputReceiver;
@@ -27,10 +30,6 @@ import org.apache.maven.surefire.report.RunListener;
import org.apache.maven.surefire.report.RunStatistics;
import org.apache.maven.surefire.util.internal.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
/**
* Reports data for a single test set.
* <p/>
@@ -44,8 +43,9 @@ public class TestSetRunListener
private final TestSetStats detailsForThis;
- static {
- System.out.println("static = " + true);
+ static
+ {
+ System.out.println( "static = " + true );
}
private final List<ByteBuffer> testStdOut = Collections.synchronizedList( new ArrayList<ByteBuffer>() );
@@ -244,6 +244,9 @@ public class TestSetRunListener
public void close()
{
- if (consoleOutputReceiver != null) consoleOutputReceiver.close();
+ if ( consoleOutputReceiver != null )
+ {
+ consoleOutputReceiver.close();
+ }
}
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestcycleConsoleOutputReceiver.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestcycleConsoleOutputReceiver.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestcycleConsoleOutputReceiver.java
index 7d1b607..09710e3 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestcycleConsoleOutputReceiver.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestcycleConsoleOutputReceiver.java
@@ -25,11 +25,14 @@ import org.apache.maven.surefire.report.ReportEntry;
/**
* @author Kristian Rosenvold
*/
-public interface TestcycleConsoleOutputReceiver extends ConsoleOutputReceiver
+public interface TestcycleConsoleOutputReceiver
+ extends ConsoleOutputReceiver
{
void testSetStarting( ReportEntry reportEntry );
+
void testSetCompleted( ReportEntry report );
+
void close();
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java
index c93c1e1..c77867c 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java
@@ -27,14 +27,17 @@ import org.apache.maven.surefire.report.StackTraceWriter;
/**
* @author Kristian Rosenvold
*/
-public class WrappedReportEntry implements ReportEntry
+public class WrappedReportEntry
+ implements ReportEntry
{
private final ReportEntry original;
+
private final ReportEntryType reportEntryType;
private final Integer elapsed;
private final String stdout;
+
private final String stdErr;
private final NumberFormat numberFormat = NumberFormat.getInstance( Locale.ENGLISH );
@@ -43,7 +46,8 @@ public class WrappedReportEntry implements ReportEntry
static final String NL = System.getProperty( "line.separator" );
- public WrappedReportEntry( ReportEntry original, ReportEntryType reportEntryType, Integer estimatedElapsed, String stdout, String stdErr )
+ public WrappedReportEntry( ReportEntry original, ReportEntryType reportEntryType, Integer estimatedElapsed,
+ String stdout, String stdErr )
{
this.original = original;
this.reportEntryType = reportEntryType;
@@ -110,7 +114,7 @@ public class WrappedReportEntry implements ReportEntry
public String elapsedTimeAsString()
{
- return elapsedTimeAsString(getElapsed());
+ return elapsedTimeAsString( getElapsed() );
}
String elapsedTimeAsString( long runTime )
@@ -118,31 +122,31 @@ public class WrappedReportEntry implements ReportEntry
return numberFormat.format( (double) runTime / MS_PER_SEC );
}
- public String getReportName( )
+ public String getReportName()
{
final int i = getName().lastIndexOf( "(" );
return i > 0 ? getName().substring( 0, i ) : getName();
}
- public String getReportName( String suffix)
+ public String getReportName( String suffix )
{
return suffix != null && suffix.length() > 0 ? getReportName() + "(" + suffix + ")" : getReportName();
}
- public String getOutput(boolean trimStackTrace)
+ public String getOutput( boolean trimStackTrace )
{
StringBuilder buf = new StringBuilder();
- buf.append( getElapsedTimeSummary( ) );
+ buf.append( getElapsedTimeSummary() );
- buf.append( " <<< " ).append( getReportEntryType().toString().toUpperCase()).append("!").append( NL );
+ buf.append( " <<< " ).append( getReportEntryType().toString().toUpperCase() ).append( "!" ).append( NL );
- buf.append( getStackTrace(trimStackTrace) );
+ buf.append( getStackTrace( trimStackTrace ) );
return buf.toString();
}
- public String getElapsedTimeSummary( )
+ public String getElapsedTimeSummary()
{
StringBuilder reportContent = new StringBuilder();
reportContent.append( getName() );
@@ -153,16 +157,19 @@ public class WrappedReportEntry implements ReportEntry
return reportContent.toString();
}
- public boolean isErrorOrFailure() {
+ public boolean isErrorOrFailure()
+ {
ReportEntryType thisType = getReportEntryType();
return ReportEntryType.failure == thisType || ReportEntryType.error == thisType;
}
- public boolean isSkipped() {
+ public boolean isSkipped()
+ {
return ReportEntryType.skipped == getReportEntryType();
}
- public boolean isSucceeded() {
+ public boolean isSucceeded()
+ {
return ReportEntryType.success == getReportEntryType();
}
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/runorder/StatisticsReporter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/runorder/StatisticsReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/runorder/StatisticsReporter.java
index 7cb9c66..93cadf1 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/runorder/StatisticsReporter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/runorder/StatisticsReporter.java
@@ -19,11 +19,10 @@ package org.apache.maven.plugin.surefire.runorder;
* under the License.
*/
-import org.apache.maven.surefire.report.ReportEntry;
-import org.apache.maven.surefire.util.NestedRuntimeException;
-
import java.io.File;
import java.io.FileNotFoundException;
+import org.apache.maven.surefire.report.ReportEntry;
+import org.apache.maven.surefire.util.NestedRuntimeException;
/**
* @author Kristian Rosenvold
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/main/java/org/apache/maven/surefire/report/RunStatistics.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/surefire/report/RunStatistics.java b/maven-surefire-common/src/main/java/org/apache/maven/surefire/report/RunStatistics.java
index 4ba81f0..bd543e8 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/surefire/report/RunStatistics.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/surefire/report/RunStatistics.java
@@ -22,7 +22,6 @@ package org.apache.maven.surefire.report;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-
import org.apache.maven.plugin.surefire.report.TestSetStats;
import org.apache.maven.surefire.suite.RunResult;
import org.apache.maven.surefire.util.internal.StringUtils;
@@ -41,9 +40,13 @@ public class RunStatistics
* Holds the source(s) that causes the failure(s).
*/
private final Sources failureSources = new Sources();
+
private int completedCount;
+
private int errors;
+
private int failures;
+
private int skipped;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java
index 509929d..c11ce59 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java
@@ -27,10 +27,6 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
import org.apache.maven.surefire.booter.BooterDeserializer;
import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
import org.apache.maven.surefire.booter.ClasspathConfiguration;
@@ -45,6 +41,9 @@ import org.apache.maven.surefire.testset.TestArtifactInfo;
import org.apache.maven.surefire.testset.TestRequest;
import org.apache.maven.surefire.util.RunOrder;
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
/**
* Performs roundtrip testing of serialization/deserialization of the ProviderConfiguration
*
@@ -55,7 +54,7 @@ public class BooterDeserializerProviderConfigurationTest
{
public static final TypeEncodedValue aTestTyped = new TypeEncodedValue( String.class.getName(), "aTest" );
-
+
private final String aUserRequestedTest = "aUserRequestedTest";
private static ClassLoaderConfiguration getForkConfiguration()
@@ -134,15 +133,15 @@ public class BooterDeserializerProviderConfigurationTest
Assert.assertEquals( aTestTyped, reloaded.getTestForFork() );
}
-
+
public void testTestForForkWithMultipleFiles()
- throws IOException
- {
- final ProviderConfiguration reloaded = getReloadedProviderConfigurationForReadFromInStream();
- Assert.assertNull( reloaded.getTestForFork() );
- Assert.assertTrue( reloaded.isReadTestsFromInStream() );
+ throws IOException
+ {
+ final ProviderConfiguration reloaded = getReloadedProviderConfigurationForReadFromInStream();
+ Assert.assertNull( reloaded.getTestForFork() );
+ Assert.assertTrue( reloaded.isReadTestsFromInStream() );
- }
+ }
public void testFailIfNoTests()
throws IOException
@@ -153,23 +152,24 @@ public class BooterDeserializerProviderConfigurationTest
}
private ProviderConfiguration getReloadedProviderConfigurationForReadFromInStream()
- throws IOException
- {
- return getReloadedProviderConfiguration(true);
- }
-
+ throws IOException
+ {
+ return getReloadedProviderConfiguration( true );
+ }
+
private ProviderConfiguration getReloadedProviderConfiguration()
- throws IOException
- {
- return getReloadedProviderConfiguration(false);
- }
-
- private ProviderConfiguration getReloadedProviderConfiguration(boolean readTestsFromInStream)
+ throws IOException
+ {
+ return getReloadedProviderConfiguration( false );
+ }
+
+ private ProviderConfiguration getReloadedProviderConfiguration( boolean readTestsFromInStream )
throws IOException
{
DirectoryScannerParameters directoryScannerParameters = getDirectoryScannerParametersWithoutSpecificTests();
ClassLoaderConfiguration forkConfiguration = getForkConfiguration();
- ProviderConfiguration booterConfiguration = getTestProviderConfiguration( directoryScannerParameters, readTestsFromInStream );
+ ProviderConfiguration booterConfiguration =
+ getTestProviderConfiguration( directoryScannerParameters, readTestsFromInStream );
final StartupConfiguration testProviderConfiguration = getTestStartupConfiguration( forkConfiguration );
return saveAndReload( booterConfiguration, testProviderConfiguration, readTestsFromInStream );
}
@@ -189,27 +189,30 @@ public class BooterDeserializerProviderConfigurationTest
}
private ProviderConfiguration saveAndReload( ProviderConfiguration booterConfiguration,
- StartupConfiguration testProviderConfiguration, boolean readTestsFromInStream )
+ StartupConfiguration testProviderConfiguration,
+ boolean readTestsFromInStream )
throws IOException
{
final ForkConfiguration forkConfiguration = ForkConfigurationTest.getForkConfiguration( null, null );
- PropertiesWrapper props = new PropertiesWrapper( new Properties());
+ PropertiesWrapper props = new PropertiesWrapper( new Properties() );
BooterSerializer booterSerializer = new BooterSerializer( forkConfiguration );
Object test;
- if (readTestsFromInStream)
- {
- test = null;
+ if ( readTestsFromInStream )
+ {
+ test = null;
}
else
{
- test = "aTest";
+ test = "aTest";
}
- final File propsTest = booterSerializer.serialize( props, booterConfiguration, testProviderConfiguration, test, readTestsFromInStream);
+ final File propsTest = booterSerializer.serialize( props, booterConfiguration, testProviderConfiguration, test,
+ readTestsFromInStream );
BooterDeserializer booterDeserializer = new BooterDeserializer( new FileInputStream( propsTest ) );
return booterDeserializer.deserialize();
}
- private ProviderConfiguration getTestProviderConfiguration( DirectoryScannerParameters directoryScannerParameters, boolean readTestsFromInStream )
+ private ProviderConfiguration getTestProviderConfiguration( DirectoryScannerParameters directoryScannerParameters,
+ boolean readTestsFromInStream )
{
File cwd = new File( "." );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
index d72621d..5446bd6 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
@@ -25,9 +25,6 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Properties;
-
-import junit.framework.TestCase;
-
import org.apache.maven.surefire.booter.BooterDeserializer;
import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
import org.apache.maven.surefire.booter.Classpath;
@@ -42,6 +39,8 @@ import org.apache.maven.surefire.testset.TestArtifactInfo;
import org.apache.maven.surefire.testset.TestRequest;
import org.apache.maven.surefire.util.RunOrder;
+import junit.framework.TestCase;
+
/**
* Performs roundtrip testing of serialization/deserialization of The StartupConfiguration
*
@@ -127,10 +126,11 @@ public class BooterDeserializerStartupConfigurationTest
throws IOException
{
final ForkConfiguration forkConfiguration = ForkConfigurationTest.getForkConfiguration( null, null );
- PropertiesWrapper props = new PropertiesWrapper( new Properties());
+ PropertiesWrapper props = new PropertiesWrapper( new Properties() );
BooterSerializer booterSerializer = new BooterSerializer( forkConfiguration );
String aTest = "aTest";
- final File propsTest = booterSerializer.serialize( props, getProviderConfiguration(), startupConfiguration, aTest, false );
+ final File propsTest =
+ booterSerializer.serialize( props, getProviderConfiguration(), startupConfiguration, aTest, false );
BooterDeserializer booterDeserializer = new BooterDeserializer( new FileInputStream( propsTest ) );
return booterDeserializer.getProviderConfiguration();
}