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 2018/02/28 18:46:49 UTC

[2/2] maven-surefire git commit: [SUREFIRE-1491] LocationManager injected in MOJO unables plugin to run in JDK 1.6

[SUREFIRE-1491] LocationManager injected in MOJO unables plugin to run in JDK 1.6


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/6df27f80
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/6df27f80
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/6df27f80

Branch: refs/heads/SUREFIRE-1491
Commit: 6df27f804c6195b45e1bac4e8a8f67e31c99a430
Parents: 37b364d
Author: Tibor17 <ti...@apache.org>
Authored: Wed Feb 28 19:46:26 2018 +0100
Committer: Tibor17 <ti...@apache.org>
Committed: Wed Feb 28 19:46:26 2018 +0100

----------------------------------------------------------------------
 .../plugin/surefire/AbstractSurefireMojo.java   |  13 +-
 .../surefire/booterclient/ForkStarter.java      |   2 +-
 .../AbstractSurefireMojoJava7PlusTest.java      | 572 +++++++++++++++++++
 .../surefire/AbstractSurefireMojoTest.java      | 216 +------
 .../ModularClasspathForkConfigurationTest.java  |  10 +
 .../TestProvidingInputStreamTest.java           |   4 +-
 .../apache/maven/surefire/JUnit4SuiteTest.java  |  68 ++-
 pom.xml                                         |   4 +-
 surefire-its/pom.xml                            |   4 -
 .../maven/surefire/its/AbstractJigsawIT.java    |  16 +-
 .../surefire/its/fixture/SurefireLauncher.java  |   2 +-
 .../resources/environment-variables/pom.xml     |   4 +-
 .../src/test/resources/failingBuilds/pom.xml    |   4 +-
 .../src/test/resources/failsafe-notests/pom.xml |   4 +-
 .../resources/failure-result-counting/pom.xml   |   4 +-
 .../src/test/resources/failureOutput/pom.xml    |   4 +-
 .../test/resources/fork-consoleOutput/pom.xml   |   4 +-
 .../fork-consoleOutputWithErrors/pom.xml        |   4 +-
 .../src/test/resources/fork-fail/pom.xml        |   4 +-
 .../resources/fork-mode-multimodule/pom.xml     |   4 +-
 .../fork-mode-resource-loading/pom.xml          |   4 +-
 .../src/test/resources/fork-mode-testng/pom.xml |   4 +-
 .../src/test/resources/fork-mode/pom.xml        |   4 +-
 .../src/test/resources/fork-timeout/pom.xml     |   4 +-
 .../includes-excludes-from-file/pom.xml         |   4 +-
 .../test/resources/includes-excludes/pom.xml    |   4 +-
 .../test/resources/isolated-classloader/pom.xml |   4 +-
 .../resources/junit-fork-mode-always/pom.xml    |   4 +-
 .../src/test/resources/junit-ignore/pom.xml     |   4 +-
 .../src/test/resources/junit-innerClass/pom.xml |   4 +-
 .../junit-notExtendingTestCase/pom.xml          |   4 +-
 .../test/resources/junit-pathWithUmlaut/pom.xml |   4 +-
 .../resources/junit-twoTestCaseSuite/pom.xml    |   4 +-
 .../test/resources/junit-twoTestCases/pom.xml   |   4 +-
 .../junit4-forkAlways-staticInit/pom.xml        |   4 +-
 .../junit4-rerun-failing-tests/pom.xml          |   4 +-
 .../test/resources/junit4-runlistener/pom.xml   |   4 +-
 .../resources/junit4-twoTestCaseSuite/pom.xml   |   4 +-
 surefire-its/src/test/resources/junit4/pom.xml  |   4 +-
 .../src/test/resources/junit44-dep/pom.xml      |   4 +-
 .../test/resources/junit44-environment/pom.xml  |   4 +-
 .../src/test/resources/junit44-hamcrest/pom.xml |   4 +-
 .../resources/junit44-method-pattern/pom.xml    |   4 +-
 .../resources/junit44-single-method/pom.xml     |   4 +-
 .../junit47-parallel-with-suite/pom.xml         |   4 +-
 .../resources/junit47-redirect-output/pom.xml   |   4 +-
 .../junit47-static-inner-class-tests/pom.xml    |   4 +-
 .../test/resources/junit48-categories/pom.xml   |   4 +-
 .../resources/junit48-smartStackTrace/pom.xml   |   4 +-
 .../src/test/resources/norunnableTests/pom.xml  |   4 +-
 .../src/test/resources/parallel-runtime/pom.xml |   4 +-
 .../resources/plain-old-java-classpath/pom.xml  |   4 +-
 .../src/test/resources/plexus-conflict/pom.xml  |   4 +-
 .../src/test/resources/pojo-simple/pom.xml      |   4 +-
 surefire-its/src/test/resources/pom.xml         |   4 +-
 .../src/test/resources/reporters/pom.xml        |   4 +-
 .../src/test/resources/result-counting/pom.xml  |   4 +-
 .../src/test/resources/runOrder/pom.xml         |   4 +-
 .../test/resources/runorder-parallel/pom.xml    |   4 +-
 .../sibling-aggregator/aggregator/pom.xml       |   4 +-
 .../resources/sibling-aggregator/child1/pom.xml |   4 +-
 .../resources/sibling-aggregator/child2/pom.xml |   4 +-
 .../resources/small-result-counting/pom.xml     |   4 +-
 .../jiras-surefire-1024-testjar/pom.xml         |   4 +-
 .../pom.xml                                     |   4 +-
 .../pom.xml                                     |   4 +-
 .../pom.xml                                     |   4 +-
 .../pom.xml                                     |   4 +-
 .../surefire-1202-rerun-and-failfast/pom.xml    |   4 +-
 .../surefire-1209-rerun-and-forkcount/pom.xml   |   4 +-
 .../surefire-1278-group-name-ending/pom.xml     |   4 +-
 .../pom.xml                                     |   4 +-
 .../pom.xml                                     |   4 +-
 .../pom.xml                                     |   4 +-
 .../surefire-141-pluggableproviders/pom.xml     |   4 +-
 .../surefire-146-forkPerTestNoSetup/pom.xml     |   4 +-
 .../surefire-162-charsetProvider/pom.xml        |   4 +-
 .../surefire-224-wellFormedXmlFailures/pom.xml  |   4 +-
 .../surefire-257-rerunningTests/pom.xml         |   4 +-
 .../surefire-260-testWithIdenticalNames/pom.xml |   4 +-
 .../surefire-34-securityManager-success/pom.xml |   4 +-
 .../surefire-34-securityManager/pom.xml         |   4 +-
 .../pom.xml                                     |   4 +-
 .../surefire-500-puzzling-error/pom.xml         |   4 +-
 .../surefire-510-testClassPath/pom.xml          |   4 +-
 .../pom.xml                                     |   4 +-
 .../surefire-613-testCount-in-parallel/pom.xml  |   4 +-
 .../pom.xml                                     |   4 +-
 .../pom.xml                                     |   4 +-
 .../pom.xml                                     |   4 +-
 .../test/resources/surefire-673-mockito/pom.xml |   4 +-
 .../surefire-674-buildFailingWhenErrors/pom.xml |   4 +-
 .../surefire-685-commaseparatedIncludes/pom.xml |   4 +-
 .../resources/surefire-697-niceSummary/pom.xml  |   4 +-
 .../surefire-733-allOverridesCaptured/pom.xml   |   4 +-
 .../pom.xml                                     |   4 +-
 .../pom.xml                                     |   4 +-
 .../surefire-806-specifiedTests-multi/pom.xml   |   4 +-
 .../surefire-806-specifiedTests-single/pom.xml  |   4 +-
 .../surefire-809-groupExpr-junit48/pom.xml      |   4 +-
 .../surefire-809-groupExpr-testng/pom.xml       |   4 +-
 .../surefire-812-log4j-classloader/pom.xml      |   4 +-
 .../surefire-818-ignored-tests-on-npe/pom.xml   |   4 +-
 .../surefire-828-emptyGroupExpr-junit48/pom.xml |   4 +-
 .../surefire-828-emptyGroupExpr-testng/pom.xml  |   4 +-
 .../surefire-832-provider-selection/pom.xml     |   4 +-
 .../resources/surefire-847-testngfail/pom.xml   |   4 +-
 .../surefire-930-failsafe-runtests/pom.xml      |   4 +-
 .../surefire-931-provider-failure/pom.xml       |   4 +-
 .../surefire-943-report-content/pom.xml         |   4 +-
 .../pom.xml                                     |   4 +-
 .../surefire-946-self-destruct-plugin/pom.xml   |   4 +-
 .../surefire-972-bizarre-noclassdef/pom.xml     |   4 +-
 .../surefire-975-wrong-encoding/pom.xml         |   4 +-
 .../module1/pom.xml                             |   4 +-
 .../module2/pom.xml                             |   4 +-
 .../pom.xml                                     |   4 +-
 .../test/resources/system-properties/pom.xml    |   4 +-
 .../test-helper-dump-pid-plugin/pom.xml         |   4 +-
 .../resources/testng-afterSuiteFailure/pom.xml  |   4 +-
 .../test/resources/testng-beforeMethod/pom.xml  |   4 +-
 .../testng-beforeMethodFailure/pom.xml          |   4 +-
 .../test/resources/testng-execute-error/pom.xml |   4 +-
 .../src/test/resources/testng-groups/pom.xml    |   4 +-
 .../src/test/resources/testng-jdk14/pom.xml     |   4 +-
 .../resources/testng-junit-together/pom.xml     |   4 +-
 .../resources/testng-listener-reporter/pom.xml  |   4 +-
 .../testng-method-pattern-after/pom.xml         |   4 +-
 .../testng-method-pattern-before/pom.xml        |   4 +-
 .../resources/testng-method-pattern/pom.xml     |   4 +-
 .../testng-parallel-with-annotations/pom.xml    |   4 +-
 .../resources/testng-path with spaces/pom.xml   |   4 +-
 .../src/test/resources/testng-simple/pom.xml    |   4 +-
 .../testng-single-method-5-14-9/pom.xml         |   4 +-
 .../test/resources/testng-single-method/pom.xml |   4 +-
 .../src/test/resources/testng-suite-xml/pom.xml |   4 +-
 .../resources/testng-twoTestCaseSuite/pom.xml   |   4 +-
 .../src/test/resources/timeout-forked/pom.xml   |   4 +-
 .../test/resources/unicode-testnames/pom.xml    |   4 +-
 .../pom.xml                                     |   4 +-
 .../resources/working-directory-missing/pom.xml |   4 +-
 .../test/resources/working-directory/pom.xml    |   4 +-
 142 files changed, 931 insertions(+), 504 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/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 dca5c56..38d18db 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
@@ -745,8 +745,9 @@ public abstract class AbstractSurefireMojo
     @Component
     private ToolchainManager toolchainManager;
 
-    @Component
-    private LocationManager locationManager;
+    // todo use in 3.0.0 with java 1.7 and substitute new LocationManager() with component in underneath code
+    // @Component
+    // private LocationManager locationManager;
 
     private Artifact surefireBooterArtifact;
 
@@ -1747,6 +1748,11 @@ public abstract class AbstractSurefireMojo
                 false );
     }
 
+    private Object getLocationManager()
+    {
+        return new LocationManager();
+    }
+
     private StartupConfiguration newStartupConfigForModularClasspath(
             @Nonnull ClassLoaderConfiguration classLoaderConfiguration, @Nonnull Classpath providerClasspath,
             @Nonnull String providerName, @Nonnull File moduleDescriptor, @Nonnull DefaultScanResult scanResult )
@@ -1756,7 +1762,7 @@ public abstract class AbstractSurefireMojo
         ResolvePathsRequest<String> req = ResolvePathsRequest.withStrings( generateTestClasspath().getClassPath() )
                 .setMainModuleDescriptor( moduleDescriptor.getAbsolutePath() );
 
-        ResolvePathsResult<String> result = locationManager.resolvePaths( req );
+        ResolvePathsResult<String> result = ( (LocationManager) getLocationManager() ).resolvePaths( req );
 
         Classpath testClasspath = new Classpath( result.getClasspathElements() );
         Classpath testModulepath = new Classpath( result.getModulepathElements().keySet() );
@@ -3061,6 +3067,7 @@ public abstract class AbstractSurefireMojo
             {
                 File tmp = File.createTempFile( getTempDir(), null );
                 //noinspection ResultOfMethodCallIgnored
+                tmp.delete();
                 return tmp.mkdirs() ? tmp : createSurefireBootDirectoryInBuild();
             }
             catch ( IOException e )

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/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 2f48def..8339349 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
@@ -619,7 +619,7 @@ public class ForkStarter
             {
                 runResult = timeout( forkClient.getDefaultReporterFactory().getGlobalRunStatistics().getRunResult() );
             }
-            else if ( result != SUCCESS )
+            else if ( result == null || result != SUCCESS )
             {
                 booterForkException =
                         new SurefireBooterForkException( "Error occurred in starting fork, check output in log" );

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java
new file mode 100644
index 0000000..e34d7d1
--- /dev/null
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java
@@ -0,0 +1,572 @@
+package org.apache.maven.plugin.surefire;
+
+/*
+ * 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.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.surefire.log.PluginConsoleLogger;
+import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
+import org.apache.maven.surefire.booter.Classpath;
+import org.apache.maven.surefire.booter.ModularClasspathConfiguration;
+import org.apache.maven.surefire.booter.StartupConfiguration;
+import org.apache.maven.surefire.suite.RunResult;
+import org.apache.maven.surefire.util.DefaultScanResult;
+import org.codehaus.plexus.languages.java.jpms.LocationManager;
+import org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest;
+import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult;
+import org.codehaus.plexus.logging.Logger;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import static java.io.File.separatorChar;
+import static java.util.Arrays.asList;
+import static java.util.Collections.singleton;
+import static org.apache.commons.lang3.JavaVersion.JAVA_1_7;
+import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
+import static org.apache.maven.surefire.booter.SystemUtils.isBuiltInJava7AtLeast;
+import static org.fest.assertions.Assertions.assertThat;
+import static org.junit.Assume.assumeTrue;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.powermock.api.mockito.PowerMockito.doReturn;
+import static org.powermock.api.mockito.PowerMockito.doNothing;
+import static org.powermock.api.mockito.PowerMockito.mock;
+import static org.powermock.api.mockito.PowerMockito.mockStatic;
+import static org.powermock.api.mockito.PowerMockito.spy;
+import static org.powermock.api.mockito.PowerMockito.verifyPrivate;
+import static org.powermock.api.mockito.PowerMockito.verifyStatic;
+import static org.powermock.reflect.Whitebox.invokeMethod;
+
+/**
+ * Test for {@link AbstractSurefireMojo}.
+ */
+@RunWith( PowerMockRunner.class )
+@PrepareForTest( { AbstractSurefireMojo.class, ResolvePathsRequest.class } )
+public class AbstractSurefireMojoJava7PlusTest
+{
+    @Mock
+    private LocationManager locationManager;
+
+    @BeforeClass
+    public static void withJava7Plus()
+    {
+        assumeTrue( JAVA_RECENT.atLeast( JAVA_1_7 ) );
+    }
+
+    @Test
+    public void shouldHaveStartupConfigForModularClasspath()
+            throws Exception
+    {
+        AbstractSurefireMojo mojo = spy( new Mojo() );
+        doReturn( locationManager )
+                .when( mojo, "getLocationManager" );
+
+        Classpath testClasspath = new Classpath( asList( "non-modular.jar", "modular.jar",
+                "target" + separatorChar + "classes", "junit.jar", "hamcrest.jar" ) );
+
+        doReturn( testClasspath ).when( mojo, "generateTestClasspath" );
+        doReturn( 1 ).when( mojo, "getEffectiveForkCount" );
+        doReturn( true ).when( mojo, "effectiveIsEnableAssertions" );
+        when( mojo.isChildDelegation() ).thenReturn( false );
+        when( mojo.getTestClassesDirectory() ).thenReturn( new File( "target" + separatorChar + "test-classes" ) );
+
+        DefaultScanResult scanResult = mock( DefaultScanResult.class );
+        when( scanResult.getClasses() ).thenReturn( asList( "org.apache.A", "org.apache.B" ) );
+
+        ClassLoaderConfiguration classLoaderConfiguration = new ClassLoaderConfiguration( false, true );
+
+        Classpath providerClasspath = new Classpath( singleton( "surefire-provider.jar" ) );
+
+        File moduleInfo = new File( "target" + separatorChar + "classes" + separatorChar + "module-info.class" );
+
+        @SuppressWarnings( "unchecked" )
+        ResolvePathsRequest<String> req = mock( ResolvePathsRequest.class );
+        mockStatic( ResolvePathsRequest.class );
+        when( ResolvePathsRequest.withStrings( eq( testClasspath.getClassPath() ) ) ).thenReturn( req );
+        when( req.setMainModuleDescriptor( eq( moduleInfo.getAbsolutePath() ) ) ).thenReturn( req );
+
+        @SuppressWarnings( "unchecked" )
+        ResolvePathsResult<String> res = mock( ResolvePathsResult.class );
+        when( res.getClasspathElements() ).thenReturn( asList( "non-modular.jar", "junit.jar", "hamcrest.jar" ) );
+        Map<String, ResolvePathsResult.ModuleNameSource> mod = new LinkedHashMap<String, ResolvePathsResult.ModuleNameSource>();
+        mod.put( "modular.jar", null );
+        mod.put( "target" + separatorChar + "classes", null );
+        when( res.getModulepathElements() ).thenReturn( mod );
+        when( locationManager.resolvePaths( eq( req ) ) ).thenReturn( res );
+
+        Logger logger = mock( Logger.class );
+        when( logger.isDebugEnabled() ).thenReturn( true );
+        doNothing().when( logger ).debug( anyString() );
+        when( mojo.getConsoleLogger() ).thenReturn( new PluginConsoleLogger( logger ) );
+
+        StartupConfiguration conf = invokeMethod( mojo, "newStartupConfigForModularClasspath",
+                classLoaderConfiguration, providerClasspath, "org.asf.Provider", moduleInfo, scanResult );
+
+        verify( mojo, times( 1 ) ).effectiveIsEnableAssertions();
+        verify( mojo, times( 1 ) ).isChildDelegation();
+        verifyPrivate( mojo, times( 1 ) ).invoke( "generateTestClasspath" );
+        verify( mojo, times( 1 ) ).getEffectiveForkCount();
+        verify( mojo, times( 1 ) ).getTestClassesDirectory();
+        verify( scanResult, times( 1 ) ).getClasses();
+        verifyStatic( ResolvePathsRequest.class, times( 1 ) );
+        ResolvePathsRequest.withStrings( eq( testClasspath.getClassPath() ) );
+        verify( req, times( 1 ) ).setMainModuleDescriptor( eq( moduleInfo.getAbsolutePath() ) );
+        verify( res, times( 1 ) ).getClasspathElements();
+        verify( res, times( 1 ) ).getModulepathElements();
+        verify( locationManager, times( 1 ) ).resolvePaths( eq( req ) );
+        ArgumentCaptor<String> argument = ArgumentCaptor.forClass( String.class );
+        verify( logger, times( 6 ) ).debug( argument.capture() );
+        assertThat( argument.getAllValues() )
+                .containsExactly( "test classpath:  non-modular.jar  junit.jar  hamcrest.jar",
+                        "test modulepath:  modular.jar  target" + separatorChar + "classes",
+                        "provider classpath:  surefire-provider.jar",
+                        "test(compact) classpath:  non-modular.jar  junit.jar  hamcrest.jar",
+                        "test(compact) modulepath:  modular.jar  classes",
+                        "provider(compact) classpath:  surefire-provider.jar"
+                );
+
+        assertThat( conf ).isNotNull();
+        assertThat( conf.isShadefire() ).isFalse();
+        assertThat( conf.isProviderMainClass() ).isFalse();
+        assertThat( conf.isManifestOnlyJarRequestedAndUsable() ).isFalse();
+        assertThat( conf.getClassLoaderConfiguration() ).isSameAs( classLoaderConfiguration );
+        assertThat( conf.getProviderClassName() ).isEqualTo( "org.asf.Provider" );
+        assertThat( conf.getActualClassName() ).isEqualTo( "org.asf.Provider" );
+        assertThat( conf.getClasspathConfiguration() ).isNotNull();
+        assertThat( ( Object ) conf.getClasspathConfiguration().getTestClasspath() )
+                .isEqualTo( new Classpath( res.getClasspathElements() ) );
+        assertThat( ( Object ) conf.getClasspathConfiguration().getProviderClasspath() ).isSameAs( providerClasspath );
+        assertThat( conf.getClasspathConfiguration() ).isInstanceOf( ModularClasspathConfiguration.class );
+        ModularClasspathConfiguration mcc = ( ModularClasspathConfiguration ) conf.getClasspathConfiguration();
+        assertThat( mcc.getModularClasspath().getModuleDescriptor() ).isEqualTo( moduleInfo );
+        assertThat( mcc.getModularClasspath().getPackages() ).containsOnly( "org.apache" );
+        assertThat( mcc.getModularClasspath().getPatchFile() )
+                .isEqualTo( new File( "target" + separatorChar + "test-classes" ) );
+        assertThat( mcc.getModularClasspath().getModulePath() )
+                .containsExactly( "modular.jar", "target" + separatorChar + "classes" );
+        assertThat( ( Object ) mcc.getTestClasspath() ).isEqualTo( new Classpath( res.getClasspathElements() ) );
+    }
+
+    @Test
+    public void shouldHaveTmpDirectory() throws IOException
+    {
+        Path path = ( Path ) AbstractSurefireMojo.createTmpDirectoryWithJava7( "surefire" );
+
+        assertThat( path )
+                .isNotNull();
+
+        assertThat( path.startsWith( System.getProperty( "java.io.tmpdir" ) ) )
+                .isTrue();
+
+        String dir = path.getName( path.getNameCount() - 1 ).toString();
+
+        assertThat( dir )
+                .startsWith( "surefire" );
+
+        assertThat( dir )
+                .matches( "^surefire[\\d]+$" );
+    }
+
+    @Test
+    public void shouldHaveTmpDirectoryName() throws IOException
+    {
+        String dir = AbstractSurefireMojo.createTmpDirectoryNameWithJava7( "surefire" );
+
+        assertThat( dir )
+                .isNotNull();
+
+        assertThat( dir )
+                .startsWith( "surefire" );
+
+        assertThat( dir )
+                .matches( "^surefire[\\d]+$" );
+    }
+
+    @Test
+    public void shouldTestIsJava7()
+    {
+        assertThat( isBuiltInJava7AtLeast() )
+                .isTrue();
+    }
+
+    public static class Mojo
+            extends AbstractSurefireMojo
+    {
+
+        @Override
+        protected String getPluginName()
+        {
+            return null;
+        }
+
+        @Override
+        protected int getRerunFailingTestsCount()
+        {
+            return 0;
+        }
+
+        @Override
+        public boolean isSkipTests()
+        {
+            return false;
+        }
+
+        @Override
+        public void setSkipTests( boolean skipTests )
+        {
+
+        }
+
+        @Override
+        public boolean isSkipExec()
+        {
+            return false;
+        }
+
+        @Override
+        public void setSkipExec( boolean skipExec )
+        {
+
+        }
+
+        @Override
+        public boolean isSkip()
+        {
+            return false;
+        }
+
+        @Override
+        public void setSkip( boolean skip )
+        {
+
+        }
+
+        @Override
+        public File getBasedir()
+        {
+            return null;
+        }
+
+        @Override
+        public void setBasedir( File basedir )
+        {
+
+        }
+
+        @Override
+        public File getTestClassesDirectory()
+        {
+            return null;
+        }
+
+        @Override
+        public void setTestClassesDirectory( File testClassesDirectory )
+        {
+
+        }
+
+        @Override
+        public File getClassesDirectory()
+        {
+            return null;
+        }
+
+        @Override
+        public void setClassesDirectory( File classesDirectory )
+        {
+
+        }
+
+        @Override
+        public File getReportsDirectory()
+        {
+            return null;
+        }
+
+        @Override
+        public void setReportsDirectory( File reportsDirectory )
+        {
+
+        }
+
+        @Override
+        public String getTest()
+        {
+            return null;
+        }
+
+        @Override
+        public void setTest( String test )
+        {
+
+        }
+
+        @Override
+        public List<String> getIncludes()
+        {
+            return null;
+        }
+
+        @Override
+        public File getIncludesFile()
+        {
+            return null;
+        }
+
+        @Override
+        public void setIncludes( List<String> includes )
+        {
+
+        }
+
+        @Override
+        public boolean isPrintSummary()
+        {
+            return false;
+        }
+
+        @Override
+        public void setPrintSummary( boolean printSummary )
+        {
+
+        }
+
+        @Override
+        public String getReportFormat()
+        {
+            return null;
+        }
+
+        @Override
+        public void setReportFormat( String reportFormat )
+        {
+
+        }
+
+        @Override
+        public boolean isUseFile()
+        {
+            return false;
+        }
+
+        @Override
+        public void setUseFile( boolean useFile )
+        {
+
+        }
+
+        @Override
+        public String getDebugForkedProcess()
+        {
+            return null;
+        }
+
+        @Override
+        public void setDebugForkedProcess( String debugForkedProcess )
+        {
+
+        }
+
+        @Override
+        public int getForkedProcessTimeoutInSeconds()
+        {
+            return 0;
+        }
+
+        @Override
+        public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds )
+        {
+
+        }
+
+        @Override
+        public int getForkedProcessExitTimeoutInSeconds()
+        {
+            return 0;
+        }
+
+        @Override
+        public void setForkedProcessExitTimeoutInSeconds( int forkedProcessTerminationTimeoutInSeconds )
+        {
+
+        }
+
+        @Override
+        public double getParallelTestsTimeoutInSeconds()
+        {
+            return 0;
+        }
+
+        @Override
+        public void setParallelTestsTimeoutInSeconds( double parallelTestsTimeoutInSeconds )
+        {
+
+        }
+
+        @Override
+        public double getParallelTestsTimeoutForcedInSeconds()
+        {
+            return 0;
+        }
+
+        @Override
+        public void setParallelTestsTimeoutForcedInSeconds( double parallelTestsTimeoutForcedInSeconds )
+        {
+
+        }
+
+        @Override
+        public boolean isUseSystemClassLoader()
+        {
+            return false;
+        }
+
+        @Override
+        public void setUseSystemClassLoader( boolean useSystemClassLoader )
+        {
+
+        }
+
+        @Override
+        public boolean isUseManifestOnlyJar()
+        {
+            return false;
+        }
+
+        @Override
+        public void setUseManifestOnlyJar( boolean useManifestOnlyJar )
+        {
+
+        }
+
+        @Override
+        public Boolean getFailIfNoSpecifiedTests()
+        {
+            return null;
+        }
+
+        @Override
+        public void setFailIfNoSpecifiedTests( boolean failIfNoSpecifiedTests )
+        {
+
+        }
+
+        @Override
+        public int getSkipAfterFailureCount()
+        {
+            return 0;
+        }
+
+        @Override
+        public String getShutdown()
+        {
+            return null;
+        }
+
+        @Override
+        public File getExcludesFile()
+        {
+            return null;
+        }
+
+        @Override
+        protected List<File> suiteXmlFiles()
+        {
+            return null;
+        }
+
+        @Override
+        protected boolean hasSuiteXmlFiles()
+        {
+            return false;
+        }
+
+        @Override
+        public File[] getSuiteXmlFiles()
+        {
+            return new File[0];
+        }
+
+        @Override
+        public void setSuiteXmlFiles( File[] suiteXmlFiles )
+        {
+
+        }
+
+        @Override
+        public String getRunOrder()
+        {
+            return null;
+        }
+
+        @Override
+        public void setRunOrder( String runOrder )
+        {
+
+        }
+
+        @Override
+        protected void handleSummary( RunResult summary, Exception firstForkException )
+                throws MojoExecutionException, MojoFailureException
+        {
+
+        }
+
+        @Override
+        protected boolean isSkipExecution()
+        {
+            return false;
+        }
+
+        @Override
+        protected String[] getDefaultIncludes()
+        {
+            return new String[0];
+        }
+
+        @Override
+        protected String getReportSchemaLocation()
+        {
+            return null;
+        }
+
+        @Override
+        protected Artifact getMojoArtifact()
+        {
+            return null;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
index 0fbe91b..5ea2b30 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
@@ -27,40 +27,26 @@ import org.apache.maven.plugin.surefire.log.PluginConsoleLogger;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
 import org.apache.maven.surefire.booter.Classpath;
-import org.apache.maven.surefire.booter.ModularClasspathConfiguration;
 import org.apache.maven.surefire.booter.StartupConfiguration;
 import org.apache.maven.surefire.suite.RunResult;
-import org.apache.maven.surefire.util.DefaultScanResult;
-import org.codehaus.plexus.languages.java.jpms.LocationManager;
-import org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest;
-import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult;
-import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult.ModuleNameSource;
 import org.codehaus.plexus.logging.Logger;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
-import org.mockito.Mock;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
 import java.io.File;
 import java.io.IOException;
-import java.lang.reflect.Field;
-import java.nio.file.Path;
 import java.util.HashSet;
-import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import static java.io.File.separatorChar;
 import static java.util.Arrays.asList;
 import static java.util.Collections.singleton;
 import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
-import static org.apache.maven.surefire.booter.SystemUtils.isBuiltInJava7AtLeast;
 import static org.fest.assertions.Assertions.assertThat;
-import static org.junit.Assume.assumeTrue;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
@@ -70,33 +56,18 @@ import static org.mockito.Mockito.verify;
 import static org.powermock.api.mockito.PowerMockito.doNothing;
 import static org.powermock.api.mockito.PowerMockito.doReturn;
 import static org.powermock.api.mockito.PowerMockito.mock;
-import static org.powermock.api.mockito.PowerMockito.mockStatic;
 import static org.powermock.api.mockito.PowerMockito.spy;
 import static org.powermock.api.mockito.PowerMockito.verifyPrivate;
-import static org.powermock.api.mockito.PowerMockito.verifyStatic;
-import static org.powermock.api.support.membermodification.MemberMatcher.field;
 import static org.powermock.reflect.Whitebox.invokeMethod;
 
 /**
  * Test for {@link AbstractSurefireMojo}.
  */
 @RunWith( PowerMockRunner.class )
-@PrepareForTest( { AbstractSurefireMojo.class, ResolvePathsRequest.class } )
+@PrepareForTest( AbstractSurefireMojo.class )
 public class AbstractSurefireMojoTest
 {
-    private Mojo mojo;
-
-    @Mock
-    private LocationManager locationManager;
-
-    @Before
-    public void initMojo() throws IllegalAccessException
-    {
-        mojo = new Mojo();
-        Field f = field( AbstractSurefireMojo.class, "locationManager" );
-        f.setAccessible( true );
-        f.set( mojo, locationManager );
-    }
+    private final Mojo mojo = new Mojo();
 
     @Test
     public void shouldGenerateTestClasspath() throws Exception
@@ -231,175 +202,46 @@ public class AbstractSurefireMojoTest
     }
 
     @Test
-    public void shouldHaveStartupConfigForModularClasspath()
-            throws Exception
-    {
-        AbstractSurefireMojo mojo = spy( this.mojo );
-
-        Classpath testClasspath = new Classpath( asList( "non-modular.jar", "modular.jar",
-                "target" + separatorChar + "classes", "junit.jar", "hamcrest.jar" ) );
-
-        doReturn( testClasspath ).when( mojo, "generateTestClasspath" );
-        doReturn( 1 ).when( mojo, "getEffectiveForkCount" );
-        doReturn( true ).when( mojo, "effectiveIsEnableAssertions" );
-        when( mojo.isChildDelegation() ).thenReturn( false );
-        when( mojo.getTestClassesDirectory() ).thenReturn( new File( "target" + separatorChar + "test-classes" ) );
-
-        DefaultScanResult scanResult = mock( DefaultScanResult.class );
-        when( scanResult.getClasses() ).thenReturn( asList( "org.apache.A", "org.apache.B" ) );
-
-        ClassLoaderConfiguration classLoaderConfiguration = new ClassLoaderConfiguration( false, true );
-
-        Classpath providerClasspath = new Classpath( singleton( "surefire-provider.jar" ) );
-
-        File moduleInfo = new File( "target" + separatorChar + "classes" + separatorChar + "module-info.class" );
-
-        @SuppressWarnings( "unchecked" )
-        ResolvePathsRequest<String> req = mock( ResolvePathsRequest.class );
-        mockStatic( ResolvePathsRequest.class );
-        when( ResolvePathsRequest.withStrings( eq( testClasspath.getClassPath() ) ) ).thenReturn( req );
-        when( req.setMainModuleDescriptor( eq( moduleInfo.getAbsolutePath() ) ) ).thenReturn( req );
-
-        @SuppressWarnings( "unchecked" )
-        ResolvePathsResult<String> res = mock( ResolvePathsResult.class );
-        when( res.getClasspathElements() ).thenReturn( asList( "non-modular.jar", "junit.jar", "hamcrest.jar" ) );
-        Map<String, ModuleNameSource> mod = new LinkedHashMap<String, ModuleNameSource>();
-        mod.put( "modular.jar", null );
-        mod.put( "target" + separatorChar + "classes", null );
-        when( res.getModulepathElements() ).thenReturn( mod );
-        when( locationManager.resolvePaths( eq( req ) ) ).thenReturn( res );
-
-        Logger logger = mock( Logger.class );
-        when( logger.isDebugEnabled() ).thenReturn( true );
-        doNothing().when( logger ).debug( anyString() );
-        when( mojo.getConsoleLogger() ).thenReturn( new PluginConsoleLogger( logger ) );
-
-        StartupConfiguration conf = invokeMethod( mojo, "newStartupConfigForModularClasspath",
-                classLoaderConfiguration, providerClasspath, "org.asf.Provider", moduleInfo, scanResult );
-
-        verify( mojo, times( 1 ) ).effectiveIsEnableAssertions();
-        verify( mojo, times( 1 ) ).isChildDelegation();
-        verifyPrivate( mojo, times( 1 ) ).invoke( "generateTestClasspath" );
-        verify( mojo, times( 1 ) ).getEffectiveForkCount();
-        verify( mojo, times( 1 ) ).getTestClassesDirectory();
-        verify( scanResult, times( 1 ) ).getClasses();
-        verifyStatic( ResolvePathsRequest.class, times( 1 ) );
-        ResolvePathsRequest.withStrings( eq( testClasspath.getClassPath() ) );
-        verify( req, times( 1 ) ).setMainModuleDescriptor( eq( moduleInfo.getAbsolutePath() ) );
-        verify( res, times( 1 ) ).getClasspathElements();
-        verify( res, times( 1 ) ).getModulepathElements();
-        verify( locationManager, times( 1 ) ).resolvePaths( eq( req ) );
-        ArgumentCaptor<String> argument = ArgumentCaptor.forClass( String.class );
-        verify( logger, times( 6 ) ).debug( argument.capture() );
-        assertThat( argument.getAllValues() )
-                .containsExactly( "test classpath:  non-modular.jar  junit.jar  hamcrest.jar",
-                        "test modulepath:  modular.jar  target" + separatorChar + "classes",
-                        "provider classpath:  surefire-provider.jar",
-                        "test(compact) classpath:  non-modular.jar  junit.jar  hamcrest.jar",
-                        "test(compact) modulepath:  modular.jar  classes",
-                        "provider(compact) classpath:  surefire-provider.jar"
-                );
-
-        assertThat( conf ).isNotNull();
-        assertThat( conf.isShadefire() ).isFalse();
-        assertThat( conf.isProviderMainClass() ).isFalse();
-        assertThat( conf.isManifestOnlyJarRequestedAndUsable() ).isFalse();
-        assertThat( conf.getClassLoaderConfiguration() ).isSameAs( classLoaderConfiguration );
-        assertThat( conf.getProviderClassName() ).isEqualTo( "org.asf.Provider" );
-        assertThat( conf.getActualClassName() ).isEqualTo( "org.asf.Provider" );
-        assertThat( conf.getClasspathConfiguration() ).isNotNull();
-        assertThat( ( Object ) conf.getClasspathConfiguration().getTestClasspath() )
-                .isEqualTo( new Classpath( res.getClasspathElements() ) );
-        assertThat( ( Object ) conf.getClasspathConfiguration().getProviderClasspath() ).isSameAs( providerClasspath );
-        assertThat( conf.getClasspathConfiguration() ).isInstanceOf( ModularClasspathConfiguration.class );
-        ModularClasspathConfiguration mcc = ( ModularClasspathConfiguration ) conf.getClasspathConfiguration();
-        assertThat( mcc.getModularClasspath().getModuleDescriptor() ).isEqualTo( moduleInfo );
-        assertThat( mcc.getModularClasspath().getPackages() ).containsOnly( "org.apache" );
-        assertThat( mcc.getModularClasspath().getPatchFile() )
-                .isEqualTo( new File( "target" + separatorChar + "test-classes" ) );
-        assertThat( mcc.getModularClasspath().getModulePath() )
-                .containsExactly( "modular.jar", "target" + separatorChar + "classes" );
-        assertThat( ( Object ) mcc.getTestClasspath() ).isEqualTo( new Classpath( res.getClasspathElements() ) );
-    }
-
-    @Test
-    public void shouldHaveTmpDirectory() throws IOException
-    {
-        assumeTrue( isBuiltInJava7AtLeast() );
-
-        Path path = ( Path ) AbstractSurefireMojo.createTmpDirectoryWithJava7( "surefire" );
-
-        assertThat( path )
-                .isNotNull();
-
-        assertThat( path.startsWith( System.getProperty( "java.io.tmpdir" ) ) )
-                .isTrue();
-
-        String dir = path.getName( path.getNameCount() - 1 ).toString();
-
-        assertThat( dir )
-                .startsWith( "surefire" );
-
-        assertThat( dir )
-                .matches( "^surefire[\\d]+$" );
-    }
-
-    @Test
-    public void shouldHaveTmpDirectoryName() throws IOException
+    public void shouldExistTmpDirectory() throws IOException
     {
-        assumeTrue( isBuiltInJava7AtLeast() );
+        String systemTmpDir = System.getProperty( "java.io.tmpdir" );
+        String usrDir = new File( System.getProperty( "user.dir" ) ).getCanonicalPath();
 
-        String dir = AbstractSurefireMojo.createTmpDirectoryNameWithJava7( "surefire" );
+        String tmpDir = "surefireX" + System.currentTimeMillis();
 
-        assertThat( dir )
-                .isNotNull();
+        //noinspection ResultOfMethodCallIgnored
+        new File( systemTmpDir, tmpDir ).delete();
 
-        assertThat( dir )
-                .startsWith( "surefire" );
-
-        assertThat( dir )
-                .matches( "^surefire[\\d]+$" );
-    }
+        File targetDir = new File( usrDir, "target" );
+        //noinspection ResultOfMethodCallIgnored
+        new File( targetDir, tmpDir ).delete();
 
-    @Test
-    public void shouldExistTmpDirectory()
-    {
         AbstractSurefireMojo mojo = mock( AbstractSurefireMojo.class );
-        when( mojo.getTempDir() ).thenReturn( "surefireX" );
-        when( mojo.getProjectBuildDirectory() ).thenReturn( new File( System.getProperty( "user.dir" ), "target" ) );
+        when( mojo.getTempDir() ).thenReturn( tmpDir );
+        when( mojo.getProjectBuildDirectory() ).thenReturn( targetDir );
         when( mojo.createSurefireBootDirectoryInTemp() ).thenCallRealMethod();
         when( mojo.createSurefireBootDirectoryInBuild() ).thenCallRealMethod();
         when( mojo.getSurefireTempDir() ).thenCallRealMethod();
 
-        File tmp = mojo.createSurefireBootDirectoryInTemp();
-        assertThat( tmp ).isNotNull();
-        assertThat( tmp ).exists();
-        assertThat( tmp.getAbsolutePath() )
-                .startsWith( System.getProperty( "java.io.tmpdir" ) );
-        assertThat( tmp.getName() )
-                .startsWith( "surefireX" );
+        File bootDir = mojo.createSurefireBootDirectoryInTemp();
+        assertThat( bootDir ).isNotNull();
+        assertThat( bootDir ).isDirectory();
 
-        tmp = mojo.createSurefireBootDirectoryInBuild();
-        assertThat( tmp ).isNotNull();
-        assertThat( tmp ).exists();
-        assertThat( tmp.getAbsolutePath() ).startsWith( System.getProperty( "user.dir" ) );
-        assertThat( tmp.getName() ).isEqualTo( "surefireX" );
+        assertThat( new File( systemTmpDir, bootDir.getName() ) ).isDirectory();
+        assertThat( bootDir.getName() )
+                .startsWith( tmpDir );
 
-        tmp = mojo.getSurefireTempDir();
+        File buildTmp = mojo.createSurefireBootDirectoryInBuild();
+        assertThat( buildTmp ).isNotNull();
+        assertThat( buildTmp ).isDirectory();
+        assertThat( buildTmp.getParentFile().getCanonicalFile().getParent() ).isEqualTo( usrDir );
+        assertThat( buildTmp.getName() ).isEqualTo( tmpDir );
+
+        File tmp = mojo.getSurefireTempDir();
         assertThat( tmp ).isNotNull();
-        assertThat( tmp ).exists();
-        assertThat( tmp.getAbsolutePath() )
-                .startsWith(
-                        IS_OS_WINDOWS ? System.getProperty( "java.io.tmpdir" ) : System.getProperty( "user.dir" ) );
-        if ( IS_OS_WINDOWS )
-        {
-            assertThat( tmp.getName() )
-                    .startsWith( "surefireX" );
-        } else
-        {
-            assertThat( tmp.getName() )
-                    .isEqualTo( "surefireX" );
-        }
+        assertThat( tmp ).isDirectory();
+        assertThat( new File( IS_OS_WINDOWS ? systemTmpDir : usrDir, IS_OS_WINDOWS ? bootDir.getName() : tmpDir ) )
+                .isDirectory();
     }
 
     public static class Mojo

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
index 6053f24..6d34dcd 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
@@ -27,6 +27,7 @@ import org.apache.maven.surefire.booter.ForkedBooter;
 import org.apache.maven.surefire.booter.ModularClasspath;
 import org.apache.maven.surefire.booter.ModularClasspathConfiguration;
 import org.apache.maven.surefire.booter.StartupConfiguration;
+import org.junit.Before;
 import org.junit.Test;
 
 import javax.annotation.Nonnull;
@@ -37,6 +38,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Properties;
 
+import static org.apache.commons.lang3.JavaVersion.JAVA_1_7;
+import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
 import static java.io.File.separator;
 import static java.io.File.pathSeparator;
 import static java.nio.charset.StandardCharsets.UTF_8;
@@ -44,6 +47,7 @@ import static java.nio.file.Files.readAllLines;
 import static java.util.Arrays.asList;
 import static java.util.Collections.singleton;
 import static org.fest.assertions.Assertions.assertThat;
+import static org.junit.Assume.assumeTrue;
 
 /**
  * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
@@ -51,6 +55,12 @@ import static org.fest.assertions.Assertions.assertThat;
  */
 public class ModularClasspathForkConfigurationTest
 {
+    @Before
+    public void withJava7orHigher()
+    {
+        assumeTrue( JAVA_RECENT.atLeast( JAVA_1_7 ) );
+    }
+
     @Test
     @SuppressWarnings( "ResultOfMethodCallIgnored" )
     public void shouldCreateModularArgsFile() throws Exception

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/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 3f94039..611e497 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
@@ -28,7 +28,7 @@ import java.io.IOException;
 import java.util.ArrayDeque;
 import java.util.Queue;
 import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentLinkedDeque;
+import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.FutureTask;
 import java.util.concurrent.TimeUnit;
 
@@ -140,7 +140,7 @@ public class TestProvidingInputStreamTest
     public void shouldDecodeTwoCommands()
             throws IOException
     {
-        TestProvidingInputStream pluginIs = new TestProvidingInputStream( new ConcurrentLinkedDeque<String>() );
+        TestProvidingInputStream pluginIs = new TestProvidingInputStream( new ConcurrentLinkedQueue<String>() );
         pluginIs.acknowledgeByeEventReceived();
         pluginIs.noop();
         DataInputStream is = new DataInputStream( pluginIs );

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/maven-surefire-common/src/test/java/org/apache/maven/surefire/JUnit4SuiteTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/JUnit4SuiteTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/JUnit4SuiteTest.java
index 5a5dae2..bd99abc 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/JUnit4SuiteTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/JUnit4SuiteTest.java
@@ -21,6 +21,9 @@ package org.apache.maven.surefire;
 
 import junit.framework.JUnit4TestAdapter;
 import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import org.apache.maven.plugin.surefire.AbstractSurefireMojoJava7PlusTest;
 import org.apache.maven.plugin.surefire.AbstractSurefireMojoTest;
 import org.apache.maven.plugin.surefire.SurefireHelperTest;
 import org.apache.maven.plugin.surefire.SurefireReflectorTest;
@@ -45,8 +48,9 @@ import org.apache.maven.surefire.report.FileReporterTest;
 import org.apache.maven.surefire.report.RunStatisticsTest;
 import org.apache.maven.surefire.spi.SPITest;
 import org.apache.maven.surefire.util.RelocatorTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
+
+import static org.apache.commons.lang3.JavaVersion.JAVA_1_7;
+import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
 
 /**
  * Adapt the JUnit4 tests which use only annotations to the JUnit3 test suite.
@@ -54,37 +58,39 @@ import org.junit.runners.Suite;
  * @author Tibor Digana (tibor17)
  * @since 2.19
  */
-@Suite.SuiteClasses( {
-    RelocatorTest.class,
-    RunStatisticsTest.class,
-    FileReporterTest.class,
-    ConsoleOutputFileReporterTest.class,
-    SurefirePropertiesTest.class,
-    SpecificFileFilterTest.class,
-    DirectoryScannerTest.class,
-    DependenciesScannerTest.class,
-    RunEntryStatisticsMapTest.class,
-    WrappedReportEntryTest.class,
-    StatelessXmlReporterTest.class,
-    DefaultReporterFactoryTest.class,
-    ForkingRunListenerTest.class,
-    ForkConfigurationTest.class,
-    BooterDeserializerStartupConfigurationTest.class,
-    BooterDeserializerProviderConfigurationTest.class,
-    TestProvidingInputStreamTest.class,
-    TestLessInputStreamBuilderTest.class,
-    SPITest.class,
-    SurefireReflectorTest.class,
-    SurefireHelperTest.class,
-    AbstractSurefireMojoTest.class,
-    DefaultForkConfigurationTest.class,
-    ModularClasspathForkConfigurationTest.class
-} )
-@RunWith( Suite.class )
-public class JUnit4SuiteTest
+public class JUnit4SuiteTest extends TestCase
 {
     public static Test suite()
     {
-        return new JUnit4TestAdapter( JUnit4SuiteTest.class );
+        TestSuite suite = new TestSuite();
+        suite.addTestSuite( RelocatorTest.class );
+        suite.addTestSuite( RunStatisticsTest.class );
+        suite.addTestSuite( FileReporterTest.class );
+        suite.addTestSuite( ConsoleOutputFileReporterTest.class );
+        suite.addTestSuite( SurefirePropertiesTest.class );
+        suite.addTestSuite( SpecificFileFilterTest.class );
+        suite.addTest( new JUnit4TestAdapter( DirectoryScannerTest.class ) );
+        suite.addTestSuite( DependenciesScannerTest.class );
+        suite.addTestSuite( RunEntryStatisticsMapTest.class );
+        suite.addTestSuite( WrappedReportEntryTest.class );
+        suite.addTestSuite( StatelessXmlReporterTest.class );
+        suite.addTestSuite( DefaultReporterFactoryTest.class );
+        suite.addTestSuite( ForkingRunListenerTest.class );
+        suite.addTest( new JUnit4TestAdapter( ForkConfigurationTest.class ) );
+        suite.addTestSuite( BooterDeserializerStartupConfigurationTest.class );
+        suite.addTestSuite( BooterDeserializerProviderConfigurationTest.class );
+        suite.addTest( new JUnit4TestAdapter( TestProvidingInputStreamTest.class ) );
+        suite.addTest( new JUnit4TestAdapter( TestLessInputStreamBuilderTest.class ) );
+        suite.addTest( new JUnit4TestAdapter( SPITest.class ) );
+        suite.addTest( new JUnit4TestAdapter( SurefireReflectorTest.class ) );
+        suite.addTest( new JUnit4TestAdapter( SurefireHelperTest.class ) );
+        suite.addTest( new JUnit4TestAdapter( AbstractSurefireMojoTest.class ) );
+        suite.addTest( new JUnit4TestAdapter( DefaultForkConfigurationTest.class ) );
+        suite.addTest( new JUnit4TestAdapter( ModularClasspathForkConfigurationTest.class ) );
+        if ( JAVA_RECENT.atLeast( JAVA_1_7 ) )
+        {
+            suite.addTest( new JUnit4TestAdapter( AbstractSurefireMojoJava7PlusTest.class ) );
+        }
+        return suite;
     }
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b431123..3cd0862 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,8 +97,8 @@
     <maven.site.path>surefire-archives/surefire-LATEST</maven.site.path>
     <!-- Override with Jigsaw JRE 9 -->
     <jdk.home>${java.home}/..</jdk.home>
-    <maven.compiler.testSource>1.7</maven.compiler.testSource>
-    <maven.compiler.testTarget>1.7</maven.compiler.testTarget>
+    <maven.compiler.testSource>1.6</maven.compiler.testSource>
+    <maven.compiler.testTarget>1.6</maven.compiler.testTarget>
     <jvm.args.tests>-server -XX:+UseG1GC -Xms128m -Xmx144m -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:SoftRefLRUPolicyMSPerMB=50 -Djava.awt.headless=true</jvm.args.tests>
   </properties>
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/pom.xml b/surefire-its/pom.xml
index bc097db..31631b2 100644
--- a/surefire-its/pom.xml
+++ b/surefire-its/pom.xml
@@ -34,8 +34,6 @@
 
   <properties>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
   </properties>
 
   <dependencies>
@@ -73,10 +71,8 @@
       <artifactId>commons-io</artifactId>
     </dependency>
     <dependency>
-      <!-- Java 9 requires version 3.6+ (todo use in parent POM. Note: versions 3.6, 3.7 are compiled with Java 7) -->
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>
-      <version>3.7</version>
     </dependency>
   </dependencies>
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java
index 7f73d48..6695301 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractJigsawIT.java
@@ -77,19 +77,13 @@ public abstract class AbstractJigsawIT
     private static boolean isExtJavaVerion9AtLeast() throws IOException
     {
         File release = new File( EXT_JDK_HOME, "release" );
-
-        if ( !release.isFile() )
-        {
-            fail( EXT_JDK_HOME_KEY + " was provided with value " + EXT_JDK_HOME + " but file does not exist "
-                          + EXT_JDK_HOME + File.separator + "release"
-            );
-        }
+        assumeTrue( EXT_JDK_HOME_KEY + " was provided with value " + EXT_JDK_HOME + " but file does not exist "
+                + EXT_JDK_HOME + File.separator + "release", release.exists() );
 
         Properties properties = new Properties();
-        try ( InputStream is = new FileInputStream( release ) )
-        {
-            properties.load( is );
-        }
+        InputStream is = new FileInputStream( release );
+        properties.load( is );
+        is.close();
         String javaVersion = properties.getProperty( "JAVA_VERSION" ).replace( "\"", "" );
         StringTokenizer versions = new StringTokenizer( javaVersion, "._" );
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
index 76d96e0..7dfe51a 100755
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
@@ -139,7 +139,7 @@ public final class SurefireLauncher
 
     private List<String> getInitialGoals()
     {
-        List<String> goals = new ArrayList<>();
+        List<String> goals = new ArrayList<String>();
 
         goals.add( "-Dsurefire.version=" + surefireVersion );
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/environment-variables/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/environment-variables/pom.xml b/surefire-its/src/test/resources/environment-variables/pom.xml
index 902e97e..6b8e3bc 100644
--- a/surefire-its/src/test/resources/environment-variables/pom.xml
+++ b/surefire-its/src/test/resources/environment-variables/pom.xml
@@ -31,8 +31,8 @@
     <properties>
       <forkMode>always</forkMode>
       <useSystemClassLoader>false</useSystemClassLoader>
-      <maven.compiler.source>1.7</maven.compiler.source>
-      <maven.compiler.target>1.7</maven.compiler.target>
+      <maven.compiler.source>1.6</maven.compiler.source>
+      <maven.compiler.target>1.6</maven.compiler.target>
     </properties>
   <dependencies>
     <dependency>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/failingBuilds/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/failingBuilds/pom.xml b/surefire-its/src/test/resources/failingBuilds/pom.xml
index 8e988ad..d30dbb3 100644
--- a/surefire-its/src/test/resources/failingBuilds/pom.xml
+++ b/surefire-its/src/test/resources/failingBuilds/pom.xml
@@ -34,7 +34,7 @@
   <properties>
     <junit.version>4.8.1</junit.version>
     <forkMode>once</forkMode>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/failsafe-notests/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/failsafe-notests/pom.xml b/surefire-its/src/test/resources/failsafe-notests/pom.xml
index 24d1dec..b6d29b9 100644
--- a/surefire-its/src/test/resources/failsafe-notests/pom.xml
+++ b/surefire-its/src/test/resources/failsafe-notests/pom.xml
@@ -28,8 +28,8 @@
   <name>failsafe-notests</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/failure-result-counting/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/failure-result-counting/pom.xml b/surefire-its/src/test/resources/failure-result-counting/pom.xml
index 7d79f29..9d6ae84 100644
--- a/surefire-its/src/test/resources/failure-result-counting/pom.xml
+++ b/surefire-its/src/test/resources/failure-result-counting/pom.xml
@@ -32,7 +32,7 @@
   <properties>
     <junit.version>4.10</junit.version>
     <forkMode>once</forkMode>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/failureOutput/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/failureOutput/pom.xml b/surefire-its/src/test/resources/failureOutput/pom.xml
index 85c10ee..e6ad639 100644
--- a/surefire-its/src/test/resources/failureOutput/pom.xml
+++ b/surefire-its/src/test/resources/failureOutput/pom.xml
@@ -43,8 +43,8 @@
       <printSummary>true</printSummary>
       <useFile>true</useFile>
       <reportFormat>brief</reportFormat>
-      <maven.compiler.source>1.7</maven.compiler.source>
-      <maven.compiler.target>1.7</maven.compiler.target>
+      <maven.compiler.source>1.6</maven.compiler.source>
+      <maven.compiler.target>1.6</maven.compiler.target>
     </properties>
 
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/fork-consoleOutput/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/fork-consoleOutput/pom.xml b/surefire-its/src/test/resources/fork-consoleOutput/pom.xml
index 407d86b..1c89877 100644
--- a/surefire-its/src/test/resources/fork-consoleOutput/pom.xml
+++ b/surefire-its/src/test/resources/fork-consoleOutput/pom.xml
@@ -40,8 +40,8 @@
       <forkMode>once</forkMode>
       <printSummary>true</printSummary>
       <reportFormat>brief</reportFormat>
-      <maven.compiler.source>1.7</maven.compiler.source>
-      <maven.compiler.target>1.7</maven.compiler.target>
+      <maven.compiler.source>1.6</maven.compiler.source>
+      <maven.compiler.target>1.6</maven.compiler.target>
     </properties>
 
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/fork-consoleOutputWithErrors/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/fork-consoleOutputWithErrors/pom.xml b/surefire-its/src/test/resources/fork-consoleOutputWithErrors/pom.xml
index 9aa5e1b..5f3af23 100644
--- a/surefire-its/src/test/resources/fork-consoleOutputWithErrors/pom.xml
+++ b/surefire-its/src/test/resources/fork-consoleOutputWithErrors/pom.xml
@@ -43,8 +43,8 @@
       <printSummary>true</printSummary>
       <useFile>true</useFile>
       <reportFormat>brief</reportFormat>
-      <maven.compiler.source>1.7</maven.compiler.source>
-      <maven.compiler.target>1.7</maven.compiler.target>
+      <maven.compiler.source>1.6</maven.compiler.source>
+      <maven.compiler.target>1.6</maven.compiler.target>
     </properties>
 
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/fork-fail/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/fork-fail/pom.xml b/surefire-its/src/test/resources/fork-fail/pom.xml
index 9db6d72..8825613 100644
--- a/surefire-its/src/test/resources/fork-fail/pom.xml
+++ b/surefire-its/src/test/resources/fork-fail/pom.xml
@@ -30,8 +30,8 @@
 
   <properties>
     <argLine>-Xmxxxx712743m</argLine>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/fork-mode-multimodule/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/fork-mode-multimodule/pom.xml b/surefire-its/src/test/resources/fork-mode-multimodule/pom.xml
index e0786b1..708598c 100644
--- a/surefire-its/src/test/resources/fork-mode-multimodule/pom.xml
+++ b/surefire-its/src/test/resources/fork-mode-multimodule/pom.xml
@@ -31,8 +31,8 @@
   <packaging>pom</packaging>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <modules>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/fork-mode-resource-loading/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/fork-mode-resource-loading/pom.xml b/surefire-its/src/test/resources/fork-mode-resource-loading/pom.xml
index e40033c..21a0fc2 100644
--- a/surefire-its/src/test/resources/fork-mode-resource-loading/pom.xml
+++ b/surefire-its/src/test/resources/fork-mode-resource-loading/pom.xml
@@ -29,8 +29,8 @@
   <name>Test for forkMode</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/fork-mode-testng/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/fork-mode-testng/pom.xml b/surefire-its/src/test/resources/fork-mode-testng/pom.xml
index 8e25749..1f1956b 100644
--- a/surefire-its/src/test/resources/fork-mode-testng/pom.xml
+++ b/surefire-its/src/test/resources/fork-mode-testng/pom.xml
@@ -13,8 +13,8 @@
   <name>Test for forkMode</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/fork-mode/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/fork-mode/pom.xml b/surefire-its/src/test/resources/fork-mode/pom.xml
index 28bfb4d..ad9ec47 100644
--- a/surefire-its/src/test/resources/fork-mode/pom.xml
+++ b/surefire-its/src/test/resources/fork-mode/pom.xml
@@ -29,8 +29,8 @@
   <name>Test for forkMode</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/fork-timeout/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/fork-timeout/pom.xml b/surefire-its/src/test/resources/fork-timeout/pom.xml
index 25365a2..67d85e9 100644
--- a/surefire-its/src/test/resources/fork-timeout/pom.xml
+++ b/surefire-its/src/test/resources/fork-timeout/pom.xml
@@ -12,8 +12,8 @@
     <junit.parallel>classes</junit.parallel>
     <forkMode>once</forkMode>
     <timeOut>1</timeOut>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
   <dependencies>
       <dependency>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/includes-excludes-from-file/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/includes-excludes-from-file/pom.xml b/surefire-its/src/test/resources/includes-excludes-from-file/pom.xml
index 39313db..d69c129 100644
--- a/surefire-its/src/test/resources/includes-excludes-from-file/pom.xml
+++ b/surefire-its/src/test/resources/includes-excludes-from-file/pom.xml
@@ -31,8 +31,8 @@ under the License.
 
   <properties>
     <junit.version>3.8.2</junit.version>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/includes-excludes/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/includes-excludes/pom.xml b/surefire-its/src/test/resources/includes-excludes/pom.xml
index 77711f7..f107168 100644
--- a/surefire-its/src/test/resources/includes-excludes/pom.xml
+++ b/surefire-its/src/test/resources/includes-excludes/pom.xml
@@ -31,8 +31,8 @@ under the License.
 
   <properties>
     <junit.version>3.8.2</junit.version>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/isolated-classloader/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/isolated-classloader/pom.xml b/surefire-its/src/test/resources/isolated-classloader/pom.xml
index a853063..e761141 100644
--- a/surefire-its/src/test/resources/isolated-classloader/pom.xml
+++ b/surefire-its/src/test/resources/isolated-classloader/pom.xml
@@ -29,8 +29,8 @@
   <name>Test for useSystemClassLoader=false</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit-fork-mode-always/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit-fork-mode-always/pom.xml b/surefire-its/src/test/resources/junit-fork-mode-always/pom.xml
index 9b86c75..8b48b46 100644
--- a/surefire-its/src/test/resources/junit-fork-mode-always/pom.xml
+++ b/surefire-its/src/test/resources/junit-fork-mode-always/pom.xml
@@ -29,8 +29,8 @@
   <name>Test for forkMode</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit-ignore/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit-ignore/pom.xml b/surefire-its/src/test/resources/junit-ignore/pom.xml
index d9c3817..a9547fc 100644
--- a/surefire-its/src/test/resources/junit-ignore/pom.xml
+++ b/surefire-its/src/test/resources/junit-ignore/pom.xml
@@ -32,8 +32,8 @@
     <junit.version>4.4</junit.version>
     <surefire.parallel></surefire.parallel>
     <surefire.threadcount>3</surefire.threadcount>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit-innerClass/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit-innerClass/pom.xml b/surefire-its/src/test/resources/junit-innerClass/pom.xml
index fb1ffd6..ac98523 100644
--- a/surefire-its/src/test/resources/junit-innerClass/pom.xml
+++ b/surefire-its/src/test/resources/junit-innerClass/pom.xml
@@ -29,8 +29,8 @@
   <name>Test JUnit classes with inner classes</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit-notExtendingTestCase/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit-notExtendingTestCase/pom.xml b/surefire-its/src/test/resources/junit-notExtendingTestCase/pom.xml
index 8a95201..3a05cf1 100644
--- a/surefire-its/src/test/resources/junit-notExtendingTestCase/pom.xml
+++ b/surefire-its/src/test/resources/junit-notExtendingTestCase/pom.xml
@@ -29,8 +29,8 @@
   <name>Test for JUnit tests that don't extend TestCase</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit-pathWithUmlaut/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit-pathWithUmlaut/pom.xml b/surefire-its/src/test/resources/junit-pathWithUmlaut/pom.xml
index 890839e..e7366a2 100644
--- a/surefire-its/src/test/resources/junit-pathWithUmlaut/pom.xml
+++ b/surefire-its/src/test/resources/junit-pathWithUmlaut/pom.xml
@@ -29,8 +29,8 @@
   <name>Test path with Ümlaut</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit-twoTestCaseSuite/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit-twoTestCaseSuite/pom.xml b/surefire-its/src/test/resources/junit-twoTestCaseSuite/pom.xml
index f2075ae..ce121c7 100644
--- a/surefire-its/src/test/resources/junit-twoTestCaseSuite/pom.xml
+++ b/surefire-its/src/test/resources/junit-twoTestCaseSuite/pom.xml
@@ -29,8 +29,8 @@
   <name>Test for single suite with two test cases</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit-twoTestCases/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit-twoTestCases/pom.xml b/surefire-its/src/test/resources/junit-twoTestCases/pom.xml
index 89684ad..51ad8b2 100644
--- a/surefire-its/src/test/resources/junit-twoTestCases/pom.xml
+++ b/surefire-its/src/test/resources/junit-twoTestCases/pom.xml
@@ -24,8 +24,8 @@
   <modelVersion>4.0.0</modelVersion>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <groupId>org.apache.maven.plugins.surefire</groupId>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit4-forkAlways-staticInit/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit4-forkAlways-staticInit/pom.xml b/surefire-its/src/test/resources/junit4-forkAlways-staticInit/pom.xml
index 4bfc081..77ce5c4 100644
--- a/surefire-its/src/test/resources/junit4-forkAlways-staticInit/pom.xml
+++ b/surefire-its/src/test/resources/junit4-forkAlways-staticInit/pom.xml
@@ -11,8 +11,8 @@
   </description>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit4-rerun-failing-tests/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit4-rerun-failing-tests/pom.xml b/surefire-its/src/test/resources/junit4-rerun-failing-tests/pom.xml
index 9456a29..1bf63c7 100644
--- a/surefire-its/src/test/resources/junit4-rerun-failing-tests/pom.xml
+++ b/surefire-its/src/test/resources/junit4-rerun-failing-tests/pom.xml
@@ -29,8 +29,8 @@
   <name>Test for rerun failing tests in JUnit 4</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit4-runlistener/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit4-runlistener/pom.xml b/surefire-its/src/test/resources/junit4-runlistener/pom.xml
index d776533..ff22b91 100644
--- a/surefire-its/src/test/resources/junit4-runlistener/pom.xml
+++ b/surefire-its/src/test/resources/junit4-runlistener/pom.xml
@@ -31,8 +31,8 @@
   <properties>
     <junitVersion>4.4</junitVersion>
     <provider>surefire-junit4</provider>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit4-twoTestCaseSuite/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit4-twoTestCaseSuite/pom.xml b/surefire-its/src/test/resources/junit4-twoTestCaseSuite/pom.xml
index 867cd09..5836224 100644
--- a/surefire-its/src/test/resources/junit4-twoTestCaseSuite/pom.xml
+++ b/surefire-its/src/test/resources/junit4-twoTestCaseSuite/pom.xml
@@ -31,8 +31,8 @@
 
   <properties>
     <junitVersion>4.4</junitVersion>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit4/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit4/pom.xml b/surefire-its/src/test/resources/junit4/pom.xml
index bba9b00..751a0e6 100644
--- a/surefire-its/src/test/resources/junit4/pom.xml
+++ b/surefire-its/src/test/resources/junit4/pom.xml
@@ -29,8 +29,8 @@
 
   <properties>
     <junitVersion>4.4</junitVersion>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit44-dep/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit44-dep/pom.xml b/surefire-its/src/test/resources/junit44-dep/pom.xml
index d26c024..bae6ad6 100644
--- a/surefire-its/src/test/resources/junit44-dep/pom.xml
+++ b/surefire-its/src/test/resources/junit44-dep/pom.xml
@@ -29,8 +29,8 @@
   <name>Test for junit-dep</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit44-environment/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit44-environment/pom.xml b/surefire-its/src/test/resources/junit44-environment/pom.xml
index eb04443..af18c21 100644
--- a/surefire-its/src/test/resources/junit44-environment/pom.xml
+++ b/surefire-its/src/test/resources/junit44-environment/pom.xml
@@ -29,8 +29,8 @@
   <name>Test for setting environment variables</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit44-hamcrest/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit44-hamcrest/pom.xml b/surefire-its/src/test/resources/junit44-hamcrest/pom.xml
index 4140b41..c5e44ab 100644
--- a/surefire-its/src/test/resources/junit44-hamcrest/pom.xml
+++ b/surefire-its/src/test/resources/junit44-hamcrest/pom.xml
@@ -29,8 +29,8 @@
   <name>Test for JUnit44 with Hamcrest extensions</name>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit44-method-pattern/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit44-method-pattern/pom.xml b/surefire-its/src/test/resources/junit44-method-pattern/pom.xml
index e9ac59e..3ed4b2a 100644
--- a/surefire-its/src/test/resources/junit44-method-pattern/pom.xml
+++ b/surefire-its/src/test/resources/junit44-method-pattern/pom.xml
@@ -31,8 +31,8 @@
 
   <properties>
     <junitVersion>4.4</junitVersion>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit44-single-method/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit44-single-method/pom.xml b/surefire-its/src/test/resources/junit44-single-method/pom.xml
index c74aee2..26769be 100644
--- a/surefire-its/src/test/resources/junit44-single-method/pom.xml
+++ b/surefire-its/src/test/resources/junit44-single-method/pom.xml
@@ -31,8 +31,8 @@
 
   <properties>
     <junitVersion>4.4</junitVersion>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit47-parallel-with-suite/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit47-parallel-with-suite/pom.xml b/surefire-its/src/test/resources/junit47-parallel-with-suite/pom.xml
index 5dcbaba..c8aa695 100644
--- a/surefire-its/src/test/resources/junit47-parallel-with-suite/pom.xml
+++ b/surefire-its/src/test/resources/junit47-parallel-with-suite/pom.xml
@@ -16,8 +16,8 @@
   </dependencies>
   <properties>
     <parallel>methods</parallel>
-      <maven.compiler.source>1.7</maven.compiler.source>
-      <maven.compiler.target>1.7</maven.compiler.target>
+      <maven.compiler.source>1.6</maven.compiler.source>
+      <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
   <build>
      <plugins>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit47-redirect-output/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit47-redirect-output/pom.xml b/surefire-its/src/test/resources/junit47-redirect-output/pom.xml
index 38ec727..a4b9066 100644
--- a/surefire-its/src/test/resources/junit47-redirect-output/pom.xml
+++ b/surefire-its/src/test/resources/junit47-redirect-output/pom.xml
@@ -51,8 +51,8 @@
       <forkMode>once</forkMode>
       <printSummary>true</printSummary>
       <parallel>none</parallel>
-      <maven.compiler.source>1.7</maven.compiler.source>
-      <maven.compiler.target>1.7</maven.compiler.target>
+      <maven.compiler.source>1.6</maven.compiler.source>
+      <maven.compiler.target>1.6</maven.compiler.target>
     </properties>
 
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6df27f80/surefire-its/src/test/resources/junit47-static-inner-class-tests/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-its/src/test/resources/junit47-static-inner-class-tests/pom.xml b/surefire-its/src/test/resources/junit47-static-inner-class-tests/pom.xml
index 81f26c2..b0c40ec 100644
--- a/surefire-its/src/test/resources/junit47-static-inner-class-tests/pom.xml
+++ b/surefire-its/src/test/resources/junit47-static-inner-class-tests/pom.xml
@@ -8,8 +8,8 @@
   <name>junit47-static-inner-class-tests</name>
   <url>http://maven.apache.org</url>
   <properties>
-      <maven.compiler.source>1.7</maven.compiler.source>
-      <maven.compiler.target>1.7</maven.compiler.target>
+      <maven.compiler.source>1.6</maven.compiler.source>
+      <maven.compiler.target>1.6</maven.compiler.target>
   </properties>
   <dependencies>
     <dependency>