You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2017/04/15 00:57:04 UTC
[1/4] maven-surefire git commit: [SUREFIRE-1363] Java 1.6 features
@Override and Charset
Repository: maven-surefire
Updated Branches:
refs/heads/SUREFIRE-1363 [created] 11511f4a9
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ThreadResourcesBalancer.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ThreadResourcesBalancer.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ThreadResourcesBalancer.java
index 455874c..070c457 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ThreadResourcesBalancer.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ThreadResourcesBalancer.java
@@ -68,6 +68,7 @@ final class ThreadResourcesBalancer
* @return <code>true</code> if current thread is <em>NOT</em> interrupted
* while waiting for a permit.
*/
+ @Override
public boolean acquirePermit()
{
try
@@ -84,11 +85,13 @@ final class ThreadResourcesBalancer
/**
* Releases a permit, returning it to the balancer.
*/
+ @Override
public void releasePermit()
{
balancer.release();
}
+ @Override
public void releaseAllPermits()
{
balancer.release( numPermits );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DefaultConsoleReporter.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DefaultConsoleReporter.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DefaultConsoleReporter.java
index 0c8e856..53b20bb 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DefaultConsoleReporter.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DefaultConsoleReporter.java
@@ -36,31 +36,37 @@ public class DefaultConsoleReporter
this.systemOut = systemOut;
}
+ @Override
public void debug( String message )
{
}
+ @Override
public void info( String message )
{
systemOut.println( message );
}
+ @Override
public void warning( String message )
{
}
+ @Override
public void error( String message )
{
}
+ @Override
public void error( String message, Throwable t )
{
}
+ @Override
public void error( Throwable t )
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilderTest.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilderTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilderTest.java
index 0af17cd..bef7baf 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilderTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilderTest.java
@@ -556,6 +556,7 @@ public class ParallelComputerBuilderTest
appThreads.removeAll( Collections.singleton( (Thread) null ) );
Collections.sort( appThreads, new Comparator<Thread>()
{
+ @Override
public int compare( Thread t1, Thread t2 )
{
return (int) Math.signum( t1.getId() - t2.getId() );
@@ -580,6 +581,7 @@ public class ParallelComputerBuilderTest
(ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer();
shutdownTask = new Runnable()
{
+ @Override
public void run()
{
Collection<Description> startedTests = computer.describeStopped( useInterrupt ).getTriggeredTests();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/RangeMatcher.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/RangeMatcher.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/RangeMatcher.java
index a71d853..0ee8033 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/RangeMatcher.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/RangeMatcher.java
@@ -45,11 +45,13 @@ final class RangeMatcher
return new RangeMatcher( from, to );
}
+ @Override
public void describeTo( Description description )
{
description.appendValueList( "between ", " and ", "", from, to );
}
+ @Override
public boolean matches( Object o )
{
long actual = (Long) o;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/SchedulingStrategiesTest.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/SchedulingStrategiesTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/SchedulingStrategiesTest.java
index 98c3721..812355f 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/SchedulingStrategiesTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/SchedulingStrategiesTest.java
@@ -166,6 +166,7 @@ public class SchedulingStrategiesTest
{
volatile boolean result = false;
+ @Override
public void run()
{
result = true;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/FailFastListener.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/FailFastListener.java b/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/FailFastListener.java
index 91f3461..b85826f 100644
--- a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/FailFastListener.java
+++ b/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/FailFastListener.java
@@ -39,36 +39,43 @@ public class FailFastListener
this.stoppable = stoppable;
}
+ @Override
public void onTestStart( ITestResult result )
{
}
+ @Override
public void onTestSuccess( ITestResult result )
{
}
+ @Override
public void onTestFailure( ITestResult result )
{
stoppable.fireStopEvent();
}
+ @Override
public void onTestSkipped( ITestResult result )
{
}
+ @Override
public void onTestFailedButWithinSuccessPercentage( ITestResult result )
{
}
+ @Override
public void onStart( ITestContext context )
{
}
+ @Override
public void onFinish( ITestContext context )
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/FailFastNotifier.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/FailFastNotifier.java b/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/FailFastNotifier.java
index 735c2ce..d9d7307 100644
--- a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/FailFastNotifier.java
+++ b/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/FailFastNotifier.java
@@ -34,6 +34,7 @@ public class FailFastNotifier
implements IInvokedMethodListener
{
+ @Override
public void beforeInvocation( IInvokedMethod iInvokedMethod, ITestResult iTestResult )
{
if ( FailFastEventsSingleton.getInstance().isSkipAfterFailure() )
@@ -43,6 +44,7 @@ public class FailFastNotifier
}
}
+ @Override
public void afterInvocation( IInvokedMethod iInvokedMethod, ITestResult iTestResult )
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/GroupMatcherMethodSelector.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/GroupMatcherMethodSelector.java b/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/GroupMatcherMethodSelector.java
index db3bb41..0017b54 100644
--- a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/GroupMatcherMethodSelector.java
+++ b/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/GroupMatcherMethodSelector.java
@@ -46,6 +46,7 @@ public class GroupMatcherMethodSelector
private Map<ITestNGMethod, Boolean> answers = new HashMap<ITestNGMethod, Boolean>();
+ @Override
public boolean includeMethod( IMethodSelectorContext context, ITestNGMethod method, boolean isTestMethod )
{
Boolean result = answers.get( method );
@@ -65,6 +66,7 @@ public class GroupMatcherMethodSelector
return result;
}
+ @Override
public void setTestMethods( List<ITestNGMethod> testMethods )
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/MethodSelector.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/MethodSelector.java b/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/MethodSelector.java
index 9c601bb..d55c079 100644
--- a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/MethodSelector.java
+++ b/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/MethodSelector.java
@@ -38,10 +38,12 @@ public class MethodSelector
{
private static volatile TestListResolver testListResolver = null;
+ @Override
public void setTestMethods( List arg0 )
{
}
+ @Override
public boolean includeMethod( IMethodSelectorContext context, ITestNGMethod testngMethod, boolean isTestMethod )
{
return testngMethod.isBeforeClassConfiguration() || testngMethod.isBeforeGroupsConfiguration()
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
index f95c0f2..0b52c4d 100644
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
@@ -335,6 +335,7 @@ final class TestNGExecutor
return new Stoppable()
{
+ @Override
public void fireStopEvent()
{
if ( countDownToZero( currentFaultCount ) )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java
index 56f98de..a8a3837 100644
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java
@@ -90,6 +90,7 @@ public class TestNGProvider
mainCliOptions = bootParams.getMainCliOptions();
}
+ @Override
public RunResult invoke( Object forkTestSet )
throws TestSetFailedException
{
@@ -173,6 +174,7 @@ public class TestNGProvider
{
commandsReader.addShutdownListener( new CommandListener()
{
+ @Override
public void update( Command command )
{
testsToRun.markTestSetFinished();
@@ -184,6 +186,7 @@ public class TestNGProvider
{
commandsReader.addSkipNextTestsListener( new CommandListener()
{
+ @Override
public void update( Command command )
{
FailFastEventsSingleton.getInstance().setSkipOnNextTest();
@@ -206,6 +209,7 @@ public class TestNGProvider
reporterConfiguration.getReportsDirectory(), getSkipAfterFailureCount() );
}
+ @Override
@SuppressWarnings( "unchecked" )
public Iterable<Class<?>> getSuites()
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGReporter.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGReporter.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGReporter.java
index c6790be..d7d5ff9 100644
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGReporter.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGReporter.java
@@ -62,6 +62,7 @@ public class TestNGReporter
this.reporter = reportManager;
}
+ @Override
public void onTestStart( ITestResult result )
{
String group = groupString( result.getMethod().getGroups(), result.getTestClass().getName() );
@@ -74,12 +75,14 @@ public class TestNGReporter
return result.getTestClass().getName();
}
+ @Override
public void onTestSuccess( ITestResult result )
{
ReportEntry report = new SimpleReportEntry( getSource( result ), getUserFriendlyTestName( result ) );
reporter.testSucceeded( report );
}
+ @Override
public void onTestFailure( ITestResult result )
{
ReportEntry report = withException( getSource( result ), getUserFriendlyTestName( result ),
@@ -96,6 +99,7 @@ public class TestNGReporter
return result.getName() + "(" + result.getTestClass().getName() + ")";
}
+ @Override
public void onTestSkipped( ITestResult result )
{
Throwable t = result.getThrowable();
@@ -104,6 +108,7 @@ public class TestNGReporter
reporter.testSkipped( report );
}
+ @Override
public void onTestFailedButWithinSuccessPercentage( ITestResult result )
{
ReportEntry report = withException( getSource( result ), getUserFriendlyTestName( result ),
@@ -114,22 +119,26 @@ public class TestNGReporter
reporter.testSucceeded( report );
}
+ @Override
public void onStart( ITestContext context )
{
}
+ @Override
public void onFinish( ITestContext context )
{
}
+ @Override
public void onStart( ISuite suite )
{
}
+ @Override
public void onFinish( ISuite suite )
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java
index a471f0d..c639ce9 100644
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/AbstractDirectConfigurator.java
@@ -51,6 +51,7 @@ public abstract class AbstractDirectConfigurator
this.setters = options;
}
+ @Override
public void configure( TestNG testng, Map<String, String> options )
throws TestSetFailedException
{
@@ -65,6 +66,7 @@ public abstract class AbstractDirectConfigurator
testng.setListenerClasses( loadListenerClasses( listeners ) );
}
+ @Override
public void configure( XmlSuite suite, Map<String, String> options )
throws TestSetFailedException
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG60Configurator.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG60Configurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG60Configurator.java
index e374001..1e4859f 100644
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG60Configurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG60Configurator.java
@@ -34,6 +34,7 @@ public class TestNG60Configurator
extends TestNG5143Configurator
{
+ @Override
Map<String, Object> getConvertedOptions( Map<String, String> options )
throws TestSetFailedException
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
index 91ade69..b819298 100755
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
@@ -49,6 +49,7 @@ import static org.apache.maven.surefire.testng.conf.AbstractDirectConfigurator.l
public class TestNGMapConfigurator
implements Configurator
{
+ @Override
public void configure( TestNG testng, Map<String, String> options )
throws TestSetFailedException
{
@@ -56,6 +57,7 @@ public class TestNGMapConfigurator
testng.configure( convertedOptions );
}
+ @Override
public void configure( XmlSuite suite, Map<String, String> options )
throws TestSetFailedException
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java
----------------------------------------------------------------------
diff --git a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java
index 96df5b8..cd94afd 100644
--- a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java
+++ b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java
@@ -159,6 +159,7 @@ public final class ReportTestCase
/**
* {@inheritDoc}
*/
+ @Override
public String toString()
{
return fullName;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestSuite.java
----------------------------------------------------------------------
diff --git a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestSuite.java b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestSuite.java
index a76b2ee..76420ba 100644
--- a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestSuite.java
+++ b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestSuite.java
@@ -196,6 +196,7 @@ public final class ReportTestSuite
/**
* {@inheritDoc}
*/
+ @Override
public String toString()
{
return fullClassName + " [" + getNumberOfTests() + "/" + getNumberOfFailures() + "/"
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
----------------------------------------------------------------------
diff --git a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
index c28b4b1..0d48e98 100644
--- a/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
+++ b/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
@@ -117,6 +117,7 @@ public final class TestSuiteXmlParser
/**
* {@inheritDoc}
*/
+ @Override
public void startElement( String uri, String localName, String qName, Attributes attributes )
throws SAXException
{
@@ -224,6 +225,7 @@ public final class TestSuiteXmlParser
/**
* {@inheritDoc}
*/
+ @Override
public void endElement( String uri, String localName, String qName )
throws SAXException
{
@@ -254,6 +256,7 @@ public final class TestSuiteXmlParser
/**
* {@inheritDoc}
*/
+ @Override
public void characters( char[] ch, int start, int length )
throws SAXException
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/ReportTestCaseTest.java
----------------------------------------------------------------------
diff --git a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/ReportTestCaseTest.java b/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/ReportTestCaseTest.java
index a0abbfa..ce7f2f3 100644
--- a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/ReportTestCaseTest.java
+++ b/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/ReportTestCaseTest.java
@@ -32,6 +32,7 @@ public class ReportTestCaseTest
/**
* {@inheritDoc}
*/
+ @Override
protected void setUp()
throws Exception
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/ReportTestSuiteTest.java
----------------------------------------------------------------------
diff --git a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/ReportTestSuiteTest.java b/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/ReportTestSuiteTest.java
index b9940b2..729b60b 100644
--- a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/ReportTestSuiteTest.java
+++ b/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/ReportTestSuiteTest.java
@@ -35,6 +35,7 @@ public class ReportTestSuiteTest
/**
* {@inheritDoc}
*/
+ @Override
protected void setUp()
throws Exception
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
----------------------------------------------------------------------
diff --git a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java b/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
index 0fad166..bfd9d49 100644
--- a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
+++ b/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportParserTest.java
@@ -46,6 +46,7 @@ public class SurefireReportParserTest
/**
* {@inheritDoc}
*/
+ @Override
protected void setUp()
throws Exception
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParserTest.java
----------------------------------------------------------------------
diff --git a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParserTest.java b/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParserTest.java
index 6e0a325..9e03f4a 100644
--- a/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParserTest.java
+++ b/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParserTest.java
@@ -53,29 +53,35 @@ public class TestSuiteXmlParserTest
{
consoleLogger = new ConsoleLogger()
{
+ @Override
public void debug( String message )
{
}
+ @Override
public void info( String message )
{
}
+ @Override
public void warning( String message )
{
loggedErrors.add( message );
}
+ @Override
public void error( String message )
{
loggedErrors.add( message );
}
+ @Override
public void error( String message, Throwable t )
{
loggedErrors.add( message );
}
+ @Override
public void error( Throwable t )
{
loggedErrors.add( t.getLocalizedMessage() );
[4/4] maven-surefire git commit: [SUREFIRE-1363] Java 1.6 features
@Override and Charset
Posted by ti...@apache.org.
[SUREFIRE-1363] Java 1.6 features @Override and Charset
Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/11511f4a
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/11511f4a
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/11511f4a
Branch: refs/heads/SUREFIRE-1363
Commit: 11511f4a943b836bb82afcefb1d8fa715e2c634e
Parents: 0039f56
Author: Tibor17 <ti...@lycos.com>
Authored: Sat Apr 15 02:56:34 2017 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Sat Apr 15 02:56:36 2017 +0200
----------------------------------------------------------------------
.../plugin/failsafe/IntegrationTestMojo.java | 50 +++++++++++++++++++
.../maven/plugin/failsafe/VerifyMojo.java | 17 +++++++
.../xmlsummary/FailsafeSummaryXmlUtils.java | 2 +-
.../failsafe/MarshallerUnmarshallerTest.java | 2 +-
.../maven/plugin/failsafe/RunResultTest.java | 2 +-
.../plugin/surefire/AbstractSurefireMojo.java | 30 ++++++++++++
.../plugin/surefire/SurefireProperties.java | 2 +
.../booterclient/ChecksumCalculator.java | 14 +++---
.../surefire/booterclient/ForkStarter.java | 16 ++++--
.../OutputStreamFlushableCommandline.java | 2 +
.../lazytestprovider/TestLessInputStream.java | 16 ++++++
.../TestProvidingInputStream.java | 4 ++
.../output/DeserializedStacktraceWriter.java | 4 ++
.../booterclient/output/ForkClient.java | 1 +
.../output/NativeStdErrStreamConsumer.java | 1 +
.../output/ThreadedStreamConsumer.java | 3 ++
.../surefire/log/PluginConsoleLogger.java | 6 +++
.../report/ConsoleOutputFileReporter.java | 4 ++
.../surefire/report/DefaultReporterFactory.java | 2 +
.../surefire/report/DirectConsoleOutput.java | 4 ++
.../report/NullConsoleOutputReceiver.java | 4 ++
.../surefire/report/StatelessXmlReporter.java | 29 ++++-------
.../surefire/report/TestSetRunListener.java | 16 ++++++
.../Utf8RecodingDeferredFileOutputStream.java | 10 ++--
.../surefire/report/WrappedReportEntry.java | 7 +++
.../booterclient/MockNotifiableTestStream.java | 4 ++
.../surefire/booterclient/MockReporter.java | 16 ++++++
.../TestSetMockReporterFactory.java | 1 +
.../TestProvidingInputStreamTest.java | 3 ++
.../report/DefaultReporterFactoryTest.java | 10 ++++
.../report/StatelessXmlReporterTest.java | 7 +--
.../maven/surefire/spi/CustomizedImpl.java | 1 +
.../apache/maven/surefire/spi/DefaultImpl.java | 1 +
.../org/apache/maven/surefire/spi/SPImpl1.java | 1 +
.../org/apache/maven/surefire/spi/SPImpl2.java | 1 +
.../maven/plugin/surefire/SurefirePlugin.java | 51 ++++++++++++++++++++
.../plugin/surefire/SurefirePluginTest.java | 2 +
.../report/AbstractSurefireReportMojo.java | 4 ++
.../surefire/report/FailsafeReportMojo.java | 6 +++
.../surefire/report/PluginConsoleLogger.java | 6 +++
.../surefire/report/SurefireReportMojo.java | 4 ++
.../stubs/SurefireRepMavenProjectStub.java | 1 +
.../stubs/SurefireRepMavenProjectStub2.java | 1 +
.../runorder/RunEntryStatisticsMap.java | 4 ++
.../maven/surefire/NonAbstractClassFilter.java | 1 +
.../maven/surefire/SpecificTestClassFilter.java | 1 +
.../surefire/booter/BaseProviderFactory.java | 26 ++++++++++
.../maven/surefire/booter/CommandReader.java | 5 ++
.../surefire/booter/ForkingReporterFactory.java | 2 +
.../surefire/booter/ForkingRunListener.java | 18 +++++++
.../surefire/booter/MasterProcessCommand.java | 34 +++++--------
.../surefire/booter/SurefireReflector.java | 1 +
.../surefire/providerapi/AbstractProvider.java | 1 +
.../surefire/report/CategorizedReportEntry.java | 3 ++
.../surefire/report/ConsoleOutputCapture.java | 6 +++
.../report/DefaultDirectConsoleReporter.java | 2 +
.../report/LegacyPojoStackTraceWriter.java | 4 ++
.../surefire/report/SimpleReportEntry.java | 10 ++++
.../apache/maven/surefire/suite/RunResult.java | 2 +
.../surefire/testset/TestListResolver.java | 10 ++++
.../maven/surefire/util/CloseableIterator.java | 2 +-
.../surefire/util/DefaultDirectoryScanner.java | 1 +
.../util/DefaultRunOrderCalculator.java | 3 ++
.../maven/surefire/util/DefaultScanResult.java | 5 ++
.../apache/maven/surefire/util/RunOrder.java | 1 +
.../apache/maven/surefire/util/TestsToRun.java | 2 +
.../surefire/util/internal/ByteBuffer.java | 1 +
.../util/internal/DaemonThreadFactory.java | 2 +
.../surefire/util/internal/DumpFileUtils.java | 4 +-
.../surefire/util/internal/StringUtils.java | 20 ++++----
.../maven/surefire/util/internal/UrlUtils.java | 51 +++++++-------------
.../surefire/booter/SurefireReflectorTest.java | 2 +
.../report/LegacyPojoStackTraceWriterTest.java | 1 +
.../maven/surefire/util/UrlUtilsTest.java | 1 +
.../util/internal/ConcurrencyUtilsTest.java | 1 +
.../apache/maven/surefire/booter/Classpath.java | 3 ++
.../maven/surefire/booter/ForkedBooter.java | 4 ++
.../surefire/booter/IsolatedClassLoader.java | 3 ++
.../maven/surefire/booter/LazyTestsToRun.java | 7 +++
.../surefire/booter/PropertiesWrapper.java | 1 +
.../maven/surefire/booter/ProviderFactory.java | 3 ++
.../maven/surefire/booter/TypeEncodedValue.java | 9 ++--
.../surefire/booter/CommandReaderTest.java | 6 ++-
.../org/apache/maven/surefire/booter/Foo.java | 7 +++
.../surefire/group/match/AndGroupMatcher.java | 2 +
.../group/match/InverseGroupMatcher.java | 3 ++
.../surefire/group/match/JoinGroupMatcher.java | 1 +
.../surefire/group/match/OrGroupMatcher.java | 2 +
.../group/match/SingleGroupMatcher.java | 3 ++
.../maven/surefire/its/ForkModeTestNGIT.java | 1 +
.../its/fixture/FailsafeOutputValidator.java | 1 +
.../surefire/its/fixture/OutputValidator.java | 2 +-
...urefire1082ParallelJUnitParameterizedIT.java | 2 +
.../log/api/ConsoleLoggerDecorator.java | 2 +-
.../surefire/log/api/NullConsoleLogger.java | 6 +++
.../surefire/log/api/PrintStreamLogger.java | 2 +-
.../report/ClassNameStackTraceFilter.java | 1 +
.../surefire/report/NullStackTraceFilter.java | 1 +
.../surefire/report/PojoStackTraceWriter.java | 4 ++
.../surefire/report/RunnableTestClass1.java | 1 +
.../surefire/report/RunnableTestClass2.java | 1 +
.../common/junit3/JUnit3TestChecker.java | 1 +
.../common/junit3/JUnit3TestCheckerTest.java | 2 +
.../surefire/common/junit4/JUnit4Reflector.java | 2 +
.../common/junit4/JUnit4RunListener.java | 4 ++
.../common/junit4/JUnit4StackTraceWriter.java | 4 ++
.../common/junit4/JUnit4TestChecker.java | 1 +
.../maven/surefire/junit4/MockReporter.java | 9 ++++
.../common/junit4/JUnit4RunListenerTest.java | 1 +
.../surefire/junit4/JUnit4TestCheckerTest.java | 2 +
.../common/junit48/JUnit46StackTraceWriter.java | 2 +
.../common/junit48/JUnit48TestChecker.java | 1 +
.../maven/surefire/junit/JUnit3Provider.java | 2 +
.../maven/surefire/junit/JUnitTestSet.java | 2 +
.../surefire/junit/PojoAndJUnit3Checker.java | 1 +
.../maven/surefire/junit/PojoTestSet.java | 2 +
.../junit/TestListenerInvocationHandler.java | 3 ++
.../maven/surefire/junit/JUnitTestSetTest.java | 9 ++++
.../maven/surefire/junit4/JUnit4Provider.java | 4 ++
.../surefire/junitcore/AsynchronousRunner.java | 2 +
.../junitcore/ConcurrentRunListener.java | 10 ++++
.../surefire/junitcore/JUnitCoreProvider.java | 4 ++
.../junitcore/JUnitCoreRunListener.java | 1 +
.../junitcore/NonConcurrentRunListener.java | 2 +
.../surefire/junitcore/SynchronousRunner.java | 2 +
.../maven/surefire/junitcore/TestMethod.java | 1 +
.../pc/AbstractThreadPoolStrategy.java | 1 +
.../surefire/junitcore/pc/InvokerStrategy.java | 1 +
.../surefire/junitcore/pc/NullBalancer.java | 3 ++
.../surefire/junitcore/pc/ParallelComputer.java | 2 +
.../maven/surefire/junitcore/pc/Scheduler.java | 4 ++
.../junitcore/pc/ThreadResourcesBalancer.java | 3 ++
.../junitcore/DefaultConsoleReporter.java | 6 +++
.../pc/ParallelComputerBuilderTest.java | 2 +
.../surefire/junitcore/pc/RangeMatcher.java | 2 +
.../junitcore/pc/SchedulingStrategiesTest.java | 1 +
.../surefire/testng/utils/FailFastListener.java | 7 +++
.../surefire/testng/utils/FailFastNotifier.java | 2 +
.../utils/GroupMatcherMethodSelector.java | 2 +
.../surefire/testng/utils/MethodSelector.java | 2 +
.../maven/surefire/testng/TestNGExecutor.java | 1 +
.../maven/surefire/testng/TestNGProvider.java | 4 ++
.../maven/surefire/testng/TestNGReporter.java | 9 ++++
.../testng/conf/AbstractDirectConfigurator.java | 2 +
.../testng/conf/TestNG60Configurator.java | 1 +
.../testng/conf/TestNGMapConfigurator.java | 2 +
.../plugins/surefire/report/ReportTestCase.java | 1 +
.../surefire/report/ReportTestSuite.java | 1 +
.../surefire/report/TestSuiteXmlParser.java | 3 ++
.../surefire/report/ReportTestCaseTest.java | 1 +
.../surefire/report/ReportTestSuiteTest.java | 1 +
.../report/SurefireReportParserTest.java | 1 +
.../surefire/report/TestSuiteXmlParserTest.java | 6 +++
153 files changed, 699 insertions(+), 119 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 ddfbe7d..1ad317f 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
@@ -350,11 +350,13 @@ public class IntegrationTestMojo
@Parameter( property = "failsafe.shutdown", defaultValue = "testset" )
private String shutdown;
+ @Override
protected int getRerunFailingTestsCount()
{
return rerunFailingTestsCount;
}
+ @Override
@SuppressWarnings( "unchecked" )
protected void handleSummary( RunResult summary, Exception firstForkException )
throws MojoExecutionException, MojoFailureException
@@ -418,17 +420,20 @@ public class IntegrationTestMojo
}
}
+ @Override
@SuppressWarnings( "deprecation" )
protected boolean isSkipExecution()
{
return isSkip() || isSkipTests() || isSkipITs() || isSkipExec();
}
+ @Override
protected String getPluginName()
{
return "failsafe";
}
+ @Override
protected String[] getDefaultIncludes()
{
return new String[]{ "**/IT*.java", "**/*IT.java", "**/*ITCase.java" };
@@ -440,11 +445,13 @@ public class IntegrationTestMojo
return "https://maven.apache.org/surefire/maven-failsafe-plugin/xsd/failsafe-test-report.xsd";
}
+ @Override
public boolean isSkipTests()
{
return skipTests;
}
+ @Override
public void setSkipTests( boolean skipTests )
{
this.skipTests = skipTests;
@@ -460,6 +467,7 @@ public class IntegrationTestMojo
this.skipITs = skipITs;
}
+ @Override
@SuppressWarnings( "deprecation" )
@Deprecated
public boolean isSkipExec()
@@ -467,6 +475,7 @@ public class IntegrationTestMojo
return skipExec;
}
+ @Override
@SuppressWarnings( "deprecation" )
@Deprecated
public void setSkipExec( boolean skipExec )
@@ -474,31 +483,37 @@ public class IntegrationTestMojo
this.skipExec = skipExec;
}
+ @Override
public boolean isSkip()
{
return skip;
}
+ @Override
public void setSkip( boolean skip )
{
this.skip = skip;
}
+ @Override
public File getBasedir()
{
return basedir;
}
+ @Override
public void setBasedir( File basedir )
{
this.basedir = basedir;
}
+ @Override
public File getTestClassesDirectory()
{
return testClassesDirectory;
}
+ @Override
public void setTestClassesDirectory( File testClassesDirectory )
{
this.testClassesDirectory = testClassesDirectory;
@@ -509,6 +524,7 @@ public class IntegrationTestMojo
* {@link #useSystemClassLoader} is ignored and the {@link org.apache.maven.surefire.booter.IsolatedClassLoader} is
* used instead. See the resolution of {@link #getClassLoaderConfiguration() ClassLoaderConfiguration}.
*/
+ @Override
public File getClassesDirectory()
{
File artifact = getProject().getArtifact().getFile();
@@ -516,6 +532,7 @@ public class IntegrationTestMojo
return isDefaultClsDir ? ( isJarArtifact( artifact ) ? artifact : defaultClassesDirectory ) : classesDirectory;
}
+ @Override
public void setClassesDirectory( File classesDirectory )
{
this.classesDirectory = toAbsoluteCanonical( classesDirectory );
@@ -526,21 +543,25 @@ public class IntegrationTestMojo
this.defaultClassesDirectory = toAbsoluteCanonical( defaultClassesDirectory );
}
+ @Override
public File getReportsDirectory()
{
return reportsDirectory;
}
+ @Override
public void setReportsDirectory( File reportsDirectory )
{
this.reportsDirectory = reportsDirectory;
}
+ @Override
public String getTest()
{
return test;
}
+ @Override
public void setTest( String test )
{
this.test = test;
@@ -556,101 +577,121 @@ public class IntegrationTestMojo
this.summaryFile = summaryFile;
}
+ @Override
public boolean isPrintSummary()
{
return printSummary;
}
+ @Override
public void setPrintSummary( boolean printSummary )
{
this.printSummary = printSummary;
}
+ @Override
public String getReportFormat()
{
return reportFormat;
}
+ @Override
public void setReportFormat( String reportFormat )
{
this.reportFormat = reportFormat;
}
+ @Override
public boolean isUseFile()
{
return useFile;
}
+ @Override
public void setUseFile( boolean useFile )
{
this.useFile = useFile;
}
+ @Override
public String getDebugForkedProcess()
{
return debugForkedProcess;
}
+ @Override
public void setDebugForkedProcess( String debugForkedProcess )
{
this.debugForkedProcess = debugForkedProcess;
}
+ @Override
public int getForkedProcessTimeoutInSeconds()
{
return forkedProcessTimeoutInSeconds;
}
+ @Override
public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds )
{
this.forkedProcessTimeoutInSeconds = forkedProcessTimeoutInSeconds;
}
+ @Override
public int getForkedProcessExitTimeoutInSeconds()
{
return forkedProcessExitTimeoutInSeconds;
}
+ @Override
public void setForkedProcessExitTimeoutInSeconds( int forkedProcessExitTimeoutInSeconds )
{
this.forkedProcessExitTimeoutInSeconds = forkedProcessExitTimeoutInSeconds;
}
+ @Override
public double getParallelTestsTimeoutInSeconds()
{
return parallelTestsTimeoutInSeconds;
}
+ @Override
public void setParallelTestsTimeoutInSeconds( double parallelTestsTimeoutInSeconds )
{
this.parallelTestsTimeoutInSeconds = parallelTestsTimeoutInSeconds;
}
+ @Override
public double getParallelTestsTimeoutForcedInSeconds()
{
return parallelTestsTimeoutForcedInSeconds;
}
+ @Override
public void setParallelTestsTimeoutForcedInSeconds( double parallelTestsTimeoutForcedInSeconds )
{
this.parallelTestsTimeoutForcedInSeconds = parallelTestsTimeoutForcedInSeconds;
}
+ @Override
public boolean isUseSystemClassLoader()
{
return useSystemClassLoader;
}
+ @Override
public void setUseSystemClassLoader( boolean useSystemClassLoader )
{
this.useSystemClassLoader = useSystemClassLoader;
}
+ @Override
public boolean isUseManifestOnlyJar()
{
return useManifestOnlyJar;
}
+ @Override
public void setUseManifestOnlyJar( boolean useManifestOnlyJar )
{
this.useManifestOnlyJar = useManifestOnlyJar;
@@ -668,27 +709,32 @@ public class IntegrationTestMojo
// ignore
}
+ @Override
protected void addPluginSpecificChecksumItems( ChecksumCalculator checksum )
{
checksum.add( skipITs );
checksum.add( summaryFile );
}
+ @Override
public Boolean getFailIfNoSpecifiedTests()
{
return failIfNoSpecifiedTests;
}
+ @Override
public void setFailIfNoSpecifiedTests( boolean failIfNoSpecifiedTests )
{
this.failIfNoSpecifiedTests = failIfNoSpecifiedTests;
}
+ @Override
public int getSkipAfterFailureCount()
{
return skipAfterFailureCount;
}
+ @Override
public String getShutdown()
{
return shutdown;
@@ -706,22 +752,26 @@ public class IntegrationTestMojo
this.includes = includes;
}
+ @Override
public File[] getSuiteXmlFiles()
{
return suiteXmlFiles.clone();
}
+ @Override
@SuppressWarnings( "UnusedDeclaration" )
public void setSuiteXmlFiles( File[] suiteXmlFiles )
{
this.suiteXmlFiles = suiteXmlFiles.clone();
}
+ @Override
public String getRunOrder()
{
return runOrder;
}
+ @Override
@SuppressWarnings( "UnusedDeclaration" )
public void setRunOrder( String runOrder )
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 a56d521..0ad7f80 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
@@ -161,6 +161,7 @@ public class VerifyMojo
private volatile PluginConsoleLogger consoleLogger;
+ @Override
public void execute()
throws MojoExecutionException, MojoFailureException
{
@@ -248,11 +249,13 @@ public class VerifyMojo
return null;
}
+ @Override
public boolean isSkipTests()
{
return skipTests;
}
+ @Override
public void setSkipTests( boolean skipTests )
{
this.skipTests = skipTests;
@@ -268,73 +271,87 @@ public class VerifyMojo
this.skipITs = skipITs;
}
+ @Override
@Deprecated
public boolean isSkipExec()
{
return skipExec;
}
+ @Override
@Deprecated
public void setSkipExec( boolean skipExec )
{
this.skipExec = skipExec;
}
+ @Override
public boolean isSkip()
{
return skip;
}
+ @Override
public void setSkip( boolean skip )
{
this.skip = skip;
}
+ @Override
public boolean isTestFailureIgnore()
{
return testFailureIgnore;
}
+ @Override
public void setTestFailureIgnore( boolean testFailureIgnore )
{
this.testFailureIgnore = testFailureIgnore;
}
+ @Override
public File getBasedir()
{
return basedir;
}
+ @Override
public void setBasedir( File basedir )
{
this.basedir = basedir;
}
+ @Override
public File getTestClassesDirectory()
{
return testClassesDirectory;
}
+ @Override
public void setTestClassesDirectory( File testClassesDirectory )
{
this.testClassesDirectory = testClassesDirectory;
}
+ @Override
public File getReportsDirectory()
{
return reportsDirectory;
}
+ @Override
public void setReportsDirectory( File reportsDirectory )
{
this.reportsDirectory = reportsDirectory;
}
+ @Override
public Boolean getFailIfNoTests()
{
return failIfNoTests;
}
+ @Override
public void setFailIfNoTests( boolean failIfNoTests )
{
this.failIfNoTests = failIfNoTests;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/xmlsummary/FailsafeSummaryXmlUtils.java
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/xmlsummary/FailsafeSummaryXmlUtils.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/xmlsummary/FailsafeSummaryXmlUtils.java
index 7993a05..a2abf27 100644
--- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/xmlsummary/FailsafeSummaryXmlUtils.java
+++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/xmlsummary/FailsafeSummaryXmlUtils.java
@@ -1 +1 @@
-package org.apache.maven.plugin.failsafe.xmlsummary;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.maven.surefire.suite.RunResult;
import javax.xml.bind.JAXBException;
import java.io.File;
import java.io.FileOutp
utStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
/**
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.20
*/
public final class FailsafeSummaryXmlUtils
{
public static final Charset UTF8 = Charset.forName( "UTF-8" );
private FailsafeSummaryXmlUtils()
{
throw new IllegalStateException( "No instantiable constructor." );
}
public static RunResult toRunResult( File failsafeSummaryXml ) throws JAXBException
{
FailsafeSummary failsafeSummary = JAXB.unmarshal( failsafeSummaryXml, FailsafeSummary.class );
return new RunResult( failsafeSummary.getCompleted(), failsafeSummary.getErrors(),
failsafeSummary.getFailures(), failsafeSummary.getSkipped(),
failsafeSummary.getFailureMessage(), failsafeSummary.isTimeout()
);
}
public static void fromRunResultToFile( R
unResult fromRunResult, File toFailsafeSummaryXml )
throws JAXBException, IOException
{
fromRunResultToFile( fromRunResult, toFailsafeSummaryXml, UTF8 );
}
public static void fromRunResultToFile( RunResult fromRunResult, File toFailsafeSummaryXml, Charset encoding )
throws JAXBException, IOException
{
FailsafeSummary summary = new FailsafeSummary();
summary.setCompleted( fromRunResult.getCompletedCount() );
summary.setFailureMessage( fromRunResult.getFailure() );
summary.setErrors( fromRunResult.getErrors() );
summary.setFailures( fromRunResult.getFailures() );
summary.setSkipped( fromRunResult.getSkipped() );
summary.setTimeout( fromRunResult.isTimeout() );
summary.setResult( ErrorType.fromValue( fromRunResult.getFailsafeCode() ) );
String unmarshalled = JAXB.marshal( summary, encoding );
OutputStreamWriter os = new OutputStreamWriter( new FileOutputStr
eam( toFailsafeSummaryXml ), encoding );
try
{
os.write( unmarshalled );
os.flush();
}
finally
{
os.close();
}
}
public static void writeSummary( RunResult mergedSummary, File mergedSummaryFile, boolean inProgress,
Charset encoding )
throws IOException, JAXBException
{
if ( !mergedSummaryFile.getParentFile().isDirectory() )
{
//noinspection ResultOfMethodCallIgnored
mergedSummaryFile.getParentFile().mkdirs();
}
if ( mergedSummaryFile.exists() && inProgress )
{
RunResult runResult = toRunResult( mergedSummaryFile );
mergedSummary = mergedSummary.aggregate( runResult );
}
fromRunResultToFile( mergedSummary, mergedSummaryFile, encoding );
}
}
\ No newline at end of file
+package org.apache.maven.plugin.failsafe.xmlsummary;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.maven.surefire.suite.RunResult;
import javax.xml.bind.JAXBException;
import java.io.File;
import java.io.FileOutp
utStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8;
/**
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.20
*/
public final class FailsafeSummaryXmlUtils
{
private FailsafeSummaryXmlUtils()
{
throw new IllegalStateException( "No instantiable constructor." );
}
public static RunResult toRunResult( File failsafeSummaryXml ) throws JAXBException
{
FailsafeSummary failsafeSummary = JAXB.unmarshal( failsafeSummaryXml, FailsafeSummary.class );
return new RunResult( failsafeSummary.getCompleted(), failsafeSummary.getErrors(),
failsafeSummary.getFailures(), failsafeSummary.getSkipped(),
failsafeSummary.getFailureMessage(), failsafeSummary.isTimeout()
);
}
public static void fromRunResultToF
ile( RunResult fromRunResult, File toFailsafeSummaryXml )
throws JAXBException, IOException
{
fromRunResultToFile( fromRunResult, toFailsafeSummaryXml, UTF_8 );
}
public static void fromRunResultToFile( RunResult fromRunResult, File toFailsafeSummaryXml, Charset encoding )
throws JAXBException, IOException
{
FailsafeSummary summary = new FailsafeSummary();
summary.setCompleted( fromRunResult.getCompletedCount() );
summary.setFailureMessage( fromRunResult.getFailure() );
summary.setErrors( fromRunResult.getErrors() );
summary.setFailures( fromRunResult.getFailures() );
summary.setSkipped( fromRunResult.getSkipped() );
summary.setTimeout( fromRunResult.isTimeout() );
summary.setResult( ErrorType.fromValue( fromRunResult.getFailsafeCode() ) );
String unmarshalled = JAXB.marshal( summary, encoding );
OutputStreamWriter os = new OutputStreamWriter( new FileOu
tputStream( toFailsafeSummaryXml ), encoding );
try
{
os.write( unmarshalled );
os.flush();
}
finally
{
os.close();
}
}
public static void writeSummary( RunResult mergedSummary, File mergedSummaryFile, boolean inProgress,
Charset encoding )
throws IOException, JAXBException
{
if ( !mergedSummaryFile.getParentFile().isDirectory() )
{
//noinspection ResultOfMethodCallIgnored
mergedSummaryFile.getParentFile().mkdirs();
}
if ( mergedSummaryFile.exists() && inProgress )
{
RunResult runResult = toRunResult( mergedSummaryFile );
mergedSummary = mergedSummary.aggregate( runResult );
}
fromRunResultToFile( mergedSummary, mergedSummaryFile, encoding );
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java
index 4386d71..c9e2cd4 100644
--- a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java
+++ b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java
@@ -1 +1 @@
-package org.apache.maven.plugin.failsafe;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.maven.plugin.failsafe.xmlsummary.FailsafeSummary;
import org.apache.maven.plugin.failsafe.xmlsummary.FailsafeSummaryXmlUtils;
import org.apache.maven.plugin.failsafe.xmlsummary.JAXB;
import org.junit.Test;
import java.io.File;
import java.io.FileWriter;
import java.util.List;
import static org.apache.maven.plugin.failsafe.xmlsummary.ErrorType.FAILURE;
import static org.fest.assertions.Assertions.assertThat;
public class MarshallerUnmarshallerTest
{
@Test
public void shouldUnmarshallExistingXmlFile() throws Exception
{
File xml = new File( "target/test-classes/org/apache/maven/plugin/failsafe/failsafe-summary.xml" );
FailsafeSummary summary = JAXB.unmarshal( xml, FailsafeSummary.class );
assertThat( summary.getCompleted() )
.isEqualTo( 7 );
assertThat( summary.getErrors() )
.isEqualTo( 1 );
assertThat( summary.getFailures() )
.isEqualTo( 2 );
assertThat( summary.getSkipped() )
.isEqualTo( 3 );
assertThat( summary.getFailureMessage() )
.contains( "There
was an error in the forked processtest "
+ "subsystem#no method RuntimeException Hi There!"
);
assertThat( summary.getFailureMessage() )
.contains( "There was an error in the forked processtest "
+ "subsystem#no method RuntimeException Hi There!"
+ "\n\tat org.apache.maven.plugin.surefire.booterclient.ForkStarter"
+ ".awaitResultsDone(ForkStarter.java:489)"
);
List<String> exceptionMessages = summary.extractExceptionMessageLines();
assertThat( exceptionMessages )
.hasSize( 1 );
assertThat( exceptionMessages.get( 0 ) )
.isEqualTo( "ExecutionException There was an error in the forked processtest "
+ "subsystem#no method RuntimeException Hi There!"
);
summary.setFailureMessa
ge( null );
assertThat( summary.extractExceptionMessageLines() )
.isEmpty();
}
@Test
public void shouldEqualTwoSameXml() throws Exception
{
File xml = new File( "target/test-classes/org/apache/maven/plugin/failsafe/failsafe-summary.xml" );
FailsafeSummary summary1 = JAXB.unmarshal( xml, FailsafeSummary.class );
FailsafeSummary summary2 = JAXB.unmarshal( xml, FailsafeSummary.class );
assertThat( summary1 )
.isEqualTo( summary2 );
}
@Test
public void shouldMarshallAndUnmarshallSameXml() throws Exception
{
FailsafeSummary expected = new FailsafeSummary();
expected.setResult( FAILURE );
expected.setTimeout( true );
expected.setCompleted( 7 );
expected.setErrors( 1 );
expected.setFailures( 2 );
expected.setSkipped( 3 );
expected.setFailureMessage( "There was an error in the forked processtest "
+ "subsystem#no method RuntimeException Hi There!"
+ "\n\tat org.apache.maven.plugin.surefire.booterclient.ForkStarter"
+ ".awaitResultsDone(ForkStarter.java:489)"
);
File xml = File.createTempFile( "failsafe-summary", ".xml" );
String xmlText = JAXB.marshal( expected, FailsafeSummaryXmlUtils.UTF8 );
FileWriter fileWriter = new FileWriter( xml );
fileWriter.write( xmlText );
fileWriter.flush();
fileWriter.close();
FailsafeSummary actual = JAXB.unmarshal( xml, FailsafeSummary.class );
assertThat( actual )
.isEqualTo( expected );
List<String> exceptionMessages = actual.extractExceptionMessageLines();
assertThat( exceptionMessages )
.hasSize( 1 );
assertThat( exceptionMessages.get( 0 ) )
.isEqualTo( "There was an error in the forked
processtest "
+ "subsystem#no method RuntimeException Hi There!"
);
}
}
\ No newline at end of file
+package org.apache.maven.plugin.failsafe;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.maven.plugin.failsafe.xmlsummary.FailsafeSummary;
import org.apache.maven.plugin.failsafe.xmlsummary.JAXB;
import org.junit.T
est;
import java.io.File;
import java.io.FileWriter;
import java.util.List;
import static org.apache.maven.plugin.failsafe.xmlsummary.ErrorType.FAILURE;
import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8;
import static org.fest.assertions.Assertions.assertThat;
public class MarshallerUnmarshallerTest
{
@Test
public void shouldUnmarshallExistingXmlFile() throws Exception
{
File xml = new File( "target/test-classes/org/apache/maven/plugin/failsafe/failsafe-summary.xml" );
FailsafeSummary summary = JAXB.unmarshal( xml, FailsafeSummary.class );
assertThat( summary.getCompleted() )
.isEqualTo( 7 );
assertThat( summary.getErrors() )
.isEqualTo( 1 );
assertThat( summary.getFailures() )
.isEqualTo( 2 );
assertThat( summary.getSkipped() )
.isEqualTo( 3 );
assertThat( summary.getFailureMessage() )
.contains( "There was
an error in the forked processtest "
+ "subsystem#no method RuntimeException Hi There!"
);
assertThat( summary.getFailureMessage() )
.contains( "There was an error in the forked processtest "
+ "subsystem#no method RuntimeException Hi There!"
+ "\n\tat org.apache.maven.plugin.surefire.booterclient.ForkStarter"
+ ".awaitResultsDone(ForkStarter.java:489)"
);
List<String> exceptionMessages = summary.extractExceptionMessageLines();
assertThat( exceptionMessages )
.hasSize( 1 );
assertThat( exceptionMessages.get( 0 ) )
.isEqualTo( "ExecutionException There was an error in the forked processtest "
+ "subsystem#no method RuntimeException Hi There!"
);
summary.setFailureMessage(
null );
assertThat( summary.extractExceptionMessageLines() )
.isEmpty();
}
@Test
public void shouldEqualTwoSameXml() throws Exception
{
File xml = new File( "target/test-classes/org/apache/maven/plugin/failsafe/failsafe-summary.xml" );
FailsafeSummary summary1 = JAXB.unmarshal( xml, FailsafeSummary.class );
FailsafeSummary summary2 = JAXB.unmarshal( xml, FailsafeSummary.class );
assertThat( summary1 )
.isEqualTo( summary2 );
}
@Test
public void shouldMarshallAndUnmarshallSameXml() throws Exception
{
FailsafeSummary expected = new FailsafeSummary();
expected.setResult( FAILURE );
expected.setTimeout( true );
expected.setCompleted( 7 );
expected.setErrors( 1 );
expected.setFailures( 2 );
expected.setSkipped( 3 );
expected.setFailureMessage( "There was an error in the forked processtest "
+ "subsystem#no method RuntimeException Hi There!"
+ "\n\tat org.apache.maven.plugin.surefire.booterclient.ForkStarter"
+ ".awaitResultsDone(ForkStarter.java:489)"
);
File xml = File.createTempFile( "failsafe-summary", ".xml" );
String xmlText = JAXB.marshal( expected, UTF_8 );
FileWriter fileWriter = new FileWriter( xml );
fileWriter.write( xmlText );
fileWriter.flush();
fileWriter.close();
FailsafeSummary actual = JAXB.unmarshal( xml, FailsafeSummary.class );
assertThat( actual )
.isEqualTo( expected );
List<String> exceptionMessages = actual.extractExceptionMessageLines();
assertThat( exceptionMessages )
.hasSize( 1 );
assertThat( exceptionMessages.get( 0 ) )
.isEqualTo( "There was an error in the forked processtest "
+ "subsystem#no method RuntimeException Hi There!"
);
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java
index fa7ac8e..39d47ce 100644
--- a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java
+++ b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java
@@ -1 +1 @@
-package org.apache.maven.plugin.failsafe;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.maven.plugin.failsafe.xmlsummary.FailsafeSummaryXmlUtils;
import org.apache.maven.surefire.suite.RunResult;
import org.junit.
Test;
import javax.xml.bind.JAXBException;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import static org.fest.assertions.Assertions.assertThat;
/**
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.20
*/
public class RunResultTest
{
@Test
public void testAggregatedValues()
{
RunResult simple = getSimpleAggregate();
assertThat( simple.getCompletedCount() )
.isEqualTo( 20 );
assertThat( simple.getErrors() )
.isEqualTo( 3 );
assertThat( simple.getFailures() )
.isEqualTo( 7 );
assertThat( simple.getSkipped() )
.isEqualTo( 4 );
assertThat( simple.getFlakes() )
.isEqualTo( 2 );
}
@Test
public void testSerialization()
throws IOException, JAXBException
{
writeReadCheck( getSimpleAggregate() );
}
@Test
public void test
Failures()
throws IOException, JAXBException
{
writeReadCheck( new RunResult( 0, 1, 2, 3, "stacktraceHere", false ) );
}
@Test
public void testSkipped()
throws IOException, JAXBException
{
writeReadCheck( new RunResult( 3, 2, 1, 0, null, true ) );
}
@Test
public void testAppendSerialization()
throws IOException, JAXBException
{
RunResult simpleAggregate = getSimpleAggregate();
RunResult additional = new RunResult( 2, 1, 2, 2, "msg " + ( (char) 0x0E01 ), true );
File summary = File.createTempFile( "failsafe", "test" );
FailsafeSummaryXmlUtils.writeSummary( simpleAggregate, summary, false, FailsafeSummaryXmlUtils.UTF8 );
FailsafeSummaryXmlUtils.writeSummary( additional, summary, true, FailsafeSummaryXmlUtils.UTF8 );
RunResult actual = FailsafeSummaryXmlUtils.toRunResult( summary );
//noinspection ResultOfMethodCallIgnored
summary.de
lete();
RunResult expected = simpleAggregate.aggregate( additional );
assertThat( expected.getCompletedCount() )
.isEqualTo( 22 );
assertThat( expected.getErrors() )
.isEqualTo( 4 );
assertThat( expected.getFailures() )
.isEqualTo( 9 );
assertThat( expected.getSkipped() )
.isEqualTo( 6 );
assertThat( expected.getFlakes() )
.isEqualTo( 2 );
assertThat( expected.getFailure() )
.isEqualTo( "msg " + ( (char) 0x0E01 ) );
assertThat( expected.isTimeout() )
.isTrue();
assertThat( actual )
.isEqualTo( expected );
}
@Test
public void shouldAcceptAliasCharset()
{
Charset charset1 = IntegrationTestMojo.toCharset( "UTF8" );
assertThat( charset1.name() ).isEqualTo( "UTF-8" );
Charset charset2 = IntegrationTestMojo.toCharset( "utf8" );
assert
That( charset2.name() ).isEqualTo( "UTF-8" );
}
private void writeReadCheck( RunResult expected )
throws IOException, JAXBException
{
File tmp = File.createTempFile( "test", "xml" );
FailsafeSummaryXmlUtils.fromRunResultToFile( expected, tmp );
RunResult actual = FailsafeSummaryXmlUtils.toRunResult( tmp );
//noinspection ResultOfMethodCallIgnored
tmp.delete();
assertThat( actual )
.isEqualTo( expected );
}
private RunResult getSimpleAggregate()
{
RunResult resultOne = new RunResult( 10, 1, 3, 2, 1 );
RunResult resultTwo = new RunResult( 10, 2, 4, 2, 1 );
return resultOne.aggregate( resultTwo );
}
}
\ No newline at end of file
+package org.apache.maven.plugin.failsafe;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.maven.plugin.failsafe.xmlsummary.FailsafeSummaryXmlUtils;
import org.apache.maven.surefire.suite.RunResult;
import org.junit.
Test;
import javax.xml.bind.JAXBException;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8;
import static org.fest.assertions.Assertions.assertThat;
/**
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.20
*/
public class RunResultTest
{
@Test
public void testAggregatedValues()
{
RunResult simple = getSimpleAggregate();
assertThat( simple.getCompletedCount() )
.isEqualTo( 20 );
assertThat( simple.getErrors() )
.isEqualTo( 3 );
assertThat( simple.getFailures() )
.isEqualTo( 7 );
assertThat( simple.getSkipped() )
.isEqualTo( 4 );
assertThat( simple.getFlakes() )
.isEqualTo( 2 );
}
@Test
public void testSerialization()
throws IOException, JAXBException
{
writ
eReadCheck( getSimpleAggregate() );
}
@Test
public void testFailures()
throws IOException, JAXBException
{
writeReadCheck( new RunResult( 0, 1, 2, 3, "stacktraceHere", false ) );
}
@Test
public void testSkipped()
throws IOException, JAXBException
{
writeReadCheck( new RunResult( 3, 2, 1, 0, null, true ) );
}
@Test
public void testAppendSerialization()
throws IOException, JAXBException
{
RunResult simpleAggregate = getSimpleAggregate();
RunResult additional = new RunResult( 2, 1, 2, 2, "msg " + ( (char) 0x0E01 ), true );
File summary = File.createTempFile( "failsafe", "test" );
FailsafeSummaryXmlUtils.writeSummary( simpleAggregate, summary, false, UTF_8 );
FailsafeSummaryXmlUtils.writeSummary( additional, summary, true, UTF_8 );
RunResult actual = FailsafeSummaryXmlUtils.toRunResult( summary );
//noinspection ResultOfMethodCal
lIgnored
summary.delete();
RunResult expected = simpleAggregate.aggregate( additional );
assertThat( expected.getCompletedCount() )
.isEqualTo( 22 );
assertThat( expected.getErrors() )
.isEqualTo( 4 );
assertThat( expected.getFailures() )
.isEqualTo( 9 );
assertThat( expected.getSkipped() )
.isEqualTo( 6 );
assertThat( expected.getFlakes() )
.isEqualTo( 2 );
assertThat( expected.getFailure() )
.isEqualTo( "msg " + ( (char) 0x0E01 ) );
assertThat( expected.isTimeout() )
.isTrue();
assertThat( actual )
.isEqualTo( expected );
}
@Test
public void shouldAcceptAliasCharset()
{
Charset charset1 = IntegrationTestMojo.toCharset( "UTF8" );
assertThat( charset1.name() ).isEqualTo( "UTF-8" );
Charset charset2 = IntegrationTestMojo.toCharse
t( "utf8" );
assertThat( charset2.name() ).isEqualTo( "UTF-8" );
}
private void writeReadCheck( RunResult expected )
throws IOException, JAXBException
{
File tmp = File.createTempFile( "test", "xml" );
FailsafeSummaryXmlUtils.fromRunResultToFile( expected, tmp );
RunResult actual = FailsafeSummaryXmlUtils.toRunResult( tmp );
//noinspection ResultOfMethodCallIgnored
tmp.delete();
assertThat( actual )
.isEqualTo( expected );
}
private RunResult getSimpleAggregate()
{
RunResult resultOne = new RunResult( 10, 1, 3, 2, 1 );
RunResult resultTwo = new RunResult( 10, 2, 4, 2, 1 );
return resultOne.aggregate( resultTwo );
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 16c25ec..f2c32d0 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
@@ -710,10 +710,12 @@ public abstract class AbstractSurefireMojo
protected abstract int getRerunFailingTestsCount();
+ @Override
public abstract List<String> getIncludes();
public abstract File getIncludesFile();
+ @Override
public abstract void setIncludes( List<String> includes );
public abstract File getExcludesFile();
@@ -761,6 +763,7 @@ public abstract class AbstractSurefireMojo
private volatile PluginConsoleLogger consoleLogger;
+ @Override
public void execute()
throws MojoExecutionException, MojoFailureException
{
@@ -2544,21 +2547,25 @@ public abstract class AbstractSurefireMojo
this.testNgArtifact = testNgArtifact;
}
+ @Override
@Nonnull public String getProviderName()
{
return "org.apache.maven.surefire.testng.TestNGProvider";
}
+ @Override
public boolean isApplicable()
{
return testNgArtifact != null;
}
+ @Override
public void addProviderProperties() throws MojoExecutionException
{
convertTestNGParameters();
}
+ @Override
public Classpath getProviderClasspath()
throws ArtifactResolutionException, ArtifactNotFoundException
{
@@ -2571,20 +2578,24 @@ public abstract class AbstractSurefireMojo
final class JUnit3ProviderInfo
implements ProviderInfo
{
+ @Override
@Nonnull public String getProviderName()
{
return "org.apache.maven.surefire.junit.JUnit3Provider";
}
+ @Override
public boolean isApplicable()
{
return true;
}
+ @Override
public void addProviderProperties() throws MojoExecutionException
{
}
+ @Override
public Classpath getProviderClasspath()
throws ArtifactResolutionException, ArtifactNotFoundException
{
@@ -2609,20 +2620,24 @@ public abstract class AbstractSurefireMojo
this.junitDepArtifact = junitDepArtifact;
}
+ @Override
@Nonnull public String getProviderName()
{
return "org.apache.maven.surefire.junit4.JUnit4Provider";
}
+ @Override
public boolean isApplicable()
{
return junitDepArtifact != null || isAnyJunit4( junitArtifact );
}
+ @Override
public void addProviderProperties() throws MojoExecutionException
{
}
+ @Override
public Classpath getProviderClasspath()
throws ArtifactResolutionException, ArtifactNotFoundException
{
@@ -2645,6 +2660,7 @@ public abstract class AbstractSurefireMojo
this.junitDepArtifact = junitDepArtifact;
}
+ @Override
@Nonnull public String getProviderName()
{
return "org.apache.maven.surefire.junitcore.JUnitCoreProvider";
@@ -2655,6 +2671,7 @@ public abstract class AbstractSurefireMojo
return junitDepArtifact != null && isJunit47Compatible( junitDepArtifact );
}
+ @Override
public boolean isApplicable()
{
final boolean isJunitArtifact47 = isAnyJunit4( junitArtifact ) && isJunit47Compatible( junitArtifact );
@@ -2662,12 +2679,14 @@ public abstract class AbstractSurefireMojo
return isAny47ProvidersForcers && ( isJunitArtifact47 || is47CompatibleJunitDep() );
}
+ @Override
public void addProviderProperties() throws MojoExecutionException
{
convertJunitCoreParameters();
convertGroupParameters();
}
+ @Override
public Classpath getProviderClasspath()
throws ArtifactResolutionException, ArtifactNotFoundException
{
@@ -2689,22 +2708,26 @@ public abstract class AbstractSurefireMojo
this.providerName = providerName;
}
+ @Override
public ProviderInfo instantiate( String providerName )
{
return new DynamicProviderInfo( providerName );
}
+ @Override
@Nonnull
public String getProviderName()
{
return providerName;
}
+ @Override
public boolean isApplicable()
{
return true;
}
+ @Override
public void addProviderProperties() throws MojoExecutionException
{
// Ok this is a bit lazy.
@@ -2712,6 +2735,7 @@ public abstract class AbstractSurefireMojo
convertTestNGParameters();
}
+ @Override
public Classpath getProviderClasspath()
throws ArtifactResolutionException, ArtifactNotFoundException
{
@@ -2790,21 +2814,25 @@ public abstract class AbstractSurefireMojo
}
}
+ @Override
public List<String> getExcludes()
{
return excludes;
}
+ @Override
public void setExcludes( List<String> excludes )
{
this.excludes = excludes;
}
+ @Override
public ArtifactRepository getLocalRepository()
{
return localRepository;
}
+ @Override
public void setLocalRepository( ArtifactRepository localRepository )
{
this.localRepository = localRepository;
@@ -3259,11 +3287,13 @@ public abstract class AbstractSurefireMojo
this.project = project;
}
+ @Override
public File getTestSourceDirectory()
{
return testSourceDirectory;
}
+ @Override
public void setTestSourceDirectory( File testSourceDirectory )
{
this.testSourceDirectory = testSourceDirectory;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 3663f39..fd2b4fb 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
@@ -92,6 +92,7 @@ public class SurefireProperties
super.clear();
}
+ @Override
public synchronized Enumeration<Object> keys()
{
return Collections.enumeration( items );
@@ -170,6 +171,7 @@ public class SurefireProperties
}
}
+ @Override
public void copyTo( Map<Object, Object> target )
{
target.putAll( this );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ChecksumCalculator.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ChecksumCalculator.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ChecksumCalculator.java
index cc6a808..5931f9e 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ChecksumCalculator.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ChecksumCalculator.java
@@ -19,15 +19,17 @@ package org.apache.maven.plugin.surefire.booterclient;
* under the License.
*/
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+
import java.io.File;
-import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.repository.ArtifactRepository;
+
+import static org.apache.maven.surefire.util.internal.StringUtils.ISO_8859_1;
/**
* @author Kristian Rosenvold
@@ -153,7 +155,7 @@ public class ChecksumCalculator
{
MessageDigest md = MessageDigest.getInstance( "SHA-1" );
String configValue = getConfig();
- md.update( configValue.getBytes( "iso-8859-1" ), 0, configValue.length() );
+ md.update( configValue.getBytes( ISO_8859_1 ), 0, configValue.length() );
byte[] sha1hash = md.digest();
return asHexString( sha1hash );
}
@@ -161,10 +163,6 @@ public class ChecksumCalculator
{
throw new RuntimeException( e );
}
- catch ( UnsupportedEncodingException e )
- {
- throw new RuntimeException( e );
- }
}
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 b3a3f91..c46cfb6 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
@@ -54,7 +54,6 @@ import org.apache.maven.surefire.util.DefaultScanResult;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
-import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
@@ -98,7 +97,7 @@ import static org.apache.maven.surefire.util.internal.ConcurrencyUtils.countDown
import static org.apache.maven.surefire.util.internal.DaemonThreadFactory.newDaemonThread;
import static org.apache.maven.surefire.util.internal.DaemonThreadFactory.newDaemonThreadFactory;
import static org.apache.maven.surefire.util.internal.ObjectUtils.requireNonNull;
-import static org.apache.maven.surefire.util.internal.StringUtils.FORK_STREAM_CHARSET_NAME;
+import static org.apache.maven.surefire.util.internal.StringUtils.ISO_8859_1;
/**
* Starts the fork or runs in-process.
@@ -180,6 +179,7 @@ public class ForkStarter
}
}
+ @Override
@SuppressWarnings( "checkstyle:innerassignment" )
public void run()
{
@@ -205,6 +205,7 @@ public class ForkStarter
}
}
+ @Override
public void close()
{
run();
@@ -340,6 +341,7 @@ public class ForkStarter
{
Callable<RunResult> pf = new Callable<RunResult>()
{
+ @Override
public RunResult call()
throws Exception
{
@@ -404,6 +406,7 @@ public class ForkStarter
{
Callable<RunResult> pf = new Callable<RunResult>()
{
+ @Override
public RunResult call()
throws Exception
{
@@ -618,8 +621,7 @@ public class ForkStarter
CommandLineCallable future =
executeCommandLineAsCallable( cli, testProvidingInputStream, threadedStreamConsumer,
- stdErrConsumer, 0, closer,
- Charset.forName( FORK_STREAM_CHARSET_NAME ) );
+ stdErrConsumer, 0, closer, ISO_8859_1 );
currentForkClients.add( forkClient );
@@ -719,6 +721,7 @@ public class ForkStarter
{
return SHUTDOWN_HOOK_THREAD_FACTORY.newThread( new Runnable()
{
+ @Override
public void run()
{
builder.getImmediateCommands().shutdown( shutdownType );
@@ -731,6 +734,7 @@ public class ForkStarter
{
return SHUTDOWN_HOOK_THREAD_FACTORY.newThread( new Runnable()
{
+ @Override
public void run()
{
builder.getCachableCommands().shutdown( shutdownType );
@@ -743,6 +747,7 @@ public class ForkStarter
{
return SHUTDOWN_HOOK_THREAD_FACTORY.newThread( new Runnable()
{
+ @Override
public void run()
{
for ( TestProvidingInputStream stream : streams )
@@ -769,6 +774,7 @@ public class ForkStarter
{
return pingThreadScheduler.scheduleAtFixedRate( new Runnable()
{
+ @Override
public void run()
{
builder.getImmediateCommands().noop();
@@ -780,6 +786,7 @@ public class ForkStarter
{
return pingThreadScheduler.scheduleAtFixedRate( new Runnable()
{
+ @Override
public void run()
{
for ( TestProvidingInputStream stream : streams )
@@ -794,6 +801,7 @@ public class ForkStarter
{
return timeoutCheckScheduler.scheduleAtFixedRate( new Runnable()
{
+ @Override
public void run()
{
long systemTime = currentTimeMillis();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 0abf42f..eb1ab5b 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
@@ -48,6 +48,7 @@ public class OutputStreamFlushableCommandline
this.outputStream = outputStream;
}
+ @Override
public void flush()
throws IOException
{
@@ -71,6 +72,7 @@ public class OutputStreamFlushableCommandline
return process;
}
+ @Override
public FlushReceiver getFlushReceiver()
{
return flushReceiver;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestLessInputStream.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestLessInputStream.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestLessInputStream.java
index d0ae47a..521130c 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestLessInputStream.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestLessInputStream.java
@@ -62,10 +62,12 @@ public final class TestLessInputStream
this.builder = builder;
}
+ @Override
public void provideNewTest()
{
}
+ @Override
public void skipSinceNextTest()
{
if ( canContinue() )
@@ -75,6 +77,7 @@ public final class TestLessInputStream
}
}
+ @Override
public void shutdown( Shutdown shutdownType )
{
if ( canContinue() )
@@ -84,6 +87,7 @@ public final class TestLessInputStream
}
}
+ @Override
public void noop()
{
if ( canContinue() )
@@ -186,6 +190,7 @@ public final class TestLessInputStream
{
iterableCachable = new Iterable<Command>()
{
+ @Override
public Iterator<Command> iterator()
{
return new CIt();
@@ -270,11 +275,13 @@ public final class TestLessInputStream
{
private Node node = TestLessInputStreamBuilder.this.head;
+ @Override
public boolean hasNext()
{
return examineNext( false ) != null;
}
+ @Override
public Command next()
{
Command command = examineNext( true );
@@ -285,6 +292,7 @@ public final class TestLessInputStream
return command;
}
+ @Override
public void remove()
{
throw new UnsupportedOperationException();
@@ -307,10 +315,12 @@ public final class TestLessInputStream
private final class ImmediateCommands
implements NotifiableTestStream
{
+ @Override
public void provideNewTest()
{
}
+ @Override
public void skipSinceNextTest()
{
Lock lock = rwLock.readLock();
@@ -328,6 +338,7 @@ public final class TestLessInputStream
}
}
+ @Override
public void shutdown( Shutdown shutdownType )
{
Lock lock = rwLock.readLock();
@@ -345,6 +356,7 @@ public final class TestLessInputStream
}
}
+ @Override
public void noop()
{
Lock lock = rwLock.readLock();
@@ -387,10 +399,12 @@ public final class TestLessInputStream
private final class CachableCommands
implements NotifiableTestStream
{
+ @Override
public void provideNewTest()
{
}
+ @Override
public void skipSinceNextTest()
{
Lock lock = rwLock.readLock();
@@ -408,6 +422,7 @@ public final class TestLessInputStream
}
}
+ @Override
public void shutdown( Shutdown shutdownType )
{
Lock lock = rwLock.readLock();
@@ -425,6 +440,7 @@ public final class TestLessInputStream
}
}
+ @Override
public void noop()
{
Lock lock = rwLock.readLock();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 69f73a2..35cb2d4 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
@@ -82,6 +82,7 @@ public final class TestProvidingInputStream
}
}
+ @Override
public void skipSinceNextTest()
{
if ( canContinue() )
@@ -91,6 +92,7 @@ public final class TestProvidingInputStream
}
}
+ @Override
public void shutdown( Shutdown shutdownType )
{
if ( canContinue() )
@@ -100,6 +102,7 @@ public final class TestProvidingInputStream
}
}
+ @Override
public void noop()
{
if ( canContinue() )
@@ -150,6 +153,7 @@ public final class TestProvidingInputStream
/**
* Signal that a new test is to be provided.
*/
+ @Override
public void provideNewTest()
{
if ( canContinue() )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/DeserializedStacktraceWriter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/DeserializedStacktraceWriter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/DeserializedStacktraceWriter.java
index 952feb8..b5a53b4 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/DeserializedStacktraceWriter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/DeserializedStacktraceWriter.java
@@ -46,22 +46,26 @@ public class DeserializedStacktraceWriter
this.stackTrace = stackTrace;
}
+ @Override
public String smartTrimmedStackTrace()
{
return smartTrimmed;
}
// Trimming or not is decided on the forking side
+ @Override
public String writeTraceToString()
{
return stackTrace;
}
+ @Override
public String writeTrimmedTraceToString()
{
return stackTrace;
}
+ @Override
public SafeThrowable getThrowable()
{
return new SafeThrowable( message );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 7aaa0f1..b02ae54 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
@@ -151,6 +151,7 @@ public class ForkClient
return defaultReporterFactory;
}
+ @Override
public final void consumeLine( String s )
{
if ( isNotBlank( s ) )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/NativeStdErrStreamConsumer.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/NativeStdErrStreamConsumer.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/NativeStdErrStreamConsumer.java
index 0ddc392..d460583 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/NativeStdErrStreamConsumer.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/NativeStdErrStreamConsumer.java
@@ -39,6 +39,7 @@ public final class NativeStdErrStreamConsumer
this.defaultReporterFactory = defaultReporterFactory;
}
+ @Override
public void consumeLine( String line )
{
InPluginProcessDumpSingleton.getSingleton().dumpText( line, defaultReporterFactory );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
index ff9c238..972eaa7 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
@@ -73,6 +73,7 @@ public final class ThreadedStreamConsumer
* e.g. acquire-next-test which means that {@link ForkClient} could hang on waiting for old test to complete
* and therefore the plugin could be permanently in progress.
*/
+ @Override
public void run()
{
while ( !ThreadedStreamConsumer.this.stop.get() )
@@ -111,6 +112,7 @@ public final class ThreadedStreamConsumer
thread.start();
}
+ @Override
public void consumeLine( String s )
{
if ( stop.get() && !thread.isAlive() )
@@ -130,6 +132,7 @@ public final class ThreadedStreamConsumer
}
}
+ @Override
public void close()
throws IOException
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/log/PluginConsoleLogger.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/log/PluginConsoleLogger.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/log/PluginConsoleLogger.java
index d93813e..0f1217c 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/log/PluginConsoleLogger.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/log/PluginConsoleLogger.java
@@ -45,6 +45,7 @@ public final class PluginConsoleLogger
return mojoLogger.isDebugEnabled();
}
+ @Override
public void debug( String message )
{
if ( mojoLogger.isDebugEnabled() )
@@ -66,6 +67,7 @@ public final class PluginConsoleLogger
return mojoLogger.isInfoEnabled();
}
+ @Override
public void info( String message )
{
if ( mojoLogger.isInfoEnabled() )
@@ -79,6 +81,7 @@ public final class PluginConsoleLogger
return mojoLogger.isWarnEnabled();
}
+ @Override
public void warning( String message )
{
if ( mojoLogger.isWarnEnabled() )
@@ -100,6 +103,7 @@ public final class PluginConsoleLogger
return mojoLogger.isErrorEnabled();
}
+ @Override
public void error( String message )
{
if ( mojoLogger.isErrorEnabled() )
@@ -108,6 +112,7 @@ public final class PluginConsoleLogger
}
}
+ @Override
public void error( String message, Throwable t )
{
if ( mojoLogger.isErrorEnabled() )
@@ -116,6 +121,7 @@ public final class PluginConsoleLogger
}
}
+ @Override
public void error( Throwable t )
{
if ( mojoLogger.isErrorEnabled() )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 f9e59fe..682686c 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
@@ -52,16 +52,19 @@ public class ConsoleOutputFileReporter
this.reportNameSuffix = reportNameSuffix;
}
+ @Override
public void testSetStarting( ReportEntry reportEntry )
{
close();
reportEntryName = reportEntry.getName();
}
+ @Override
public void testSetCompleted( ReportEntry report )
{
}
+ @Override
@SuppressWarnings( "checkstyle:emptyblock" )
public void close()
{
@@ -79,6 +82,7 @@ public class ConsoleOutputFileReporter
}
}
+ @Override
public void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
{
try
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 b4a6f30..3b8d765 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
@@ -86,6 +86,7 @@ public class DefaultReporterFactory
listeners = new ConcurrentLinkedQueue<TestSetRunListener>();
}
+ @Override
public RunListener createReporter()
{
TestSetRunListener testSetRunListener =
@@ -159,6 +160,7 @@ public class DefaultReporterFactory
listeners.add( listener );
}
+ @Override
public RunResult close()
{
mergeTestHistoryResult();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 25312aa..ab33cb8 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
@@ -50,6 +50,7 @@ public class DirectConsoleOutput
}
+ @Override
public void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
{
final PrintStream stream = stdout ? sout : serr;
@@ -64,14 +65,17 @@ public class DirectConsoleOutput
}
}
+ @Override
public void testSetStarting( ReportEntry reportEntry )
{
}
+ @Override
public void testSetCompleted( ReportEntry report )
{
}
+ @Override
public void close()
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleOutputReceiver.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleOutputReceiver.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleOutputReceiver.java
index e18f3aa..327c77d 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleOutputReceiver.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/NullConsoleOutputReceiver.java
@@ -37,18 +37,22 @@ class NullConsoleOutputReceiver
{
}
+ @Override
public void testSetStarting( ReportEntry reportEntry )
{
}
+ @Override
public void testSetCompleted( ReportEntry report )
{
}
+ @Override
public void close()
{
}
+ @Override
public void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 397c4c1..c57123e 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
@@ -25,6 +25,7 @@ import org.apache.maven.shared.utils.xml.XMLWriter;
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.surefire.util.internal.StringUtils;
import java.io.File;
import java.io.FileOutputStream;
@@ -32,8 +33,6 @@ import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
@@ -44,6 +43,7 @@ import java.util.StringTokenizer;
import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType;
import static org.apache.maven.plugin.surefire.report.FileReporterUtils.stripIllegalFilenameChars;
+import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8;
import static org.apache.maven.surefire.util.internal.StringUtils.isBlank;
// CHECKSTYLE_OFF: LineLength
@@ -81,10 +81,6 @@ import static org.apache.maven.surefire.util.internal.StringUtils.isBlank;
*/
public class StatelessXmlReporter
{
- private static final String ENCODING = "UTF-8";
-
- private static final Charset ENCODING_CS = Charset.forName( ENCODING );
-
private final File reportsDirectory;
private final String reportNameSuffix;
@@ -129,7 +125,7 @@ public class StatelessXmlReporter
try
{
XMLWriter ppw = new PrettyPrintXMLWriter( fw );
- ppw.setEncoding( ENCODING );
+ ppw.setEncoding( StringUtils.UTF_8.name() );
createTestSuiteElement( ppw, testSetReportEntry, testSetStats, testSetReportEntry.elapsedTimeAsString() );
@@ -302,7 +298,7 @@ public class StatelessXmlReporter
private static OutputStreamWriter getWriter( FileOutputStream fos )
{
- return new OutputStreamWriter( fos, ENCODING_CS );
+ return new OutputStreamWriter( fos, UTF_8 );
}
private static void getAddMethodEntryList( Map<String, List<WrappedReportEntry>> methodRunHistoryMap,
@@ -540,7 +536,7 @@ public class StatelessXmlReporter
// there's nothing better we can do! :-(
// SUREFIRE-456
out.write( ByteConstantsHolder.AMP_BYTES );
- out.write( String.valueOf( b ).getBytes( ENCODING ) );
+ out.write( String.valueOf( b ).getBytes( UTF_8 ) );
out.write( ';' ); // & Will be encoded to amp inside xml encodingSHO
}
else
@@ -612,17 +608,10 @@ public class StatelessXmlReporter
static
{
- try
- {
- CDATA_START_BYTES = "<![CDATA[".getBytes( ENCODING );
- CDATA_END_BYTES = "]]>".getBytes( ENCODING );
- CDATA_ESCAPE_STRING_BYTES = "]]><![CDATA[>".getBytes( ENCODING );
- AMP_BYTES = "&#".getBytes( ENCODING );
- }
- catch ( UnsupportedEncodingException e )
- {
- throw new RuntimeException( e );
- }
+ CDATA_START_BYTES = "<![CDATA[".getBytes( UTF_8 );
+ CDATA_END_BYTES = "]]>".getBytes( UTF_8 );
+ CDATA_ESCAPE_STRING_BYTES = "]]><![CDATA[>".getBytes( UTF_8 );
+ AMP_BYTES = "&#".getBytes( UTF_8 );
}
}
}
[3/4] maven-surefire git commit: [SUREFIRE-1363] Java 1.6 features
@Override and Charset
Posted by ti...@apache.org.
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 f0f996d..472586b 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
@@ -86,36 +86,43 @@ public class TestSetRunListener
testMethodStats = new ArrayList<TestMethodStats>();
}
+ @Override
public void debug( String message )
{
consoleReporter.getConsoleLogger().debug( trimTrailingNewLine( message ) );
}
+ @Override
public void info( String message )
{
consoleReporter.getConsoleLogger().info( trimTrailingNewLine( message ) );
}
+ @Override
public void warning( String message )
{
consoleReporter.getConsoleLogger().warning( trimTrailingNewLine( message ) );
}
+ @Override
public void error( String message )
{
consoleReporter.getConsoleLogger().error( trimTrailingNewLine( message ) );
}
+ @Override
public void error( String message, Throwable t )
{
consoleReporter.getConsoleLogger().error( message, t );
}
+ @Override
public void error( Throwable t )
{
consoleReporter.getConsoleLogger().error( t );
}
+ @Override
public void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
{
try
@@ -136,6 +143,7 @@ public class TestSetRunListener
consoleOutputReceiver.writeTestOutput( buf, off, len, stdout );
}
+ @Override
public void testSetStarting( ReportEntry report )
{
detailsForThis.testSetStart();
@@ -149,6 +157,7 @@ public class TestSetRunListener
testStdErr = initDeferred( "stderr" );
}
+ @Override
public void testSetCompleted( ReportEntry report )
{
final WrappedReportEntry wrap = wrapTestSet( report );
@@ -173,11 +182,13 @@ public class TestSetRunListener
// Test
// ----------------------------------------------------------------------
+ @Override
public void testStarting( ReportEntry report )
{
detailsForThis.testStart();
}
+ @Override
public void testSucceeded( ReportEntry reportEntry )
{
WrappedReportEntry wrapped = wrap( reportEntry, SUCCESS );
@@ -186,6 +197,7 @@ public class TestSetRunListener
clearCapture();
}
+ @Override
public void testError( ReportEntry reportEntry )
{
WrappedReportEntry wrapped = wrap( reportEntry, ERROR );
@@ -194,6 +206,7 @@ public class TestSetRunListener
clearCapture();
}
+ @Override
public void testFailed( ReportEntry reportEntry )
{
WrappedReportEntry wrapped = wrap( reportEntry, FAILURE );
@@ -206,6 +219,7 @@ public class TestSetRunListener
// Counters
// ----------------------------------------------------------------------
+ @Override
public void testSkipped( ReportEntry reportEntry )
{
WrappedReportEntry wrapped = wrap( reportEntry, SKIPPED );
@@ -215,10 +229,12 @@ public class TestSetRunListener
clearCapture();
}
+ @Override
public void testExecutionSkippedByUser()
{
}
+ @Override
public void testAssumptionFailure( ReportEntry report )
{
testSkipped( report );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/Utf8RecodingDeferredFileOutputStream.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/Utf8RecodingDeferredFileOutputStream.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/Utf8RecodingDeferredFileOutputStream.java
index 954a2bb..0aa00c7 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/Utf8RecodingDeferredFileOutputStream.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/Utf8RecodingDeferredFileOutputStream.java
@@ -19,13 +19,15 @@ package org.apache.maven.plugin.surefire.report;
* under the License.
*/
+import org.apache.commons.io.output.DeferredFileOutputStream;
+
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
-import org.apache.commons.io.output.DeferredFileOutputStream;
+import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8;
/**
* A deferred file output stream decorator that recodes the bytes written into the stream from the VM default encoding
@@ -39,8 +41,6 @@ class Utf8RecodingDeferredFileOutputStream
private boolean closed = false;
- private static final Charset UTF8 = Charset.forName( "UTF-8" );
-
@SuppressWarnings( "checkstyle:magicnumber" )
public Utf8RecodingDeferredFileOutputStream( String channel )
{
@@ -55,10 +55,10 @@ class Utf8RecodingDeferredFileOutputStream
return;
}
- if ( !Charset.defaultCharset().equals( UTF8 ) )
+ if ( !Charset.defaultCharset().equals( UTF_8 ) )
{
CharBuffer decodedFromDefaultCharset = Charset.defaultCharset().decode( ByteBuffer.wrap( buf, off, len ) );
- ByteBuffer utf8Encoded = UTF8.encode( decodedFromDefaultCharset );
+ ByteBuffer utf8Encoded = UTF_8.encode( decodedFromDefaultCharset );
if ( utf8Encoded.hasArray() )
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 2394ff0..439fdec 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
@@ -51,6 +51,7 @@ public class WrappedReportEntry
this.stdErr = stdErr;
}
+ @Override
public Integer getElapsed()
{
return elapsed;
@@ -71,11 +72,13 @@ public class WrappedReportEntry
return stdErr;
}
+ @Override
public String getSourceName()
{
return original.getSourceName();
}
+ @Override
public String getName()
{
return original.getName();
@@ -86,16 +89,19 @@ public class WrappedReportEntry
return getSourceName() + "." + getName();
}
+ @Override
public String getGroup()
{
return original.getGroup();
}
+ @Override
public StackTraceWriter getStackTraceWriter()
{
return original.getStackTraceWriter();
}
+ @Override
public String getMessage()
{
return original.getMessage();
@@ -160,6 +166,7 @@ public class WrappedReportEntry
return ReportEntryType.SUCCESS == getReportEntryType();
}
+ @Override
public String getNameWithGroup()
{
return original.getNameWithGroup();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockNotifiableTestStream.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockNotifiableTestStream.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockNotifiableTestStream.java
index 9e94e7f..b98aca7 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockNotifiableTestStream.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockNotifiableTestStream.java
@@ -31,18 +31,22 @@ import org.apache.maven.surefire.booter.*;
final class MockNotifiableTestStream
implements NotifiableTestStream
{
+ @Override
public void provideNewTest()
{
}
+ @Override
public void skipSinceNextTest()
{
}
+ @Override
public void shutdown( Shutdown shutdownType )
{
}
+ @Override
public void noop()
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockReporter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockReporter.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockReporter.java
index b8c9ef0..bfc8faf 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockReporter.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockReporter.java
@@ -65,24 +65,28 @@ public class MockReporter
private final AtomicInteger testFailed = new AtomicInteger();
+ @Override
public void testSetStarting( ReportEntry report )
{
events.add( SET_STARTING );
data.add( report );
}
+ @Override
public void testSetCompleted( ReportEntry report )
{
events.add( SET_COMPLETED );
data.add( report );
}
+ @Override
public void testStarting( ReportEntry report )
{
events.add( TEST_STARTING );
data.add( report );
}
+ @Override
public void testSucceeded( ReportEntry report )
{
events.add( TEST_SUCCEEDED );
@@ -90,6 +94,7 @@ public class MockReporter
data.add( report );
}
+ @Override
public void testError( ReportEntry report )
{
events.add( TEST_ERROR );
@@ -97,6 +102,7 @@ public class MockReporter
testFailed.incrementAndGet();
}
+ @Override
public void testFailed( ReportEntry report )
{
events.add( TEST_FAILED );
@@ -104,6 +110,7 @@ public class MockReporter
testFailed.incrementAndGet();
}
+ @Override
public void testSkipped( ReportEntry report )
{
events.add( TEST_SKIPPED );
@@ -111,6 +118,7 @@ public class MockReporter
testIgnored.incrementAndGet();
}
+ @Override
public void testExecutionSkippedByUser()
{
}
@@ -140,6 +148,7 @@ public class MockReporter
return (ReportEntry) data.get( 0 );
}
+ @Override
public void testAssumptionFailure( ReportEntry report )
{
events.add( TEST_ASSUMPTION_FAIL );
@@ -147,38 +156,45 @@ public class MockReporter
testIgnored.incrementAndGet();
}
+ @Override
public void debug( String message )
{
events.add( CONSOLE_OUTPUT );
data.add( message );
}
+ @Override
public void info( String message )
{
events.add( CONSOLE_OUTPUT );
data.add( message );
}
+ @Override
public void warning( String message )
{
events.add( CONSOLE_OUTPUT );
data.add( message );
}
+ @Override
public void error( String message )
{
events.add( CONSOLE_OUTPUT );
data.add( message );
}
+ @Override
public void error( String message, Throwable t )
{
}
+ @Override
public void error( Throwable t )
{
}
+ @Override
public void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
{
events.add( stdout ? STDOUT : STDERR );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/TestSetMockReporterFactory.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/TestSetMockReporterFactory.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/TestSetMockReporterFactory.java
index ada54a2..5e4f682 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/TestSetMockReporterFactory.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/TestSetMockReporterFactory.java
@@ -38,6 +38,7 @@ public class TestSetMockReporterFactory
super( defaultValue(), new NullConsoleLogger() );
}
+ @Override
public RunListener createReporter()
{
return new MockReporter();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStreamTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStreamTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStreamTest.java
index b117a38..6f25ec3 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStreamTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStreamTest.java
@@ -58,6 +58,7 @@ public class TestProvidingInputStreamTest
final Thread streamThread = Thread.currentThread();
FutureTask<Thread.State> futureTask = new FutureTask<Thread.State>( new Callable<Thread.State>()
{
+ @Override
public Thread.State call()
{
sleep( 1000 );
@@ -82,6 +83,7 @@ public class TestProvidingInputStreamTest
is.testSetFinished();
new Thread( new Runnable()
{
+ @Override
public void run()
{
is.provideNewTest();
@@ -108,6 +110,7 @@ public class TestProvidingInputStreamTest
final TestProvidingInputStream is = new TestProvidingInputStream( commands );
new Thread( new Runnable()
{
+ @Override
public void run()
{
is.provideNewTest();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
index fbe875d..a6076de 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
@@ -142,31 +142,37 @@ public class DefaultReporterFactoryTest
{
private final List<String> messages = new ArrayList<String>();
+ @Override
public void debug( String message )
{
messages.add( message );
}
+ @Override
public void info( String message )
{
messages.add( message );
}
+ @Override
public void warning( String message )
{
messages.add( message );
}
+ @Override
public void error( String message )
{
messages.add( message );
}
+ @Override
public void error( String message, Throwable t )
{
messages.add( message );
}
+ @Override
public void error( Throwable t )
{
}
@@ -233,21 +239,25 @@ public class DefaultReporterFactoryTest
this.stackTrace = stackTrace;
}
+ @Override
public String writeTraceToString()
{
return "";
}
+ @Override
public String writeTrimmedTraceToString()
{
return "";
}
+ @Override
public String smartTrimmedStackTrace()
{
return stackTrace;
}
+ @Override
public SafeThrowable getThrowable()
{
return null;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
index 5b649e3..c5b7a1e 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
@@ -20,7 +20,6 @@ package org.apache.maven.plugin.surefire.report;
*/
import junit.framework.TestCase;
-
import org.apache.maven.plugin.surefire.booterclient.output.DeserializedStacktraceWriter;
import org.apache.maven.shared.utils.StringUtils;
import org.apache.maven.shared.utils.xml.Xpp3Dom;
@@ -39,6 +38,8 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
+import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8;
+
@SuppressWarnings( "ResultOfMethodCallIgnored" )
public class StatelessXmlReporterTest
extends TestCase
@@ -142,7 +143,7 @@ public class StatelessXmlReporterTest
FileInputStream fileInputStream = new FileInputStream( expectedReportFile );
- Xpp3Dom testSuite = Xpp3DomBuilder.build( new InputStreamReader( fileInputStream, "UTF-8") );
+ Xpp3Dom testSuite = Xpp3DomBuilder.build( new InputStreamReader( fileInputStream, UTF_8) );
assertEquals( "testsuite", testSuite.getName() );
Xpp3Dom properties = testSuite.getChild( "properties" );
assertEquals( System.getProperties().size(), properties.getChildCount() );
@@ -224,7 +225,7 @@ public class StatelessXmlReporterTest
FileInputStream fileInputStream = new FileInputStream( expectedReportFile );
- Xpp3Dom testSuite = Xpp3DomBuilder.build( new InputStreamReader( fileInputStream, "UTF-8" ) );
+ Xpp3Dom testSuite = Xpp3DomBuilder.build( new InputStreamReader( fileInputStream, UTF_8 ) );
assertEquals( "testsuite", testSuite.getName() );
assertEquals( "0.012", testSuite.getAttribute( "time" ) );
Xpp3Dom properties = testSuite.getChild( "properties" );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/CustomizedImpl.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/CustomizedImpl.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/CustomizedImpl.java
index 2809f2c..e2f654c 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/CustomizedImpl.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/CustomizedImpl.java
@@ -26,6 +26,7 @@ package org.apache.maven.surefire.spi;
public class CustomizedImpl
implements IDefault
{
+ @Override
public boolean isDefault()
{
return false;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/DefaultImpl.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/DefaultImpl.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/DefaultImpl.java
index 54de2b7..207f562 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/DefaultImpl.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/DefaultImpl.java
@@ -26,6 +26,7 @@ package org.apache.maven.surefire.spi;
public class DefaultImpl
implements IDefault
{
+ @Override
public boolean isDefault()
{
return true;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPImpl1.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPImpl1.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPImpl1.java
index 3f3f276..d9e6b4d 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPImpl1.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPImpl1.java
@@ -25,6 +25,7 @@ package org.apache.maven.surefire.spi;
*/
public class SPImpl1 implements ExistingServiceInterface
{
+ @Override
public String whoAmI()
{
return SPImpl1.class.getSimpleName();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPImpl2.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPImpl2.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPImpl2.java
index 42b446b..9ecccef 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPImpl2.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPImpl2.java
@@ -25,6 +25,7 @@ package org.apache.maven.surefire.spi;
*/
public class SPImpl2 implements ExistingServiceInterface
{
+ @Override
public String whoAmI()
{
return SPImpl2.class.getSimpleName();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
----------------------------------------------------------------------
diff --git a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
index 8008a47..4a404df 100644
--- a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
+++ b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
@@ -323,27 +323,32 @@ public class SurefirePlugin
@Parameter( property = "surefire.shutdown", defaultValue = "testset" )
private String shutdown;
+ @Override
protected int getRerunFailingTestsCount()
{
return rerunFailingTestsCount;
}
+ @Override
protected void handleSummary( RunResult summary, Exception firstForkException )
throws MojoExecutionException, MojoFailureException
{
reportExecution( this, summary, getConsoleLogger(), firstForkException );
}
+ @Override
protected boolean isSkipExecution()
{
return isSkip() || isSkipTests() || isSkipExec();
}
+ @Override
protected String getPluginName()
{
return "surefire";
}
+ @Override
protected String[] getDefaultIncludes()
{
return new String[]{ "**/Test*.java", "**/*Test.java", "**/*Tests.java", "**/*TestCase.java" };
@@ -357,11 +362,13 @@ public class SurefirePlugin
// now for the implementation of the field accessors
+ @Override
public boolean isSkipTests()
{
return skipTests;
}
+ @Override
public void setSkipTests( boolean skipTests )
{
this.skipTests = skipTests;
@@ -370,6 +377,7 @@ public class SurefirePlugin
/**
* @noinspection deprecation
*/
+ @Override
public boolean isSkipExec()
{
return skipExec;
@@ -378,196 +386,235 @@ public class SurefirePlugin
/**
* @noinspection deprecation
*/
+ @Override
public void setSkipExec( boolean skipExec )
{
this.skipExec = skipExec;
}
+ @Override
public boolean isSkip()
{
return skip;
}
+ @Override
public void setSkip( boolean skip )
{
this.skip = skip;
}
+ @Override
public boolean isTestFailureIgnore()
{
return testFailureIgnore;
}
+ @Override
public void setTestFailureIgnore( boolean testFailureIgnore )
{
this.testFailureIgnore = testFailureIgnore;
}
+ @Override
public File getBasedir()
{
return basedir;
}
+ @Override
public void setBasedir( File basedir )
{
this.basedir = basedir;
}
+ @Override
public File getTestClassesDirectory()
{
return testClassesDirectory;
}
+ @Override
public void setTestClassesDirectory( File testClassesDirectory )
{
this.testClassesDirectory = testClassesDirectory;
}
+ @Override
public File getClassesDirectory()
{
return classesDirectory;
}
+ @Override
public void setClassesDirectory( File classesDirectory )
{
this.classesDirectory = classesDirectory;
}
+ @Override
public File getReportsDirectory()
{
return reportsDirectory;
}
+ @Override
public void setReportsDirectory( File reportsDirectory )
{
this.reportsDirectory = reportsDirectory;
}
+ @Override
public String getTest()
{
return test;
}
+ @Override
public boolean isUseSystemClassLoader()
{
return useSystemClassLoader;
}
+ @Override
public void setUseSystemClassLoader( boolean useSystemClassLoader )
{
this.useSystemClassLoader = useSystemClassLoader;
}
+ @Override
public boolean isUseManifestOnlyJar()
{
return useManifestOnlyJar;
}
+ @Override
public void setUseManifestOnlyJar( boolean useManifestOnlyJar )
{
this.useManifestOnlyJar = useManifestOnlyJar;
}
+ @Override
public Boolean getFailIfNoSpecifiedTests()
{
return failIfNoSpecifiedTests;
}
+ @Override
public void setFailIfNoSpecifiedTests( boolean failIfNoSpecifiedTests )
{
this.failIfNoSpecifiedTests = failIfNoSpecifiedTests;
}
+ @Override
public int getSkipAfterFailureCount()
{
return skipAfterFailureCount;
}
+ @Override
public String getShutdown()
{
return shutdown;
}
+ @Override
public boolean isPrintSummary()
{
return printSummary;
}
+ @Override
public void setPrintSummary( boolean printSummary )
{
this.printSummary = printSummary;
}
+ @Override
public String getReportFormat()
{
return reportFormat;
}
+ @Override
public void setReportFormat( String reportFormat )
{
this.reportFormat = reportFormat;
}
+ @Override
public boolean isUseFile()
{
return useFile;
}
+ @Override
public void setUseFile( boolean useFile )
{
this.useFile = useFile;
}
+ @Override
public String getDebugForkedProcess()
{
return debugForkedProcess;
}
+ @Override
public void setDebugForkedProcess( String debugForkedProcess )
{
this.debugForkedProcess = debugForkedProcess;
}
+ @Override
public int getForkedProcessTimeoutInSeconds()
{
return forkedProcessTimeoutInSeconds;
}
+ @Override
public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds )
{
this.forkedProcessTimeoutInSeconds = forkedProcessTimeoutInSeconds;
}
+ @Override
public int getForkedProcessExitTimeoutInSeconds()
{
return forkedProcessExitTimeoutInSeconds;
}
+ @Override
public void setForkedProcessExitTimeoutInSeconds( int forkedProcessExitTimeoutInSeconds )
{
this.forkedProcessExitTimeoutInSeconds = forkedProcessExitTimeoutInSeconds;
}
+ @Override
public double getParallelTestsTimeoutInSeconds()
{
return parallelTestsTimeoutInSeconds;
}
+ @Override
public void setParallelTestsTimeoutInSeconds( double parallelTestsTimeoutInSeconds )
{
this.parallelTestsTimeoutInSeconds = parallelTestsTimeoutInSeconds;
}
+ @Override
public double getParallelTestsTimeoutForcedInSeconds()
{
return parallelTestsTimeoutForcedInSeconds;
}
+ @Override
public void setParallelTestsTimeoutForcedInSeconds( double parallelTestsTimeoutForcedInSeconds )
{
this.parallelTestsTimeoutForcedInSeconds = parallelTestsTimeoutForcedInSeconds;
}
+ @Override
public void setTest( String test )
{
this.test = test;
@@ -585,22 +632,26 @@ public class SurefirePlugin
this.includes = includes;
}
+ @Override
public File[] getSuiteXmlFiles()
{
return suiteXmlFiles.clone();
}
+ @Override
@SuppressWarnings( "UnusedDeclaration" )
public void setSuiteXmlFiles( File[] suiteXmlFiles )
{
this.suiteXmlFiles = suiteXmlFiles.clone();
}
+ @Override
public String getRunOrder()
{
return runOrder;
}
+ @Override
@SuppressWarnings( "UnusedDeclaration" )
public void setRunOrder( String runOrder )
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java b/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java
index 2f8700a..5fa6df0 100644
--- a/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java
+++ b/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java
@@ -102,11 +102,13 @@ public class SurefirePluginTest
private class MyToolChain
implements Toolchain
{
+ @Override
public String getType()
{
return null;
}
+ @Override
public String findTool( String s )
{
return null;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 9621fa1..a3538b7 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
@@ -131,6 +131,7 @@ public abstract class AbstractSurefireReportMojo
/**
* {@inheritDoc}
*/
+ @Override
public void executeReport( Locale locale )
throws MavenReportException
{
@@ -312,6 +313,7 @@ public abstract class AbstractSurefireReportMojo
/**
* {@inheritDoc}
*/
+ @Override
public String getName( Locale locale )
{
return getBundle( locale ).getString( "report.surefire.name" );
@@ -320,6 +322,7 @@ public abstract class AbstractSurefireReportMojo
/**
* {@inheritDoc}
*/
+ @Override
public String getDescription( Locale locale )
{
return getBundle( locale ).getString( "report.surefire.description" );
@@ -328,6 +331,7 @@ public abstract class AbstractSurefireReportMojo
/**
* {@inheritDoc}
*/
+ @Override
public abstract String getOutputName();
private ResourceBundle getBundle( Locale locale )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 b208c4f..b7aa290 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
@@ -68,22 +68,26 @@ public class FailsafeReportMojo
@Parameter( defaultValue = "false", property = "skipFailsafeReport" )
private boolean skipFailsafeReport;
+ @Override
protected File getSurefireReportsDirectory( MavenProject subProject )
{
String buildDir = subProject.getBuild().getDirectory();
return new File( buildDir + "/failsafe-reports" );
}
+ @Override
public String getOutputName()
{
return outputName;
}
+ @Override
protected boolean isSkipped()
{
return skipFailsafeReport;
}
+ @Override
protected boolean isGeneratedWhenNoResults()
{
return alwaysGenerateFailsafeReport;
@@ -92,6 +96,7 @@ public class FailsafeReportMojo
/**
* {@inheritDoc}
*/
+ @Override
public String getName( Locale locale )
{
return getBundle( locale ).getString( "report.failsafe.name" );
@@ -100,6 +105,7 @@ public class FailsafeReportMojo
/**
* {@inheritDoc}
*/
+ @Override
public String getDescription( Locale locale )
{
return getBundle( locale ).getString( "report.failsafe.description" );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/PluginConsoleLogger.java
----------------------------------------------------------------------
diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/PluginConsoleLogger.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/PluginConsoleLogger.java
index 667bc95..3a75037 100644
--- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/PluginConsoleLogger.java
+++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/PluginConsoleLogger.java
@@ -49,6 +49,7 @@ final class PluginConsoleLogger
return mojoLogger.isDebugEnabled();
}
+ @Override
public void debug( String message )
{
if ( mojoLogger.isDebugEnabled() )
@@ -70,6 +71,7 @@ final class PluginConsoleLogger
return mojoLogger.isInfoEnabled();
}
+ @Override
public void info( String message )
{
if ( mojoLogger.isInfoEnabled() )
@@ -83,6 +85,7 @@ final class PluginConsoleLogger
return mojoLogger.isWarnEnabled();
}
+ @Override
public void warning( String message )
{
if ( mojoLogger.isWarnEnabled() )
@@ -104,6 +107,7 @@ final class PluginConsoleLogger
return mojoLogger.isErrorEnabled();
}
+ @Override
public void error( String message )
{
if ( mojoLogger.isErrorEnabled() )
@@ -112,6 +116,7 @@ final class PluginConsoleLogger
}
}
+ @Override
public void error( String message, Throwable t )
{
if ( mojoLogger.isErrorEnabled() )
@@ -120,6 +125,7 @@ final class PluginConsoleLogger
}
}
+ @Override
public void error( Throwable t )
{
if ( mojoLogger.isErrorEnabled() )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/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 964c1c4..a950bcf 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
@@ -65,22 +65,26 @@ public class SurefireReportMojo
@Parameter( defaultValue = "false", property = "skipSurefireReport" )
private boolean skipSurefireReport;
+ @Override
protected File getSurefireReportsDirectory( MavenProject subProject )
{
String buildDir = subProject.getBuild().getDirectory();
return new File( buildDir + "/surefire-reports" );
}
+ @Override
public String getOutputName()
{
return outputName;
}
+ @Override
protected boolean isSkipped()
{
return skipSurefireReport;
}
+ @Override
protected boolean isGeneratedWhenNoResults()
{
return alwaysGenerateSurefireReport;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubs/SurefireRepMavenProjectStub.java
----------------------------------------------------------------------
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubs/SurefireRepMavenProjectStub.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubs/SurefireRepMavenProjectStub.java
index af02470..155b683 100644
--- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubs/SurefireRepMavenProjectStub.java
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubs/SurefireRepMavenProjectStub.java
@@ -34,6 +34,7 @@ public class SurefireRepMavenProjectStub
/**
* {@inheritDoc}
*/
+ @Override
public List getReportPlugins()
{
Reporting reporting = new Reporting();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubs/SurefireRepMavenProjectStub2.java
----------------------------------------------------------------------
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubs/SurefireRepMavenProjectStub2.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubs/SurefireRepMavenProjectStub2.java
index 18277ca..23b1e4e 100644
--- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubs/SurefireRepMavenProjectStub2.java
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubs/SurefireRepMavenProjectStub2.java
@@ -32,6 +32,7 @@ public class SurefireRepMavenProjectStub2
/**
* {@inheritDoc}
*/
+ @Override
public List getReportPlugins()
{
return new ArrayList();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMap.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMap.java b/surefire-api/src/main/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMap.java
index d47e803..dc871a5 100644
--- a/surefire-api/src/main/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMap.java
+++ b/surefire-api/src/main/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMap.java
@@ -150,6 +150,7 @@ public final class RunEntryStatisticsMap
static final class RunCountComparator
implements Comparator<RunEntryStatistics>
{
+ @Override
public int compare( RunEntryStatistics o, RunEntryStatistics o1 )
{
int runtime = o.getSuccessfulBuilds() - o1.getSuccessfulBuilds();
@@ -238,6 +239,7 @@ public final class RunEntryStatisticsMap
static final class PrioritizedTestComparator
implements Comparator<PrioritizedTest>
{
+ @Override
public int compare( PrioritizedTest o, PrioritizedTest o1 )
{
return o.getPriority() - o1.getPriority();
@@ -247,6 +249,7 @@ public final class RunEntryStatisticsMap
static final class TestRuntimeComparator
implements Comparator<Priority>
{
+ @Override
public int compare( Priority o, Priority o1 )
{
return o1.getTotalRuntime() - o.getTotalRuntime();
@@ -256,6 +259,7 @@ public final class RunEntryStatisticsMap
static final class LeastFailureComparator
implements Comparator<Priority>
{
+ @Override
public int compare( Priority o, Priority o1 )
{
return o.getMinSuccessRate() - o1.getMinSuccessRate();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/NonAbstractClassFilter.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/NonAbstractClassFilter.java b/surefire-api/src/main/java/org/apache/maven/surefire/NonAbstractClassFilter.java
index cc38977..da3badd 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/NonAbstractClassFilter.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/NonAbstractClassFilter.java
@@ -28,6 +28,7 @@ import org.apache.maven.surefire.util.ScannerFilter;
public class NonAbstractClassFilter
implements ScannerFilter
{
+ @Override
public boolean accept( Class testClass )
{
return !Modifier.isAbstract( testClass.getModifiers() );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java b/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java
index ca98b8c..cfe7258 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java
@@ -48,6 +48,7 @@ public class SpecificTestClassFilter
}
}
+ @Override
public boolean accept( Class testClass )
{
// If the tests enumeration is empty, allow anything.
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/booter/BaseProviderFactory.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/booter/BaseProviderFactory.java b/surefire-api/src/main/java/org/apache/maven/surefire/booter/BaseProviderFactory.java
index 2a713ef..2b329ee 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/booter/BaseProviderFactory.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/booter/BaseProviderFactory.java
@@ -85,6 +85,7 @@ public class BaseProviderFactory
this.insideFork = insideFork;
}
+ @Override
@Deprecated
public DirectoryScanner getDirectoryScanner()
{
@@ -95,6 +96,7 @@ public class BaseProviderFactory
directoryScannerParameters.getSpecificTests() );
}
+ @Override
public ScanResult getScanResult()
{
return DefaultScanResult.from( providerProperties );
@@ -106,32 +108,38 @@ public class BaseProviderFactory
return threadcount == null ? 1 : Math.max( Integer.parseInt( threadcount ), 1 );
}
+ @Override
public RunOrderCalculator getRunOrderCalculator()
{
return directoryScannerParameters == null
? null : new DefaultRunOrderCalculator( runOrderParameters, getThreadCount() );
}
+ @Override
public ReporterFactory getReporterFactory()
{
return reporterFactory;
}
+ @Override
public void setDirectoryScannerParameters( DirectoryScannerParameters directoryScannerParameters )
{
this.directoryScannerParameters = directoryScannerParameters;
}
+ @Override
public void setReporterConfiguration( ReporterConfiguration reporterConfiguration )
{
this.reporterConfiguration = reporterConfiguration;
}
+ @Override
public void setClassLoaders( ClassLoader testClassLoader )
{
this.testClassLoader = testClassLoader;
}
+ @Override
public ConsoleStream getConsoleLogger()
{
boolean trim = reporterConfiguration.isTrimStackTrace();
@@ -139,91 +147,109 @@ public class BaseProviderFactory
return insideFork ? new ForkingRunListener( out, ROOT_CHANNEL, trim ) : new DefaultDirectConsoleReporter( out );
}
+ @Override
public void setTestRequest( TestRequest testRequest )
{
this.testRequest = testRequest;
}
+ @Override
public DirectoryScannerParameters getDirectoryScannerParameters()
{
return directoryScannerParameters;
}
+ @Override
public ReporterConfiguration getReporterConfiguration()
{
return reporterConfiguration;
}
+ @Override
public TestRequest getTestRequest()
{
return testRequest;
}
+ @Override
public ClassLoader getTestClassLoader()
{
return testClassLoader;
}
+ @Override
public void setProviderProperties( Map<String, String> providerProperties )
{
this.providerProperties = providerProperties;
}
+ @Override
public Map<String, String> getProviderProperties()
{
return providerProperties;
}
+ @Override
public TestArtifactInfo getTestArtifactInfo()
{
return testArtifactInfo;
}
+ @Override
public void setTestArtifactInfo( TestArtifactInfo testArtifactInfo )
{
this.testArtifactInfo = testArtifactInfo;
}
+ @Override
public void setRunOrderParameters( RunOrderParameters runOrderParameters )
{
this.runOrderParameters = runOrderParameters;
}
+ @Override
public List<CommandLineOption> getMainCliOptions()
{
return mainCliOptions;
}
+ @Override
public void setMainCliOptions( List<CommandLineOption> mainCliOptions )
{
this.mainCliOptions = mainCliOptions == null ? Collections.<CommandLineOption>emptyList() : mainCliOptions;
}
+ @Override
public int getSkipAfterFailureCount()
{
return skipAfterFailureCount;
}
+ @Override
public void setSkipAfterFailureCount( int skipAfterFailureCount )
{
this.skipAfterFailureCount = skipAfterFailureCount;
}
+ @Override
public boolean isInsideFork()
{
return insideFork;
}
+ @Override
public Shutdown getShutdown()
{
return shutdown;
}
+ @Override
public void setShutdown( Shutdown shutdown )
{
this.shutdown = shutdown;
}
+ @Override
public Integer getSystemExitTimeout()
{
return systemExitTimeout;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/booter/CommandReader.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/booter/CommandReader.java b/surefire-api/src/main/java/org/apache/maven/surefire/booter/CommandReader.java
index 2e80f44..a24424b 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/booter/CommandReader.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/booter/CommandReader.java
@@ -261,6 +261,7 @@ public final class CommandReader
this.originalOutStream = originalOutStream;
}
+ @Override
public Iterator<String> iterator()
{
return new ClassesIterator( originalOutStream );
@@ -281,12 +282,14 @@ public final class CommandReader
this.originalOutStream = originalOutStream;
}
+ @Override
public boolean hasNext()
{
popUnread();
return isNotBlank( clazz );
}
+ @Override
public String next()
{
popUnread();
@@ -307,6 +310,7 @@ public final class CommandReader
}
}
+ @Override
public void remove()
{
throw new UnsupportedOperationException();
@@ -374,6 +378,7 @@ public final class CommandReader
private final class CommandRunnable
implements Runnable
{
+ @Override
public void run()
{
CommandReader.this.startMonitor.countDown();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingReporterFactory.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingReporterFactory.java b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingReporterFactory.java
index def345d..89469fa 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingReporterFactory.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingReporterFactory.java
@@ -49,11 +49,13 @@ public class ForkingReporterFactory
this.originalSystemOut = originalSystemOut;
}
+ @Override
public RunListener createReporter()
{
return new ForkingRunListener( originalSystemOut, testSetChannelId.getAndIncrement(), isTrimstackTrace );
}
+ @Override
public RunResult close()
{
return new RunResult( 17, 17, 17, 17 );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java
index 6c0842a..f0f0ac6 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java
@@ -131,46 +131,55 @@ public class ForkingRunListener
sendProps();
}
+ @Override
public void testSetStarting( ReportEntry report )
{
encodeAndWriteToTarget( toString( BOOTERCODE_TESTSET_STARTING, report, testSetChannelId ) );
}
+ @Override
public void testSetCompleted( ReportEntry report )
{
encodeAndWriteToTarget( toString( BOOTERCODE_TESTSET_COMPLETED, report, testSetChannelId ) );
}
+ @Override
public void testStarting( ReportEntry report )
{
encodeAndWriteToTarget( toString( BOOTERCODE_TEST_STARTING, report, testSetChannelId ) );
}
+ @Override
public void testSucceeded( ReportEntry report )
{
encodeAndWriteToTarget( toString( BOOTERCODE_TEST_SUCCEEDED, report, testSetChannelId ) );
}
+ @Override
public void testAssumptionFailure( ReportEntry report )
{
encodeAndWriteToTarget( toString( BOOTERCODE_TEST_ASSUMPTIONFAILURE, report, testSetChannelId ) );
}
+ @Override
public void testError( ReportEntry report )
{
encodeAndWriteToTarget( toString( BOOTERCODE_TEST_ERROR, report, testSetChannelId ) );
}
+ @Override
public void testFailed( ReportEntry report )
{
encodeAndWriteToTarget( toString( BOOTERCODE_TEST_FAILED, report, testSetChannelId ) );
}
+ @Override
public void testSkipped( ReportEntry report )
{
encodeAndWriteToTarget( toString( BOOTERCODE_TEST_SKIPPED, report, testSetChannelId ) );
}
+ @Override
public void testExecutionSkippedByUser()
{
encodeAndWriteToTarget( toString( BOOTERCODE_STOP_ON_NEXT_TEST, new SimpleReportEntry(), testSetChannelId ) );
@@ -190,6 +199,7 @@ public class ForkingRunListener
}
}
+ @Override
public void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
{
byte[] header = stdout ? stdOutHeader : stdErrHeader;
@@ -238,31 +248,37 @@ public class ForkingRunListener
}
}
+ @Override
public void debug( String message )
{
log( BOOTERCODE_DEBUG, message );
}
+ @Override
public void info( String message )
{
log( BOOTERCODE_CONSOLE, message );
}
+ @Override
public void warning( String message )
{
log( BOOTERCODE_WARNING, message );
}
+ @Override
public void error( String message )
{
log( BOOTERCODE_ERROR, message );
}
+ @Override
public void error( String message, Throwable t )
{
error( ConsoleLoggerUtils.toString( message, t ) );
}
+ @Override
public void error( Throwable t )
{
error( null, t );
@@ -391,12 +407,14 @@ public class ForkingRunListener
}
}
+ @Override
public void println( String message )
{
byte[] buf = message.getBytes();
println( buf, 0, buf.length );
}
+ @Override
public void println( byte[] buf, int off, int len )
{
writeTestOutput( buf, off, len, true );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/booter/MasterProcessCommand.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/booter/MasterProcessCommand.java b/surefire-api/src/main/java/org/apache/maven/surefire/booter/MasterProcessCommand.java
index f985d26..c82c798 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/booter/MasterProcessCommand.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/booter/MasterProcessCommand.java
@@ -21,13 +21,12 @@ package org.apache.maven.surefire.booter;
import java.io.DataInputStream;
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
-import static org.apache.maven.surefire.util.internal.StringUtils.FORK_STREAM_CHARSET_NAME;
-import static org.apache.maven.surefire.util.internal.StringUtils.encodeStringForForkCommunication;
-import static org.apache.maven.surefire.util.internal.ObjectUtils.requireNonNull;
import static java.lang.String.format;
+import static org.apache.maven.surefire.util.internal.ObjectUtils.requireNonNull;
+import static org.apache.maven.surefire.util.internal.StringUtils.ISO_8859_1;
+import static org.apache.maven.surefire.util.internal.StringUtils.US_ASCII;
+import static org.apache.maven.surefire.util.internal.StringUtils.encodeStringForForkCommunication;
/**
* Commands which are sent from plugin to the forked jvm.
@@ -47,8 +46,6 @@ public enum MasterProcessCommand
NOOP( 4, Void.class ),
BYE_ACK( 5, Void.class );
- private static final Charset ASCII = Charset.forName( "US-ASCII" );
-
private final int id;
private final Class<?> dataType;
@@ -143,21 +140,14 @@ public enum MasterProcessCommand
String toDataTypeAsString( byte... data )
{
- try
- {
- switch ( this )
- {
- case RUN_CLASS:
- return new String( data, FORK_STREAM_CHARSET_NAME );
- case SHUTDOWN:
- return new String( data, ASCII );
- default:
- return null;
- }
- }
- catch ( UnsupportedEncodingException e )
+ switch ( this )
{
- throw new IllegalStateException( e );
+ case RUN_CLASS:
+ return new String( data, ISO_8859_1 );
+ case SHUTDOWN:
+ return new String( data, US_ASCII );
+ default:
+ return null;
}
}
@@ -168,7 +158,7 @@ public enum MasterProcessCommand
case RUN_CLASS:
return encodeStringForForkCommunication( data );
case SHUTDOWN:
- return data.getBytes( ASCII );
+ return data.getBytes( US_ASCII );
default:
return new byte[0];
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java b/surefire-api/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java
index 528589c..54677a7 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java
@@ -169,6 +169,7 @@ public class SurefireReflector
this.target = delegate;
}
+ @Override
public Object invoke( Object proxy, Method method, Object[] args )
throws Throwable
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/AbstractProvider.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/AbstractProvider.java b/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/AbstractProvider.java
index 19d1da3..eca3909 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/AbstractProvider.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/AbstractProvider.java
@@ -29,6 +29,7 @@ public abstract class AbstractProvider
{
private final Thread creatingThread = Thread.currentThread();
+ @Override
public void cancel()
{
synchronized ( creatingThread )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/report/CategorizedReportEntry.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/report/CategorizedReportEntry.java b/surefire-api/src/main/java/org/apache/maven/surefire/report/CategorizedReportEntry.java
index 0cccd6e..c357cba 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/report/CategorizedReportEntry.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/report/CategorizedReportEntry.java
@@ -59,6 +59,7 @@ public class CategorizedReportEntry
: new SimpleReportEntry( source, name, stackTraceWriter, elapsed, message );
}
+ @Override
public String getGroup()
{
return group;
@@ -70,6 +71,7 @@ public class CategorizedReportEntry
return isNameWithGroup() ? getName() + GROUP_PREFIX + getGroup() + GROUP_SUFIX : getName();
}
+ @Override
public boolean equals( Object o )
{
if ( this == o )
@@ -91,6 +93,7 @@ public class CategorizedReportEntry
}
+ @Override
public int hashCode()
{
int result = super.hashCode();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/report/ConsoleOutputCapture.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/report/ConsoleOutputCapture.java b/surefire-api/src/main/java/org/apache/maven/surefire/report/ConsoleOutputCapture.java
index b583593..28f111b 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/report/ConsoleOutputCapture.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/report/ConsoleOutputCapture.java
@@ -52,6 +52,7 @@ public class ConsoleOutputCapture
this.target = target;
}
+ @Override
public void write( byte[] buf, int off, int len )
{
// Note: At this point the supplied "buf" instance is reused, which means
@@ -59,12 +60,14 @@ public class ConsoleOutputCapture
target.writeTestOutput( buf, off, len, isStdout );
}
+ @Override
public void write( byte[] b )
throws IOException
{
target.writeTestOutput( b, 0, b.length, isStdout );
}
+ @Override
public void write( int b )
{
byte[] buf = new byte[1];
@@ -79,6 +82,7 @@ public class ConsoleOutputCapture
}
}
+ @Override
public void println( String s )
{
if ( s == null )
@@ -89,10 +93,12 @@ public class ConsoleOutputCapture
target.writeTestOutput( bytes, 0, bytes.length, isStdout );
}
+ @Override
public void close()
{
}
+ @Override
public void flush()
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/report/DefaultDirectConsoleReporter.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/report/DefaultDirectConsoleReporter.java b/surefire-api/src/main/java/org/apache/maven/surefire/report/DefaultDirectConsoleReporter.java
index f1e0f48..5298ad9 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/report/DefaultDirectConsoleReporter.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/report/DefaultDirectConsoleReporter.java
@@ -34,11 +34,13 @@ public final class DefaultDirectConsoleReporter
this.systemOut = systemOut;
}
+ @Override
public void println( String message )
{
systemOut.println( message );
}
+ @Override
public void println( byte[] buf, int off, int len )
{
println( new String( buf, off, len ) );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriter.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriter.java b/surefire-api/src/main/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriter.java
index d1e1890..88552cb 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriter.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriter.java
@@ -49,6 +49,7 @@ public class LegacyPojoStackTraceWriter
this.t = t;
}
+ @Override
public String writeTraceToString()
{
if ( t != null )
@@ -79,6 +80,7 @@ public class LegacyPojoStackTraceWriter
return "";
}
+ @Override
public String smartTrimmedStackTrace()
{
StringBuilder result = new StringBuilder();
@@ -147,6 +149,7 @@ public class LegacyPojoStackTraceWriter
}
+ @Override
public String writeTrimmedTraceToString()
{
String text = writeTraceToString();
@@ -189,6 +192,7 @@ public class LegacyPojoStackTraceWriter
return trace.toString();
}
+ @Override
public SafeThrowable getThrowable()
{
return new SafeThrowable( t );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/report/SimpleReportEntry.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/report/SimpleReportEntry.java b/surefire-api/src/main/java/org/apache/maven/surefire/report/SimpleReportEntry.java
index 4715b24..28a19f9 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/report/SimpleReportEntry.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/report/SimpleReportEntry.java
@@ -118,37 +118,44 @@ public class SimpleReportEntry
}
}
+ @Override
public String getSourceName()
{
return source;
}
+ @Override
public String getName()
{
return name;
}
+ @Override
public String getGroup()
{
return null;
}
+ @Override
public StackTraceWriter getStackTraceWriter()
{
return stackTraceWriter;
}
+ @Override
public Integer getElapsed()
{
return elapsed;
}
+ @Override
public String toString()
{
return "ReportEntry{" + "source='" + source + '\'' + ", name='" + name + '\'' + ", stackTraceWriter="
+ stackTraceWriter + ", elapsed=" + elapsed + ",message=" + message + '}';
}
+ @Override
public String getMessage()
{
return message;
@@ -157,6 +164,7 @@ public class SimpleReportEntry
/**
* @noinspection RedundantIfStatement
*/
+ @Override
public boolean equals( Object o )
{
if ( this == o )
@@ -192,6 +200,7 @@ public class SimpleReportEntry
return true;
}
+ @Override
public int hashCode()
{
int result = source != null ? source.hashCode() : 0;
@@ -201,6 +210,7 @@ public class SimpleReportEntry
return result;
}
+ @Override
public String getNameWithGroup()
{
return getName();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/suite/RunResult.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/suite/RunResult.java b/surefire-api/src/main/java/org/apache/maven/surefire/suite/RunResult.java
index 1525e80..aa099c8 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/suite/RunResult.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/suite/RunResult.java
@@ -202,6 +202,7 @@ public class RunResult
return new RunResult( 0, 0, 0, 0 );
}
+ @Override
@SuppressWarnings( "RedundantIfStatement" )
public boolean equals( Object o )
{
@@ -244,6 +245,7 @@ public class RunResult
return true;
}
+ @Override
public int hashCode()
{
int result = completedCount;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java b/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
index e2ae963..a7f0e28 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
@@ -117,16 +117,19 @@ public class TestListResolver
includedPatterns, excludedPatterns );
}
+ @Override
public boolean hasIncludedMethodPatterns()
{
return hasIncludedMethodPatterns;
}
+ @Override
public boolean hasExcludedMethodPatterns()
{
return hasExcludedMethodPatterns;
}
+ @Override
public boolean hasMethodPatterns()
{
return hasIncludedMethodPatterns() || hasExcludedMethodPatterns();
@@ -162,6 +165,7 @@ public class TestListResolver
{
return new TestFilter<String, String>()
{
+ @Override
public boolean shouldRun( String testClass, String methodName )
{
return TestListResolver.this.shouldRun( testClass, methodName )
@@ -174,6 +178,7 @@ public class TestListResolver
{
return new TestFilter<String, String>()
{
+ @Override
public boolean shouldRun( String testClass, String methodName )
{
return TestListResolver.this.shouldRun( testClass, methodName )
@@ -193,6 +198,7 @@ public class TestListResolver
* @param testClassFile format must be e.g. "my/package/MyTest.class" including class extension; or null
* @param methodName real test-method name; or null
*/
+ @Override
public boolean shouldRun( String testClassFile, String methodName )
{
if ( isEmpty() || isBlank( testClassFile ) && isBlank( methodName ) )
@@ -234,11 +240,13 @@ public class TestListResolver
}
}
+ @Override
public boolean isEmpty()
{
return equals( EMPTY );
}
+ @Override
public String getPluginParameterTest()
{
String aggregatedTest = aggregatedTest( "", getIncludedPatterns() );
@@ -252,11 +260,13 @@ public class TestListResolver
return aggregatedTest.length() == 0 ? "" : aggregatedTest;
}
+ @Override
public Set<ResolvedTest> getIncludedPatterns()
{
return includedPatterns;
}
+ @Override
public Set<ResolvedTest> getExcludedPatterns()
{
return excludedPatterns;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/util/CloseableIterator.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/CloseableIterator.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/CloseableIterator.java
index 52b5b65..fc2f644 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/CloseableIterator.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/CloseableIterator.java
@@ -1 +1 @@
-package org.apache.maven.surefire.util;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* This iterator is marked as stopped if {@link #isClosed()} returns {@c
ode true}.
* If the iterator has been closed before calling {@link #hasNext()} then the method returns {@code false}.
* If the iterator was closed after {@link #hasNext() hasNext returns true} but before {@link #next()}, the
* method {@link #next()} throws {@link java.util.NoSuchElementException}.
* The method {@link #remove()} throws {@link IllegalStateException} if the iterator has been closed.
*
* @param <T> the type of elements returned by this iterator
*
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.19.1
*/
public abstract class CloseableIterator<T>
implements Iterator<T>
{
private Boolean finishCurrentIteration;
protected abstract boolean isClosed();
protected abstract boolean doHasNext();
protected abstract T doNext();
protected abstract void doRemove();
public boolean hasNext()
{
popMarker();
return !finishCurrentIteration && doHasNext();
}
public T next()
{
try
{
if ( popMarker() && finishCurrentIteration )
{
throw new NoSuchElementException( "iterator closed" );
}
return doNext();
}
finally
{
finishCurrentIteration = null;
}
}
public void remove()
{
try
{
if ( popMarker() && finishCurrentIteration )
{
throw new IllegalStateException( "iterator closed" );
}
doRemove();
}
finally
{
finishCurrentIteration = null;
}
}
/**
* @return {@code true} if marker changed from NULL to anything
*/
private boolean popMarker()
{
if ( finishCurrentIteration == null )
{
finishCurrentIteration = isClosed();
return true;
}
return false;
}
}
\ No newline at end of file
+package org.apache.maven.surefire.util;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* This iterator is marked as stopped if {@link #isClosed()} returns {@c
ode true}.
* If the iterator has been closed before calling {@link #hasNext()} then the method returns {@code false}.
* If the iterator was closed after {@link #hasNext() hasNext returns true} but before {@link #next()}, the
* method {@link #next()} throws {@link java.util.NoSuchElementException}.
* The method {@link #remove()} throws {@link IllegalStateException} if the iterator has been closed.
*
* @param <T> the type of elements returned by this iterator
*
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.19.1
*/
public abstract class CloseableIterator<T>
implements Iterator<T>
{
private Boolean finishCurrentIteration;
protected abstract boolean isClosed();
protected abstract boolean doHasNext();
protected abstract T doNext();
protected abstract void doRemove();
@Override
public boolean hasNext()
{
popMarker();
return !finishCurrentIteration && doHasNext();
}
@Overri
de
public T next()
{
try
{
if ( popMarker() && finishCurrentIteration )
{
throw new NoSuchElementException( "iterator closed" );
}
return doNext();
}
finally
{
finishCurrentIteration = null;
}
}
@Override
public void remove()
{
try
{
if ( popMarker() && finishCurrentIteration )
{
throw new IllegalStateException( "iterator closed" );
}
doRemove();
}
finally
{
finishCurrentIteration = null;
}
}
/**
* @return {@code true} if marker changed from NULL to anything
*/
private boolean popMarker()
{
if ( finishCurrentIteration == null )
{
finishCurrentIteration = isClosed();
return true;
}
return false;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java
index 7353165..b8be70f 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java
@@ -64,6 +64,7 @@ public class DefaultDirectoryScanner
this.specificTests = specificTests;
}
+ @Override
public TestsToRun locateTestClasses( ClassLoader classLoader, ScannerFilter scannerFilter )
{
String[] testClassNames = collectTests();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultRunOrderCalculator.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultRunOrderCalculator.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultRunOrderCalculator.java
index 7f8d9e1..dea10a6 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultRunOrderCalculator.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultRunOrderCalculator.java
@@ -53,6 +53,7 @@ public class DefaultRunOrderCalculator
this.sortOrder = this.runOrder.length > 0 ? getSortOrderComparator( this.runOrder[0] ) : null;
}
+ @Override
@SuppressWarnings( "checkstyle:magicnumber" )
public TestsToRun orderTestClasses( TestsToRun scannedClasses )
{
@@ -120,6 +121,7 @@ public class DefaultRunOrderCalculator
{
return new Comparator<Class>()
{
+ @Override
public int compare( Class o1, Class o2 )
{
return o2.getName().compareTo( o1.getName() );
@@ -131,6 +133,7 @@ public class DefaultRunOrderCalculator
{
return new Comparator<Class>()
{
+ @Override
public int compare( Class o1, Class o2 )
{
return o1.getName().compareTo( o2.getName() );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultScanResult.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultScanResult.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultScanResult.java
index ff75508..a00a3b5 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultScanResult.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultScanResult.java
@@ -41,16 +41,19 @@ public class DefaultScanResult
this.files = Collections.unmodifiableList( files );
}
+ @Override
public int size()
{
return files.size();
}
+ @Override
public String getClassName( int index )
{
return files.get( index );
}
+ @Override
public void writeTo( Map<String, String> properties )
{
for ( int i = 0, size = files.size(); i < size; i++ )
@@ -84,6 +87,7 @@ public class DefaultScanResult
return files;
}
+ @Override
public TestsToRun applyFilter( ScannerFilter scannerFilter, ClassLoader testClassLoader )
{
Set<Class<?>> result = new LinkedHashSet<Class<?>>();
@@ -104,6 +108,7 @@ public class DefaultScanResult
return new TestsToRun( result );
}
+ @Override
public List<Class<?>> getClassesSkippedByValidation( ScannerFilter scannerFilter, ClassLoader testClassLoader )
{
List<Class<?>> result = new ArrayList<Class<?>>();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/util/RunOrder.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/RunOrder.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/RunOrder.java
index ebbec70..79c5235 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/RunOrder.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/RunOrder.java
@@ -143,6 +143,7 @@ public class RunOrder
return name;
}
+ @Override
public String toString()
{
return name;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/util/TestsToRun.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/TestsToRun.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/TestsToRun.java
index 204bed8..8a264ca 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/TestsToRun.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/TestsToRun.java
@@ -73,6 +73,7 @@ public class TestsToRun implements Iterable<Class<?>>
*
* @return an unmodifiable iterator
*/
+ @Override
public Iterator<Class<?>> iterator()
{
return new ClassesIterator();
@@ -127,6 +128,7 @@ public class TestsToRun implements Iterable<Class<?>>
return finished;
}
+ @Override
public String toString()
{
StringBuilder sb = new StringBuilder( "TestsToRun: [" );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/ByteBuffer.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/ByteBuffer.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/ByteBuffer.java
index 69da150..bdd983f 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/ByteBuffer.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/ByteBuffer.java
@@ -104,6 +104,7 @@ public class ByteBuffer
return position;
}
+ @Override
public String toString()
{
return new String( data, 0, position );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DaemonThreadFactory.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DaemonThreadFactory.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DaemonThreadFactory.java
index 29eb18d..4912f8e 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DaemonThreadFactory.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DaemonThreadFactory.java
@@ -43,6 +43,7 @@ public final class DaemonThreadFactory
namePrefix = "pool-" + POOL_NUMBER.getAndIncrement() + "-thread-";
}
+ @Override
public Thread newThread( Runnable r )
{
Thread t = new Thread( group, r, namePrefix + threadNumber.getAndIncrement() );
@@ -104,6 +105,7 @@ public final class DaemonThreadFactory
this.name = name;
}
+ @Override
public Thread newThread( Runnable r )
{
return newDaemonThread( r, name );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DumpFileUtils.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DumpFileUtils.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DumpFileUtils.java
index ebf0795..cad2e7a 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DumpFileUtils.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/DumpFileUtils.java
@@ -30,6 +30,8 @@ import java.io.Writer;
import java.text.SimpleDateFormat;
import java.util.Date;
+import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8;
+
/**
* Dumps a text or exception in dump file.
* Each call logs a date when it was written to the dump file.
@@ -111,7 +113,7 @@ public final class DumpFileUtils
private static Writer createWriter( File dumpFile ) throws IOException
{
- return new OutputStreamWriter( new FileOutputStream( dumpFile, true ), "UTF-8" )
+ return new OutputStreamWriter( new FileOutputStream( dumpFile, true ), UTF_8 )
.append( "# Created on " )
.append( new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS" ).format( new Date() ) )
.append( StringUtils.NL );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/StringUtils.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/StringUtils.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/StringUtils.java
index d1838b2..bb7c3a7 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/StringUtils.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/StringUtils.java
@@ -19,7 +19,6 @@ package org.apache.maven.surefire.util.internal;
* under the License.
*/
-import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
@@ -64,8 +63,16 @@ public final class StringUtils
private static final Charset DEFAULT_CHARSET = Charset.defaultCharset();
+ /**
+ * TODO
+ * Use JDK7 StandardCharsets
+ */
+ public static final Charset US_ASCII = Charset.forName( "US-ASCII" );
+
// 8-bit charset Latin-1
- public static final String FORK_STREAM_CHARSET_NAME = "ISO-8859-1";
+ public static final Charset ISO_8859_1 = Charset.forName( "ISO-8859-1" );
+
+ public static final Charset UTF_8 = Charset.forName( "UTF-8" );
private StringUtils()
{
@@ -347,14 +354,7 @@ public final class StringUtils
public static byte[] encodeStringForForkCommunication( String string )
{
- try
- {
- return string.getBytes( FORK_STREAM_CHARSET_NAME );
- }
- catch ( UnsupportedEncodingException e )
- {
- throw new RuntimeException( "The JVM must support Charset " + FORK_STREAM_CHARSET_NAME, e );
- }
+ return string.getBytes( ISO_8859_1 );
}
/**
[2/4] maven-surefire git commit: [SUREFIRE-1363] Java 1.6 features
@Override and Charset
Posted by ti...@apache.org.
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/UrlUtils.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/UrlUtils.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/UrlUtils.java
index 3a33b7f..dd96f28 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/UrlUtils.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/UrlUtils.java
@@ -20,11 +20,12 @@ package org.apache.maven.surefire.util.internal;
*/
import java.io.File;
-import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.BitSet;
+import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8;
+
/**
* Utility for dealing with URLs in pre-JDK 1.4.
*/
@@ -41,22 +42,12 @@ public final class UrlUtils
throw new IllegalStateException( "no instantiable constructor" );
}
- private static final String ENCODING = "UTF-8";
-
static
{
- try
- {
- byte[] bytes =
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.!~*'():/".getBytes( ENCODING );
- for ( byte aByte : bytes )
- {
- UNRESERVED.set( aByte );
- }
- }
- catch ( UnsupportedEncodingException e )
+ byte[] bytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.!~*'():/".getBytes( UTF_8 );
+ for ( byte aByte : bytes )
{
- // can't happen as UTF-8 must be present
+ UNRESERVED.set( aByte );
}
}
@@ -68,29 +59,21 @@ public final class UrlUtils
URL url = file.toURL();
// encode any characters that do not comply with RFC 2396
// this is primarily to handle Windows where the user's home directory contains spaces
- try
+ byte[] bytes = url.toString().getBytes( UTF_8 );
+ StringBuilder buf = new StringBuilder( bytes.length );
+ for ( byte b : bytes )
{
- byte[] bytes = url.toString().getBytes( ENCODING );
- StringBuilder buf = new StringBuilder( bytes.length );
- for ( byte b : bytes )
+ if ( b > 0 && UNRESERVED.get( b ) )
{
- if ( b > 0 && UNRESERVED.get( b ) )
- {
- buf.append( (char) b );
- }
- else
- {
- buf.append( '%' );
- buf.append( Character.forDigit( b >>> 4 & MASK, RADIX ) );
- buf.append( Character.forDigit( b & MASK, RADIX ) );
- }
+ buf.append( (char) b );
+ }
+ else
+ {
+ buf.append( '%' );
+ buf.append( Character.forDigit( b >>> 4 & MASK, RADIX ) );
+ buf.append( Character.forDigit( b & MASK, RADIX ) );
}
- return new URL( buf.toString() );
- }
- catch ( UnsupportedEncodingException e )
- {
- // should not happen as UTF-8 must be present
- throw new RuntimeException( e );
}
+ return new URL( buf.toString() );
}
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
index 84a445d..8394e00 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
@@ -29,10 +29,12 @@ public class SurefireReflectorTest
public void testShouldCreateFactoryWithoutException()
{
ReporterFactory factory = new ReporterFactory() {
+ @Override
public RunListener createReporter() {
return null;
}
+ @Override
public RunResult close() {
return null;
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/test/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriterTest.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriterTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriterTest.java
index eb81871..d81e816 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriterTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriterTest.java
@@ -136,6 +136,7 @@ public class LegacyPojoStackTraceWriterTest
this.stackTrace = stackTrace;
}
+ @Override
public void printStackTrace( PrintWriter s )
{
s.write( stackTrace );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/test/java/org/apache/maven/surefire/util/UrlUtilsTest.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/util/UrlUtilsTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/util/UrlUtilsTest.java
index 964fa10..d5ecc46 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/util/UrlUtilsTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/util/UrlUtilsTest.java
@@ -35,6 +35,7 @@ public class UrlUtilsTest
{
private String homeDir;
+ @Override
public void setUp()
throws Exception
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-api/src/test/java/org/apache/maven/surefire/util/internal/ConcurrencyUtilsTest.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/util/internal/ConcurrencyUtilsTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/util/internal/ConcurrencyUtilsTest.java
index 516f885..7e76fbf 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/util/internal/ConcurrencyUtilsTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/util/internal/ConcurrencyUtilsTest.java
@@ -81,6 +81,7 @@ public class ConcurrencyUtilsTest
FutureTask<Boolean> task = new FutureTask<Boolean>( new Callable<Boolean>()
{
+ @Override
public Boolean call()
throws Exception
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
index e7d97c8..346e075 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/Classpath.java
@@ -139,6 +139,7 @@ public class Classpath implements Iterable<String>
System.setProperty( propertyName, sb.toString() );
}
+ @Override
public boolean equals( Object o )
{
if ( this == o )
@@ -179,6 +180,7 @@ public class Classpath implements Iterable<String>
}
}
+ @Override
public int hashCode()
{
return unmodifiableElements.hashCode();
@@ -223,6 +225,7 @@ public class Classpath implements Iterable<String>
return result.toString();
}
+ @Override
public Iterator<String> iterator()
{
return unmodifiableElements.iterator();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
index 3c18578..d5bba1f 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
@@ -217,6 +217,7 @@ public final class ForkedBooter
{
return new CommandListener()
{
+ @Override
public void update( Command command )
{
pingDone.set( true );
@@ -228,6 +229,7 @@ public final class ForkedBooter
{
return new CommandListener()
{
+ @Override
public void update( Command command )
{
Shutdown shutdown = command.toShutdownData();
@@ -248,6 +250,7 @@ public final class ForkedBooter
{
return new Runnable()
{
+ @Override
public void run()
{
boolean hasPing = pingDone.getAndSet( false );
@@ -361,6 +364,7 @@ public final class ForkedBooter
{
getJvmTerminator().schedule( new Runnable()
{
+ @Override
public void run()
{
Runtime.getRuntime().halt( returnCode );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/IsolatedClassLoader.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/IsolatedClassLoader.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/IsolatedClassLoader.java
index 31db087..a4d7d09 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/IsolatedClassLoader.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/IsolatedClassLoader.java
@@ -53,6 +53,7 @@ public class IsolatedClassLoader
* @deprecated this method will use {@link java.io.File} instead of {@link URL} in the next
* major version.
*/
+ @Override
@Deprecated
public void addURL( URL url )
{
@@ -65,6 +66,7 @@ public class IsolatedClassLoader
}
}
+ @Override
public synchronized Class loadClass( String name )
throws ClassNotFoundException
{
@@ -99,6 +101,7 @@ public class IsolatedClassLoader
}
}
+ @Override
public String toString()
{
return "IsolatedClassLoader{roleName='" + roleName + "'}";
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/LazyTestsToRun.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/LazyTestsToRun.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/LazyTestsToRun.java
index 29a59b6..3237d07 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/LazyTestsToRun.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/LazyTestsToRun.java
@@ -63,16 +63,19 @@ final class LazyTestsToRun
{
private final Iterator<String> it = getReader().getIterableClasses( originalOutStream ).iterator();
+ @Override
public boolean hasNext()
{
return it.hasNext();
}
+ @Override
public Class<?> next()
{
return findClass( it.next() );
}
+ @Override
public void remove()
{
throw new UnsupportedOperationException();
@@ -93,6 +96,7 @@ final class LazyTestsToRun
* {@inheritDoc}
* @see org.apache.maven.surefire.util.TestsToRun#iterator()
* */
+ @Override
public Iterator<Class<?>> iterator()
{
return new BlockingIterator();
@@ -102,6 +106,7 @@ final class LazyTestsToRun
* {@inheritDoc}
* @see org.apache.maven.surefire.util.TestsToRun#toString()
*/
+ @Override
public String toString()
{
return "LazyTestsToRun";
@@ -111,6 +116,7 @@ final class LazyTestsToRun
* {@inheritDoc}
* @see org.apache.maven.surefire.util.TestsToRun#allowEagerReading()
*/
+ @Override
public boolean allowEagerReading()
{
return false;
@@ -153,6 +159,7 @@ final class LazyTestsToRun
{
}
+ @Override
public void remove()
{
throw new UnsupportedOperationException( "unsupported remove" );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java
index 5a19e26..41b4850 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java
@@ -167,6 +167,7 @@ public class PropertiesWrapper
}
}
+ @Override
public void copyTo( Map<Object, Object> target )
{
target.putAll( properties );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
index 36f823b..ae4e08e 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
@@ -134,6 +134,7 @@ public class ProviderFactory
this.testsClassLoader = testsClassLoader;
}
+ @Override
@SuppressWarnings( "unchecked" )
public Iterable<Class<?>> getSuites()
{
@@ -148,6 +149,7 @@ public class ProviderFactory
}
}
+ @Override
public RunResult invoke( Object forkTestSet )
throws TestSetFailedException, InvocationTargetException
{
@@ -175,6 +177,7 @@ public class ProviderFactory
return current;
}
+ @Override
public void cancel()
{
Class<?> providerType = providerInOtherClassLoader.getClass();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/TypeEncodedValue.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/TypeEncodedValue.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/TypeEncodedValue.java
index bbd0f70..b5ad18f 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/TypeEncodedValue.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/TypeEncodedValue.java
@@ -21,9 +21,11 @@ package org.apache.maven.surefire.booter;
import java.io.ByteArrayInputStream;
import java.io.File;
+import java.io.IOException;
import java.util.Properties;
import static org.apache.maven.surefire.util.ReflectionUtils.loadClass;
+import static org.apache.maven.surefire.util.internal.StringUtils.ISO_8859_1;
/**
* @author Kristian Rosenvold
@@ -79,13 +81,12 @@ public class TypeEncodedValue
else if ( type.equals( Properties.class.getName() ) )
{
Properties result = new Properties();
- // todo: use jdk7 Closable
try
{
- result.load( new ByteArrayInputStream( value.getBytes( "8859_1" ) ) );
+ result.load( new ByteArrayInputStream( value.getBytes( ISO_8859_1 ) ) );
return result;
}
- catch ( Exception e )
+ catch ( IOException e )
{
throw new IllegalStateException( "bug in property conversion", e );
}
@@ -96,6 +97,7 @@ public class TypeEncodedValue
}
}
+ @Override
public boolean equals( Object o )
{
if ( this == o )
@@ -113,6 +115,7 @@ public class TypeEncodedValue
}
+ @Override
public int hashCode()
{
int result = type != null ? type.hashCode() : 0;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java
index b731dc0..ccc33d5 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java
@@ -40,7 +40,7 @@ import java.util.concurrent.FutureTask;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
-import static org.apache.maven.surefire.util.internal.StringUtils.FORK_STREAM_CHARSET_NAME;
+import static org.apache.maven.surefire.util.internal.StringUtils.ISO_8859_1;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -160,6 +160,7 @@ public class CommandReaderTest
{
Runnable runnable = new Runnable()
{
+ @Override
public void run()
{
Iterator<String> it = reader.getIterableClasses( nul() ).iterator();
@@ -187,6 +188,7 @@ public class CommandReaderTest
final CountDownLatch counter = new CountDownLatch( 1 );
Runnable runnable = new Runnable()
{
+ @Override
public void run()
{
Iterator<String> it = reader.getIterableClasses( nul() ).iterator();
@@ -240,7 +242,7 @@ public class CommandReaderTest
private void addTestToPipeline( String cls )
throws UnsupportedEncodingException
{
- byte[] clazz = cls.getBytes( FORK_STREAM_CHARSET_NAME );
+ byte[] clazz = cls.getBytes( ISO_8859_1 );
ByteBuffer buffer = ByteBuffer.allocate( 8 + clazz.length )
.putInt( MasterProcessCommand.RUN_CLASS.getId() )
.putInt( clazz.length )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/Foo.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/Foo.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/Foo.java
index 99b8564..911c969 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/Foo.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/Foo.java
@@ -52,6 +52,7 @@ public class Foo
boolean called = false;
+ @Override
public void setDirectoryScannerParameters( DirectoryScannerParameters directoryScanner )
{
this.directoryScannerParameters = directoryScanner;
@@ -68,18 +69,21 @@ public class Foo
return called;
}
+ @Override
public void setProviderProperties( Map<String, String> providerProperties )
{
this.providerProperties = providerProperties;
this.called = true;
}
+ @Override
public void setReporterConfiguration( ReporterConfiguration reporterConfiguration )
{
this.reporterConfiguration = reporterConfiguration;
this.called = true;
}
+ @Override
public void setClassLoaders( ClassLoader testClassLoader )
{
this.testClassLoader = testClassLoader;
@@ -87,18 +91,21 @@ public class Foo
this.called = true;
}
+ @Override
public void setTestRequest( TestRequest testRequest1 )
{
this.testRequest = testRequest1;
this.called = true;
}
+ @Override
public void setTestArtifactInfo( TestArtifactInfo testArtifactInfo )
{
this.testArtifactInfo = testArtifactInfo;
this.called = true;
}
+ @Override
public void setRunOrderParameters( RunOrderParameters runOrderParameters )
{
this.runOrderParameters = runOrderParameters;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/AndGroupMatcher.java
----------------------------------------------------------------------
diff --git a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/AndGroupMatcher.java b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/AndGroupMatcher.java
index 1ffc894..e9adb22 100644
--- a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/AndGroupMatcher.java
+++ b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/AndGroupMatcher.java
@@ -45,6 +45,7 @@ public class AndGroupMatcher
}
}
+ @Override
public boolean enabled( Class<?>... cats )
{
for ( GroupMatcher matcher : getMatchers() )
@@ -59,6 +60,7 @@ public class AndGroupMatcher
return true;
}
+ @Override
public boolean enabled( String... cats )
{
for ( GroupMatcher matcher : getMatchers() )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/InverseGroupMatcher.java
----------------------------------------------------------------------
diff --git a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/InverseGroupMatcher.java b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/InverseGroupMatcher.java
index 0ab1d43..2028b1b 100644
--- a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/InverseGroupMatcher.java
+++ b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/InverseGroupMatcher.java
@@ -35,11 +35,13 @@ public class InverseGroupMatcher
this.matcher = matcher;
}
+ @Override
public boolean enabled( Class<?>... cats )
{
return cats == null || !matcher.enabled( cats );
}
+ @Override
public boolean enabled( String... cats )
{
return cats == null || !matcher.enabled( cats );
@@ -87,6 +89,7 @@ public class InverseGroupMatcher
return true;
}
+ @Override
public void loadGroupClasses( ClassLoader cloader )
{
matcher.loadGroupClasses( cloader );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/JoinGroupMatcher.java
----------------------------------------------------------------------
diff --git a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/JoinGroupMatcher.java b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/JoinGroupMatcher.java
index ec8ac76..f130ee4 100644
--- a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/JoinGroupMatcher.java
+++ b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/JoinGroupMatcher.java
@@ -42,6 +42,7 @@ public abstract class JoinGroupMatcher
return matchers;
}
+ @Override
public void loadGroupClasses( ClassLoader cloader )
{
for ( GroupMatcher matcher : matchers )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/OrGroupMatcher.java
----------------------------------------------------------------------
diff --git a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/OrGroupMatcher.java b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/OrGroupMatcher.java
index 65122c7..631086e 100644
--- a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/OrGroupMatcher.java
+++ b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/OrGroupMatcher.java
@@ -45,6 +45,7 @@ public class OrGroupMatcher
}
}
+ @Override
public boolean enabled( Class<?>... cats )
{
for ( GroupMatcher matcher : getMatchers() )
@@ -59,6 +60,7 @@ public class OrGroupMatcher
return false;
}
+ @Override
public boolean enabled( String... cats )
{
for ( GroupMatcher matcher : getMatchers() )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/SingleGroupMatcher.java
----------------------------------------------------------------------
diff --git a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/SingleGroupMatcher.java b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/SingleGroupMatcher.java
index 99dde99..72fc801 100644
--- a/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/SingleGroupMatcher.java
+++ b/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/SingleGroupMatcher.java
@@ -83,6 +83,7 @@ public class SingleGroupMatcher
return "*" + enabled;
}
+ @Override
public boolean enabled( Class<?>... cats )
{
if ( cats != null )
@@ -105,6 +106,7 @@ public class SingleGroupMatcher
return false;
}
+ @Override
public boolean enabled( String... cats )
{
for ( String cat : cats )
@@ -128,6 +130,7 @@ public class SingleGroupMatcher
return false;
}
+ @Override
public void loadGroupClasses( ClassLoader classLoader )
{
try
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeTestNGIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeTestNGIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeTestNGIT.java
index 05ba2f9..5ba0577 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeTestNGIT.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/ForkModeTestNGIT.java
@@ -27,6 +27,7 @@ package org.apache.maven.surefire.its;
public class ForkModeTestNGIT
extends ForkModeIT
{
+ @Override
protected String getProject()
{
return "fork-mode-testng";
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/FailsafeOutputValidator.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/FailsafeOutputValidator.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/FailsafeOutputValidator.java
index fcfcc9f..b96cf9b 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/FailsafeOutputValidator.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/FailsafeOutputValidator.java
@@ -29,6 +29,7 @@ public class FailsafeOutputValidator
super( source.verifier );
}
+ @Override
public OutputValidator verifyErrorFree( int total )
{
try
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/OutputValidator.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/OutputValidator.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/OutputValidator.java
index afd6493..a76f86f 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/OutputValidator.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/OutputValidator.java
@@ -191,7 +191,7 @@ public class OutputValidator
public TestFile getSurefireReportsXmlFile( String fileName )
{
File targetDir = getSurefireReportsDirectory();
- return new TestFile( new File( targetDir, fileName ), Charset.forName("UTF-8"), this );
+ return new TestFile( new File( targetDir, fileName ), Charset.forName( "UTF-8" ), this );
}
public File getSurefireReportsDirectory()
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1082ParallelJUnitParameterizedIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1082ParallelJUnitParameterizedIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1082ParallelJUnitParameterizedIT.java
index c50d4e4..a39f870 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1082ParallelJUnitParameterizedIT.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1082ParallelJUnitParameterizedIT.java
@@ -105,6 +105,7 @@ public class Surefire1082ParallelJUnitParameterizedIT
this.expectedRegex = expectedRegex;
}
+ @Override
public boolean matches( Object o )
{
if ( o != null && o instanceof Set )
@@ -127,6 +128,7 @@ public class Surefire1082ParallelJUnitParameterizedIT
}
}
+ @Override
public void describeTo( Description description )
{
description.appendValue( expectedRegex );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/ConsoleLoggerDecorator.java
----------------------------------------------------------------------
diff --git a/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/ConsoleLoggerDecorator.java b/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/ConsoleLoggerDecorator.java
index e565353..0e20105 100644
--- a/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/ConsoleLoggerDecorator.java
+++ b/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/ConsoleLoggerDecorator.java
@@ -1 +1 @@
-package org.apache.maven.plugin.surefire.log.api;
/*
* 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.
*/
/**
* Decorator around {@link ConsoleLogger}.
* This class is loaded in the isolated ClassLoader and the child logger in the in-plugi
n ClassLoader.
*
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.20
*/
public final class ConsoleLoggerDecorator
implements ConsoleLogger
{
private final Object logger;
public ConsoleLoggerDecorator( Object logger )
{
if ( logger == null )
{
throw new NullPointerException( "logger argument is null in " + ConsoleLoggerDecorator.class );
}
this.logger = logger;
}
public void debug( String message )
{
try
{
logger.getClass()
.getMethod( "debug", String.class )
.invoke( logger, message );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
public void info( String message )
{
try
{
logger.getClass()
.getMethod( "info", String.class )
.in
voke( logger, message );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
public void warning( String message )
{
try
{
logger.getClass()
.getMethod( "warning", String.class )
.invoke( logger, message );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
public void error( String message )
{
try
{
logger.getClass()
.getMethod( "error", String.class )
.invoke( logger, message );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
public void error( String message, Throwable t )
{
try
{
logger.getClass()
.getMet
hod( "error", String.class, Throwable.class )
.invoke( logger, message, t );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
public void error( Throwable t )
{
try
{
logger.getClass()
.getMethod( "error", Throwable.class )
.invoke( logger, t );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
}
\ No newline at end of file
+package org.apache.maven.plugin.surefire.log.api;
/*
* 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.
*/
/**
* Decorator around {@link ConsoleLogger}.
* This class is loaded in the isolated ClassLoader and the child logger in the in-plugi
n ClassLoader.
*
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.20
*/
public final class ConsoleLoggerDecorator
implements ConsoleLogger
{
private final Object logger;
public ConsoleLoggerDecorator( Object logger )
{
if ( logger == null )
{
throw new NullPointerException( "logger argument is null in " + ConsoleLoggerDecorator.class );
}
this.logger = logger;
}
@Override
public void debug( String message )
{
try
{
logger.getClass()
.getMethod( "debug", String.class )
.invoke( logger, message );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
@Override
public void info( String message )
{
try
{
logger.getClass()
.getMethod( "info", String.cla
ss )
.invoke( logger, message );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
@Override
public void warning( String message )
{
try
{
logger.getClass()
.getMethod( "warning", String.class )
.invoke( logger, message );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
@Override
public void error( String message )
{
try
{
logger.getClass()
.getMethod( "error", String.class )
.invoke( logger, message );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
@Override
public void error( String message, Throwable t )
{
t
ry
{
logger.getClass()
.getMethod( "error", String.class, Throwable.class )
.invoke( logger, message, t );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
@Override
public void error( Throwable t )
{
try
{
logger.getClass()
.getMethod( "error", Throwable.class )
.invoke( logger, t );
}
catch ( Exception e )
{
throw new IllegalStateException( e.getLocalizedMessage(), e );
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/NullConsoleLogger.java
----------------------------------------------------------------------
diff --git a/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/NullConsoleLogger.java b/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/NullConsoleLogger.java
index fa09d83..4094fe4 100644
--- a/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/NullConsoleLogger.java
+++ b/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/NullConsoleLogger.java
@@ -27,26 +27,32 @@ package org.apache.maven.plugin.surefire.log.api;
*/
public final class NullConsoleLogger implements ConsoleLogger
{
+ @Override
public void debug( String message )
{
}
+ @Override
public void info( String message )
{
}
+ @Override
public void warning( String message )
{
}
+ @Override
public void error( String message )
{
}
+ @Override
public void error( String message, Throwable t )
{
}
+ @Override
public void error( Throwable t )
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/PrintStreamLogger.java
----------------------------------------------------------------------
diff --git a/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/PrintStreamLogger.java b/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/PrintStreamLogger.java
index 0eac176..6b0d4ea 100644
--- a/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/PrintStreamLogger.java
+++ b/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/api/PrintStreamLogger.java
@@ -1 +1 @@
-package org.apache.maven.plugin.surefire.log.api;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.io.PrintStream;
/**
* For testing purposes.
*/
public class PrintStreamLogger
implements ConsoleLogger
{
private
final PrintStream stream;
public PrintStreamLogger( PrintStream stream )
{
this.stream = stream;
}
public void debug( String message )
{
stream.println( message );
}
public void info( String message )
{
stream.println( message );
}
public void warning( String message )
{
stream.println( message );
}
public void error( String message )
{
stream.println( message );
}
public void error( String message, Throwable t )
{
error( ConsoleLoggerUtils.toString( message, t ) );
}
public void error( Throwable t )
{
error( null, t );
}
}
\ No newline at end of file
+package org.apache.maven.plugin.surefire.log.api;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.io.PrintStream;
/**
* For testing purposes.
*/
public class PrintStreamLogger
implements ConsoleLogger
{
private
final PrintStream stream;
public PrintStreamLogger( PrintStream stream )
{
this.stream = stream;
}
@Override
public void debug( String message )
{
stream.println( message );
}
@Override
public void info( String message )
{
stream.println( message );
}
@Override
public void warning( String message )
{
stream.println( message );
}
@Override
public void error( String message )
{
stream.println( message );
}
@Override
public void error( String message, Throwable t )
{
error( ConsoleLoggerUtils.toString( message, t ) );
}
@Override
public void error( Throwable t )
{
error( null, t );
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/ClassNameStackTraceFilter.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/ClassNameStackTraceFilter.java b/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/ClassNameStackTraceFilter.java
index 6767430..bfc5b77 100644
--- a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/ClassNameStackTraceFilter.java
+++ b/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/ClassNameStackTraceFilter.java
@@ -32,6 +32,7 @@ final class ClassNameStackTraceFilter
this.className = className;
}
+ @Override
public boolean matches( StackTraceElement element )
{
return className.equals( element.getClassName() );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/NullStackTraceFilter.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/NullStackTraceFilter.java b/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/NullStackTraceFilter.java
index cced1d4..3172320 100644
--- a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/NullStackTraceFilter.java
+++ b/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/NullStackTraceFilter.java
@@ -25,6 +25,7 @@ package org.apache.maven.surefire.report;
final class NullStackTraceFilter
implements StackTraceFilter
{
+ @Override
public boolean matches( StackTraceElement element )
{
return true;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java b/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java
index fdbc1be..99aca60 100644
--- a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java
+++ b/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java
@@ -46,6 +46,7 @@ public class PojoStackTraceWriter
this.t = t;
}
+ @Override
public String writeTraceToString()
{
if ( t != null )
@@ -76,16 +77,19 @@ public class PojoStackTraceWriter
return "";
}
+ @Override
public String smartTrimmedStackTrace()
{
return t == null ? "" : new SmartStackTraceParser( testClass, t, testMethod ).getString();
}
+ @Override
public String writeTrimmedTraceToString()
{
return t == null ? "" : SmartStackTraceParser.stackTraceWithFocusOnClassAsString( t, testClass );
}
+ @Override
public SafeThrowable getThrowable()
{
return t == null ? null : new SafeThrowable( t );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass1.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass1.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass1.java
index 8414903..ef007b2 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass1.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass1.java
@@ -27,6 +27,7 @@ import java.util.concurrent.FutureTask;
class RunnableTestClass1
implements Callable<Object>
{
+ @Override
public Object call()
throws Exception
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass2.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass2.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass2.java
index 8a13b0e..b782df8 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass2.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass2.java
@@ -25,6 +25,7 @@ class RunnableTestClass2
{
+ @Override
public Object call()
throws Exception
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3/JUnit3TestChecker.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3/JUnit3TestChecker.java b/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3/JUnit3TestChecker.java
index f683714..d727946 100644
--- a/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3/JUnit3TestChecker.java
+++ b/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3/JUnit3TestChecker.java
@@ -49,6 +49,7 @@ public class JUnit3TestChecker
junitClass = ReflectionUtils.tryLoadClass( testClassLoader, "junit.framework.Test" );
}
+ @Override
public boolean accept( Class testClass )
{
return nonAbstractClassFilter.accept( testClass ) && isValidJUnit3Test( testClass );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefire/common/junit3/JUnit3TestCheckerTest.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefire/common/junit3/JUnit3TestCheckerTest.java b/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefire/common/junit3/JUnit3TestCheckerTest.java
index 7d4b751..e0ae2e7 100644
--- a/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefire/common/junit3/JUnit3TestCheckerTest.java
+++ b/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefire/common/junit3/JUnit3TestCheckerTest.java
@@ -106,11 +106,13 @@ public class JUnit3TestCheckerTest
public static class MySuite2
implements junit.framework.Test
{
+ @Override
public int countTestCases()
{
return 0;
}
+ @Override
public void run( TestResult testResult )
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4Reflector.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4Reflector.java b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4Reflector.java
index 026e35d..2d651c4 100644
--- a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4Reflector.java
+++ b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4Reflector.java
@@ -124,11 +124,13 @@ public final class JUnit4Reflector
this( "" );
}
+ @Override
public String value()
{
return value;
}
+ @Override
public Class<? extends Annotation> annotationType()
{
return Ignore.class;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListener.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListener.java b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListener.java
index 1d365cf..06f0fca 100644
--- a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListener.java
+++ b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListener.java
@@ -68,6 +68,7 @@ public class JUnit4RunListener
*
* @see org.junit.runner.notification.RunListener#testIgnored(org.junit.runner.Description)
*/
+ @Override
public void testIgnored( Description description )
throws Exception
{
@@ -80,6 +81,7 @@ public class JUnit4RunListener
*
* @see org.junit.runner.notification.RunListener#testStarted(org.junit.runner.Description)
*/
+ @Override
public void testStarted( Description description )
throws Exception
{
@@ -92,6 +94,7 @@ public class JUnit4RunListener
*
* @see org.junit.runner.notification.RunListener#testFailure(org.junit.runner.notification.Failure)
*/
+ @Override
@SuppressWarnings( { "ThrowableResultOfMethodCallIgnored" } )
public void testFailure( Failure failure )
throws Exception
@@ -131,6 +134,7 @@ public class JUnit4RunListener
*
* @see org.junit.runner.notification.RunListener#testFinished(org.junit.runner.Description)
*/
+ @Override
public void testFinished( Description description )
throws Exception
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4StackTraceWriter.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4StackTraceWriter.java b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4StackTraceWriter.java
index 33f499e..78cefb6 100644
--- a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4StackTraceWriter.java
+++ b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4StackTraceWriter.java
@@ -55,6 +55,7 @@ public class JUnit4StackTraceWriter
*
* @see org.apache.maven.surefire.report.StackTraceWriter#writeTraceToString()
*/
+ @Override
public String writeTraceToString()
{
Throwable t = junitFailure.getException();
@@ -87,6 +88,7 @@ public class JUnit4StackTraceWriter
return extractMethodName( junitFailure.getDescription().getDisplayName() );
}
+ @Override
@SuppressWarnings( "ThrowableResultOfMethodCallIgnored" )
public String smartTrimmedStackTrace()
{
@@ -101,6 +103,7 @@ public class JUnit4StackTraceWriter
*
* @see org.apache.maven.surefire.report.StackTraceWriter#writeTrimmedTraceToString()
*/
+ @Override
public String writeTrimmedTraceToString()
{
String testClass = getTestClassName();
@@ -120,6 +123,7 @@ public class JUnit4StackTraceWriter
*
* @see org.apache.maven.surefire.report.StackTraceWriter#getThrowable()
*/
+ @Override
public SafeThrowable getThrowable()
{
return new SafeThrowable( junitFailure.getException() );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4TestChecker.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4TestChecker.java b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4TestChecker.java
index c2a6c18..49afaa7 100644
--- a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4TestChecker.java
+++ b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4TestChecker.java
@@ -47,6 +47,7 @@ public class JUnit4TestChecker
nonAbstractClassFilter = new NonAbstractClassFilter();
}
+ @Override
public boolean accept( Class testClass )
{
return jUnit3TestChecker.accept( testClass ) || isValidJUnit4Test( testClass );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/junit4/MockReporter.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/junit4/MockReporter.java b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/junit4/MockReporter.java
index 99d7aae..12cbb4c 100644
--- a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/junit4/MockReporter.java
+++ b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/junit4/MockReporter.java
@@ -55,21 +55,25 @@ public class MockReporter
{
}
+ @Override
public void testSetStarting( ReportEntry report )
{
events.add( SET_STARTED );
}
+ @Override
public void testSetCompleted( ReportEntry report )
{
events.add( SET_COMPLETED );
}
+ @Override
public void testStarting( ReportEntry report )
{
events.add( TEST_STARTED );
}
+ @Override
public void testSucceeded( ReportEntry report )
{
events.add( TEST_COMPLETED );
@@ -77,12 +81,14 @@ public class MockReporter
}
+ @Override
public void testSkipped( ReportEntry report )
{
events.add( TEST_SKIPPED );
testIgnored.incrementAndGet();
}
+ @Override
public void testExecutionSkippedByUser()
{
}
@@ -102,16 +108,19 @@ public class MockReporter
return testFailed.get();
}
+ @Override
public void testError( ReportEntry report )
{
testError.incrementAndGet();
}
+ @Override
public void testFailed( ReportEntry report )
{
testFailed.incrementAndGet();
}
+ @Override
public void testAssumptionFailure( ReportEntry report )
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerTest.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerTest.java b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerTest.java
index deda538..baf4589 100644
--- a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerTest.java
+++ b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerTest.java
@@ -63,6 +63,7 @@ public class JUnit4RunListenerTest
DaemonThreadFactory.newDaemonThread( new Runnable()
{
+ @Override
public void run()
{
try
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4TestCheckerTest.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4TestCheckerTest.java b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4TestCheckerTest.java
index a9f1b80..a204734 100644
--- a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4TestCheckerTest.java
+++ b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4TestCheckerTest.java
@@ -148,11 +148,13 @@ public class JUnit4TestCheckerTest
public static class MySuite2
implements junit.framework.Test
{
+ @Override
public int countTestCases()
{
return 0;
}
+ @Override
public void run( TestResult testResult )
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/JUnit46StackTraceWriter.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/JUnit46StackTraceWriter.java b/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/JUnit46StackTraceWriter.java
index c7f2bd7..a07caaa 100644
--- a/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/JUnit46StackTraceWriter.java
+++ b/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/JUnit46StackTraceWriter.java
@@ -46,11 +46,13 @@ public class JUnit46StackTraceWriter
}
+ @Override
protected final String getTestClassName()
{
return junitFailure.getDescription().getClassName();
}
+ @Override
protected String getTestMethodName()
{
return junitFailure.getDescription().getMethodName();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/JUnit48TestChecker.java
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/JUnit48TestChecker.java b/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/JUnit48TestChecker.java
index 9da8715..ab475cc 100644
--- a/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/JUnit48TestChecker.java
+++ b/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/JUnit48TestChecker.java
@@ -45,6 +45,7 @@ public class JUnit48TestChecker
this.nonAbstractClassFilter = new NonAbstractClassFilter();
}
+ @Override
public boolean accept( Class testClass )
{
return jUnit4TestChecker.accept( testClass ) || isAbstractWithEnclosedRunner( testClass );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
index a707fee..adfda35 100644
--- a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
+++ b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
@@ -69,6 +69,7 @@ public class JUnit3Provider
testChecker = new PojoAndJUnit3Checker( jUnit3TestChecker ); // Todo; use reflector
}
+ @Override
public RunResult invoke( Object forkTestSet )
throws TestSetFailedException
{
@@ -143,6 +144,7 @@ public class JUnit3Provider
return runOrderCalculator.orderTestClasses( testsToRun );
}
+ @Override
public Iterable<Class<?>> getSuites()
{
testsToRun = scanClassPath();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnitTestSet.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnitTestSet.java b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnitTestSet.java
index 919be7a..4dd1bbc 100644
--- a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnitTestSet.java
+++ b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnitTestSet.java
@@ -64,6 +64,7 @@ public final class JUnitTestSet
}
+ @Override
public void execute( RunListener reporter, ClassLoader loader )
throws TestSetFailedException
{
@@ -120,6 +121,7 @@ public final class JUnitTestSet
}
}
+ @Override
public String getName()
{
return testClass.getName();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoAndJUnit3Checker.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoAndJUnit3Checker.java b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoAndJUnit3Checker.java
index d3529c1..e9debce 100644
--- a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoAndJUnit3Checker.java
+++ b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoAndJUnit3Checker.java
@@ -38,6 +38,7 @@ public class PojoAndJUnit3Checker
this.jUnit3TestChecker = jUnit3TestChecker;
}
+ @Override
public boolean accept( Class testClass )
{
return jUnit3TestChecker.accept( testClass )
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoTestSet.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoTestSet.java b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoTestSet.java
index d0f15cb..4d589a6 100644
--- a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoTestSet.java
+++ b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/PojoTestSet.java
@@ -75,6 +75,7 @@ public class PojoTestSet
}
}
+ @Override
public void execute( RunListener reportManager, ClassLoader loader )
throws TestSetFailedException
{
@@ -289,6 +290,7 @@ public class PojoTestSet
return isInstanceMethod && returnsVoid && hasNoParams;
}
+ @Override
public String getName()
{
return testClass.getName();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/TestListenerInvocationHandler.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/TestListenerInvocationHandler.java b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/TestListenerInvocationHandler.java
index c4c0f51..c96b96d 100644
--- a/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/TestListenerInvocationHandler.java
+++ b/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/TestListenerInvocationHandler.java
@@ -76,6 +76,7 @@ public class TestListenerInvocationHandler
this.threadOnWhichTestFailed = threadOnWhichTestFailed;
}
+ @Override
public boolean equals( Object obj )
{
boolean retVal = true;
@@ -101,6 +102,7 @@ public class TestListenerInvocationHandler
return retVal;
}
+ @Override
public int hashCode()
{
return threadOnWhichTestFailed.hashCode();
@@ -117,6 +119,7 @@ public class TestListenerInvocationHandler
this.reporter = reporter;
}
+ @Override
public Object invoke( Object proxy, Method method, Object[] args )
throws Throwable
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java b/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
index 9ca397e..359a79f 100644
--- a/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
+++ b/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
@@ -63,43 +63,52 @@ public class JUnitTestSetTest
private List<ReportEntry> succeededTests = new ArrayList<ReportEntry>();
+ @Override
public void testSetStarting( ReportEntry report )
{
}
+ @Override
public void testSetCompleted( ReportEntry report )
{
}
+ @Override
public void testStarting( ReportEntry report )
{
}
+ @Override
public void testSucceeded( ReportEntry report )
{
this.succeededTests.add( report );
}
+ @Override
public void testAssumptionFailure( ReportEntry report )
{
throw new IllegalStateException();
}
+ @Override
public void testError( ReportEntry report )
{
throw new IllegalStateException();
}
+ @Override
public void testFailed( ReportEntry report )
{
throw new IllegalStateException();
}
+ @Override
public void testSkipped( ReportEntry report )
{
throw new IllegalStateException();
}
+ @Override
public void testExecutionSkippedByUser()
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java b/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
index f835cec..12842fa 100644
--- a/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
+++ b/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
@@ -112,6 +112,7 @@ public class JUnit4Provider
rerunFailingTestsCount = testRequest.getRerunFailingTestsCount();
}
+ @Override
public RunResult invoke( Object forkTestSet )
throws TestSetFailedException
{
@@ -209,6 +210,7 @@ public class JUnit4Provider
{
commandsReader.addShutdownListener( new CommandListener()
{
+ @Override
public void update( Command command )
{
testsToRun.markTestSetFinished();
@@ -220,6 +222,7 @@ public class JUnit4Provider
{
commandsReader.addSkipNextTestsListener( new CommandListener()
{
+ @Override
public void update( Command command )
{
notifier.pleaseStop();
@@ -298,6 +301,7 @@ public class JUnit4Provider
}
}
+ @Override
public Iterable<Class<?>> getSuites()
{
testsToRun = scanClassPath();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/AsynchronousRunner.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/AsynchronousRunner.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/AsynchronousRunner.java
index 8faa12e..0d9bacf 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/AsynchronousRunner.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/AsynchronousRunner.java
@@ -48,12 +48,14 @@ public class AsynchronousRunner
this.fService = fService;
}
+ @Override
public void schedule( final Runnable childStatement )
{
futures.add( fService.submit( Executors.callable( childStatement ) ) );
}
+ @Override
public void finished()
{
try
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConcurrentRunListener.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConcurrentRunListener.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConcurrentRunListener.java
index 89c6104..8095dbf 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConcurrentRunListener.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConcurrentRunListener.java
@@ -69,10 +69,12 @@ public abstract class ConcurrentRunListener
};
}
+ @Override
public void testSetStarting( ReportEntry description )
{
}
+ @Override
public void testSetCompleted( ReportEntry result )
{
final RunListener reporterManager = getRunListener();
@@ -83,6 +85,7 @@ public abstract class ConcurrentRunListener
reporterManagerThreadLocal.remove();
}
+ @Override
public void testFailed( ReportEntry failure )
{
final TestMethod testMethod = getOrCreateThreadAttachedTestMethod( failure );
@@ -93,6 +96,7 @@ public abstract class ConcurrentRunListener
}
}
+ @Override
public void testError( ReportEntry failure )
{
final TestMethod testMethod = getOrCreateThreadAttachedTestMethod( failure );
@@ -103,6 +107,7 @@ public abstract class ConcurrentRunListener
}
}
+ @Override
public void testSkipped( ReportEntry description )
{
TestSet testSet = getTestSet( description );
@@ -112,12 +117,14 @@ public abstract class ConcurrentRunListener
testMethod.detachFromCurrentThread();
}
+ @Override
public void testExecutionSkippedByUser()
{
// cannot guarantee proper call to all listeners
reporterManagerThreadLocal.get().testExecutionSkippedByUser();
}
+ @Override
public void testAssumptionFailure( ReportEntry failure )
{
final TestMethod testMethod = getOrCreateThreadAttachedTestMethod( failure );
@@ -128,6 +135,7 @@ public abstract class ConcurrentRunListener
}
}
+ @Override
public void testStarting( ReportEntry description )
{
TestSet testSet = getTestSet( description );
@@ -137,6 +145,7 @@ public abstract class ConcurrentRunListener
testSet.attachToThread();
}
+ @Override
public void testSucceeded( ReportEntry report )
{
TestMethod testMethod = getThreadTestMethod();
@@ -196,6 +205,7 @@ public abstract class ConcurrentRunListener
}
+ @Override
public void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
{
TestMethod threadTestMethod = getThreadTestMethod();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
index 0f41b6f..a4c061e 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
@@ -103,6 +103,7 @@ public class JUnitCoreProvider
jUnit48Reflector = new JUnit48Reflector( testClassLoader );
}
+ @Override
public Iterable<Class<?>> getSuites()
{
testsToRun = scanClassPath();
@@ -114,6 +115,7 @@ public class JUnitCoreProvider
return jUnitCoreParameters.isNoThreading();
}
+ @Override
public RunResult invoke( Object forkTestSet )
throws TestSetFailedException
{
@@ -219,6 +221,7 @@ public class JUnitCoreProvider
{
commandsReader.addShutdownListener( new CommandListener()
{
+ @Override
public void update( Command command )
{
testsToRun.markTestSetFinished();
@@ -230,6 +233,7 @@ public class JUnitCoreProvider
{
commandsReader.addSkipNextTestsListener( new CommandListener()
{
+ @Override
public void update( Command command )
{
stoppable.pleaseStop();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreRunListener.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreRunListener.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreRunListener.java
index 81e4f80..98b87ef 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreRunListener.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreRunListener.java
@@ -59,6 +59,7 @@ public class JUnitCoreRunListener
*
* @see org.junit.runner.notification.RunListener#testRunStarted(org.junit.runner.Description)
*/
+ @Override
public void testRunStarted( Description description )
throws Exception
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/NonConcurrentRunListener.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/NonConcurrentRunListener.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/NonConcurrentRunListener.java
index 539fd73..0e5ee77 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/NonConcurrentRunListener.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/NonConcurrentRunListener.java
@@ -47,12 +47,14 @@ public class NonConcurrentRunListener
super( reporter );
}
+ @Override
public synchronized void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
{
// We can write immediately: no parallelism and a single class.
( (ConsoleOutputReceiver) reporter ).writeTestOutput( buf, off, len, stdout );
}
+ @Override
protected SimpleReportEntry createReportEntry( Description description )
{
return new SimpleReportEntry( extractDescriptionClassName( description ), description.getDisplayName() );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/SynchronousRunner.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/SynchronousRunner.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/SynchronousRunner.java
index efbca98..ebcbe8d 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/SynchronousRunner.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/SynchronousRunner.java
@@ -31,11 +31,13 @@ import org.junit.runners.model.RunnerScheduler;
class SynchronousRunner
implements RunnerScheduler
{
+ @Override
public void schedule( final Runnable childStatement )
{
childStatement.run();
}
+ @Override
public void finished()
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/TestMethod.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/TestMethod.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/TestMethod.java
index eb388c6..ef70027 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/TestMethod.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/TestMethod.java
@@ -172,6 +172,7 @@ class TestMethod
return ls;
}
+ @Override
public void writeTestOutput( byte[] buf, int off, int len, boolean stdout )
{
getLogicalStream().write( stdout, buf, off, len );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/AbstractThreadPoolStrategy.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/AbstractThreadPoolStrategy.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/AbstractThreadPoolStrategy.java
index 5eb7715..a308952 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/AbstractThreadPoolStrategy.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/AbstractThreadPoolStrategy.java
@@ -126,6 +126,7 @@ abstract class AbstractThreadPoolStrategy
}
}
+ @Override
public boolean destroy()
{
try
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/InvokerStrategy.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/InvokerStrategy.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/InvokerStrategy.java
index cc1a040..0001b08 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/InvokerStrategy.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/InvokerStrategy.java
@@ -91,6 +91,7 @@ final class InvokerStrategy
return disable();
}
+ @Override
public boolean destroy()
{
return stop();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/NullBalancer.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/NullBalancer.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/NullBalancer.java
index 56b9522..a80e8c5 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/NullBalancer.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/NullBalancer.java
@@ -29,15 +29,18 @@ package org.apache.maven.surefire.junitcore.pc;
final class NullBalancer
implements Balancer
{
+ @Override
public boolean acquirePermit()
{
return true;
}
+ @Override
public void releasePermit()
{
}
+ @Override
public void releaseAllPermits()
{
}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ParallelComputer.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ParallelComputer.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ParallelComputer.java
index afec8a3..a198887 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ParallelComputer.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/ParallelComputer.java
@@ -182,6 +182,7 @@ public abstract class ParallelComputer
{
return new Callable<ShutdownResult>()
{
+ @Override
public ShutdownResult call()
throws Exception
{
@@ -195,6 +196,7 @@ public abstract class ParallelComputer
{
return new Callable<ShutdownResult>()
{
+ @Override
public ShutdownResult call()
throws Exception
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/11511f4a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/Scheduler.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/Scheduler.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/Scheduler.java
index 2c87fdd..3c21409 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/Scheduler.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/Scheduler.java
@@ -335,6 +335,7 @@ public class Scheduler
{
}
+ @Override
public void schedule( Runnable childStatement )
{
if ( childStatement == null )
@@ -365,6 +366,7 @@ public class Scheduler
}
}
+ @Override
public void finished()
{
try
@@ -385,6 +387,7 @@ public class Scheduler
{
return new Runnable()
{
+ @Override
public void run()
{
try
@@ -482,6 +485,7 @@ public class Scheduler
this.poolHandler = poolHandler;
}
+ @Override
public void rejectedExecution( Runnable r, ThreadPoolExecutor executor )
{
if ( executor.isShutdown() )