http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/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 5354685..d2cc117 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 @@ -89,19 +89,20 @@ public class JUnit4Provider { if ( testsToRun == null ) { - if (forkTestSet instanceof TestsToRun) + if ( forkTestSet instanceof TestsToRun ) { testsToRun = (TestsToRun) forkTestSet; } - else if (forkTestSet instanceof Class) + else if ( forkTestSet instanceof Class ) { testsToRun = TestsToRun.fromClass( (Class) forkTestSet ); - } else + } + else { testsToRun = scanClassPath(); } } - + upgradeCheck(); final ReporterFactory reporterFactory = providerParameters.getReporterFactory();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/surefire-providers/surefire-junit47/pom.xml ---------------------------------------------------------------------- diff --git a/surefire-providers/surefire-junit47/pom.xml b/surefire-providers/surefire-junit47/pom.xml index c68adee..ddfb73d 100644 --- a/surefire-providers/surefire-junit47/pom.xml +++ b/surefire-providers/surefire-junit47/pom.xml @@ -17,7 +17,8 @@ ~ under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConcurrentReporterManager.java ---------------------------------------------------------------------- diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConcurrentReporterManager.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConcurrentReporterManager.java index a15e6ff..fc1dde1 100644 --- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConcurrentReporterManager.java +++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConcurrentReporterManager.java @@ -75,10 +75,10 @@ public abstract class ConcurrentReporterManager public void testFailed( ReportEntry failure ) { - final TestMethod testMethod = getOrCreateTestMethod( failure ); - if (testMethod != null) + final TestMethod testMethod = getOrCreateTestMethod( failure ); + if ( testMethod != null ) { - testMethod.testFailure( failure ); + testMethod.testFailure( failure ); } } @@ -101,10 +101,10 @@ public abstract class ConcurrentReporterManager public void testAssumptionFailure( ReportEntry failure ) { - final TestMethod testMethod = getOrCreateTestMethod( failure ); - if (testMethod != null) + final TestMethod testMethod = getOrCreateTestMethod( failure ); + if ( testMethod != null ) { - testMethod.testIgnored( failure ); + testMethod.testIgnored( failure ); } } http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/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 b2608e8..81ea524 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 @@ -25,7 +25,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; - import org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory; import org.apache.maven.surefire.common.junit4.JUnit4TestChecker; import org.apache.maven.surefire.common.junit48.FilterFactory; @@ -52,7 +51,7 @@ import org.junit.runner.manipulation.Filter; /** * @author Kristian Rosenvold */ -@SuppressWarnings({ "UnusedDeclaration" }) +@SuppressWarnings( { "UnusedDeclaration" } ) public class JUnitCoreProvider extends AbstractProvider { http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/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 f5079a7..1abd7f7 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 @@ -17,6 +17,7 @@ package org.apache.maven.surefire.junitcore; * specific language governing permissions and limitations * under the License. */ + import org.junit.runners.model.RunnerScheduler; /** http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/surefire-providers/surefire-testng-utils/pom.xml ---------------------------------------------------------------------- diff --git a/surefire-providers/surefire-testng-utils/pom.xml b/surefire-providers/surefire-testng-utils/pom.xml index d874c00..344a5f8 100644 --- a/surefire-providers/surefire-testng-utils/pom.xml +++ b/surefire-providers/surefire-testng-utils/pom.xml @@ -17,7 +17,8 @@ ~ specific language governing permissions and limitations ~ under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> @@ -38,10 +39,10 @@ <version>3.8.2</version> <scope>provided</scope> </dependency> - <dependency> - <groupId>org.apache.maven.shared</groupId> - <artifactId>maven-shared-utils</artifactId> - </dependency> + <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-shared-utils</artifactId> + </dependency> <dependency> <groupId>org.apache.maven.surefire</groupId> <artifactId>surefire-grouper</artifactId> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/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 7823ab7..80baa97 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 @@ -17,6 +17,7 @@ package org.apache.maven.surefire.testng.utils; * specific language governing permissions and limitations * under the License. */ + import java.util.HashMap; import java.util.List; import java.util.Map; http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/surefire-providers/surefire-testng/pom.xml ---------------------------------------------------------------------- diff --git a/surefire-providers/surefire-testng/pom.xml b/surefire-providers/surefire-testng/pom.xml index 4a13b56..64e747c 100644 --- a/surefire-providers/surefire-testng/pom.xml +++ b/surefire-providers/surefire-testng/pom.xml @@ -17,7 +17,8 @@ ~ under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java ---------------------------------------------------------------------- diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java index 3e1ba0d..78b2e64 100644 --- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java +++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java @@ -57,9 +57,9 @@ public class TestNGDirectoryTestSuite private final ArtifactVersion version; private final Map options; - + private final Map junitOptions; - + private final String testSourceDirectory; private final File reportsDirectory; @@ -71,7 +71,7 @@ public class TestNGDirectoryTestSuite private final String testMethodPattern; private final RunOrderCalculator runOrderCalculator; - + private final Class junitTestClass; public TestNGDirectoryTestSuite( String testSourceDirectory, String artifactVersion, Properties confOptions, @@ -96,69 +96,74 @@ public class TestNGDirectoryTestSuite throws ReporterException, TestSetFailedException { - if ( testsToRun instanceof LazyTestsToRun ) - { - executeLazy( testsToRun, reporterManagerFactory ); - } else if ( testsToRun.size() > 1 ) - { - executeMulti( testsToRun, reporterManagerFactory ); - } else if ( testsToRun.size() == 1 ) - { - Class testClass = (Class) testsToRun.iterator().next(); + if ( testsToRun instanceof LazyTestsToRun ) + { + executeLazy( testsToRun, reporterManagerFactory ); + } + else if ( testsToRun.size() > 1 ) + { + executeMulti( testsToRun, reporterManagerFactory ); + } + else if ( testsToRun.size() == 1 ) + { + Class testClass = (Class) testsToRun.iterator().next(); executeSingleClass( reporterManagerFactory, testClass ); - } + } } - private void executeSingleClass( ReporterFactory reporterManagerFactory, Class testClass ) throws TestSetFailedException { - this.options.put( "suitename", testClass.getName() ); + private void executeSingleClass( ReporterFactory reporterManagerFactory, Class testClass ) + throws TestSetFailedException + { + this.options.put( "suitename", testClass.getName() ); - RunListener reporter = reporterManagerFactory.createReporter(); - ConsoleOutputCapture.startCapture( (ConsoleOutputReceiver) reporter ); + RunListener reporter = reporterManagerFactory.createReporter(); + ConsoleOutputCapture.startCapture( (ConsoleOutputReceiver) reporter ); - startTestSuite( reporter, this ); + startTestSuite( reporter, this ); - final Map optionsToUse = isJUnitTest(testClass) ? junitOptions : options; - - TestNGExecutor.run( new Class[]{ testClass }, testSourceDirectory, optionsToUse, - version, reporter, this, reportsDirectory, testMethodPattern ); + final Map optionsToUse = isJUnitTest( testClass ) ? junitOptions : options; - finishTestSuite( reporter, this ); - } + TestNGExecutor.run( new Class[]{ testClass }, testSourceDirectory, optionsToUse, version, reporter, this, + reportsDirectory, testMethodPattern ); + + finishTestSuite( reporter, this ); + } public void executeLazy( TestsToRun testsToRun, ReporterFactory reporterFactory ) - throws ReporterException, TestSetFailedException + throws ReporterException, TestSetFailedException { - + for ( Iterator testClassIt = testsToRun.iterator(); testClassIt.hasNext(); ) { Class c = (Class) testClassIt.next(); - executeSingleClass(reporterFactory, c); + executeSingleClass( reporterFactory, c ); } } - private Class findJUnitTestClass() { - Class junitTest; - try - { - junitTest = Class.forName( "junit.framework.Test" ); - } - catch ( ClassNotFoundException e ) - { - junitTest = null; - } - return junitTest; - } - + private Class findJUnitTestClass() + { + Class junitTest; + try + { + junitTest = Class.forName( "junit.framework.Test" ); + } + catch ( ClassNotFoundException e ) + { + junitTest = null; + } + return junitTest; + } + public void executeMulti( TestsToRun testsToRun, ReporterFactory reporterFactory ) throws ReporterException, TestSetFailedException { List testNgTestClasses = new ArrayList(); List junitTestClasses = new ArrayList(); Class[] allClasses = testsToRun.getLocatedClasses(); - for ( int i = 0; i < allClasses.length; i++) + for ( int i = 0; i < allClasses.length; i++ ) { Class c = allClasses[i]; - if ( isJUnitTest(c) ) + if ( isJUnitTest( c ) ) { junitTestClasses.add( c ); } @@ -190,22 +195,24 @@ public class TestNGDirectoryTestSuite { testClasses = (Class[]) junitTestClasses.toArray( new Class[junitTestClasses.size()] ); - TestNGExecutor.run( testClasses, testSourceDirectory, junitOptions, version, reporterManager, - this, junitReportsDirectory, testMethodPattern ); + TestNGExecutor.run( testClasses, testSourceDirectory, junitOptions, version, reporterManager, this, + junitReportsDirectory, testMethodPattern ); } finishTestSuite( reporterManager, this ); } - private boolean isJUnitTest(Class c) { - return junitTestClass != null && junitTestClass.isAssignableFrom( c ); - } + private boolean isJUnitTest( Class c ) + { + return junitTestClass != null && junitTestClass.isAssignableFrom( c ); + } - private Map createJUnitOptions() { - Map junitOptions = new HashMap(this.options); - junitOptions.put( "junit", Boolean.TRUE ); - return junitOptions; - } + private Map createJUnitOptions() + { + Map junitOptions = new HashMap( this.options ); + junitOptions.put( "junit", Boolean.TRUE ); + return junitOptions; + } // single class test public void execute( String testSetName, ReporterFactory reporterManagerFactory ) http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/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 f281b9e..a24e683 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 @@ -100,14 +100,15 @@ public class TestNGProvider { if ( testsToRun == null ) { - if (forkTestSet instanceof TestsToRun) + if ( forkTestSet instanceof TestsToRun ) { testsToRun = (TestsToRun) forkTestSet; } - else if (forkTestSet instanceof Class) + else if ( forkTestSet instanceof Class ) { testsToRun = TestsToRun.fromClass( (Class) forkTestSet ); - } else + } + else { testsToRun = scanClassPath(); } http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/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 3596ae8..69ad244 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 @@ -89,7 +89,7 @@ public class TestNGMapConfigurator { val = convert( val, Boolean.class ); } - else if ( "configfailurepolicy".equals( key ) ) + else if ( "configfailurepolicy".equals( key ) ) { val = convert( val, String.class ); } http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/conf/TestNGMapConfiguratorTest.java ---------------------------------------------------------------------- diff --git a/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/conf/TestNGMapConfiguratorTest.java b/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/conf/TestNGMapConfiguratorTest.java index dd5e07b..ac785a6 100755 --- a/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/conf/TestNGMapConfiguratorTest.java +++ b/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/conf/TestNGMapConfiguratorTest.java @@ -21,7 +21,6 @@ package org.apache.maven.surefire.testng.conf; import java.util.HashMap; import java.util.Map; - import org.apache.maven.surefire.testset.TestSetFailedException; import junit.framework.TestCase; http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/surefire-setup-integration-tests/pom.xml ---------------------------------------------------------------------- diff --git a/surefire-setup-integration-tests/pom.xml b/surefire-setup-integration-tests/pom.xml index 8b5789b..82dcee6 100644 --- a/surefire-setup-integration-tests/pom.xml +++ b/surefire-setup-integration-tests/pom.xml @@ -18,7 +18,8 @@ ~ under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> @@ -165,7 +166,7 @@ <version>${project.version}</version> </dependency> </dependencies> - </plugin> + </plugin> <plugin> <artifactId>maven-enforcer-plugin</artifactId> <executions> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a303827d/surefire-shadefire/pom.xml ---------------------------------------------------------------------- diff --git a/surefire-shadefire/pom.xml b/surefire-shadefire/pom.xml index 4482bbd..dcab557 100644 --- a/surefire-shadefire/pom.xml +++ b/surefire-shadefire/pom.xml @@ -17,7 +17,8 @@ ~ under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent>