You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kr...@apache.org on 2013/04/13 21:59:36 UTC

git commit: o Merged test and provider classloader for in-proc launching

Updated Branches:
  refs/heads/master ff9db665a -> 5c8b40256


o Merged test and provider classloader for in-proc launching


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

Branch: refs/heads/master
Commit: 5c8b402569c236f401a3f881ed6bc9fc3562a509
Parents: ff9db66
Author: Kristian Rosenvold <kr...@apache.org>
Authored: Sat Apr 13 21:59:27 2013 +0200
Committer: Kristian Rosenvold <kr...@apache.org>
Committed: Sat Apr 13 21:59:27 2013 +0200

----------------------------------------------------------------------
 .../plugin/surefire/InPluginVMSurefireStarter.java |    6 +++---
 .../surefire/booter/ClasspathConfiguration.java    |    7 +++++++
 .../apache/maven/surefire/booter/ForkedBooter.java |    1 +
 .../maven/surefire/booter/ProviderFactory.java     |    1 +
 4 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/5c8b4025/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/InPluginVMSurefireStarter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/InPluginVMSurefireStarter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/InPluginVMSurefireStarter.java
index 6a1a394..24456b2 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/InPluginVMSurefireStarter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/InPluginVMSurefireStarter.java
@@ -69,10 +69,10 @@ public class InPluginVMSurefireStarter
         scanResult.writeTo( providerProperties );
 
         startupConfiguration.writeSurefireTestClasspathProperty();
-        ClassLoader testsClassLoader = startupConfiguration.getClasspathConfiguration().createTestClassLoader();
+        ClassLoader testsClassLoader = startupConfiguration.getClasspathConfiguration().createMergedClassLoader();
 
-        ClassLoader surefireClassLoader =
-            startupConfiguration.getClasspathConfiguration().createInprocSurefireClassLoader( testsClassLoader );
+        // Todo: Remove distinction "surefireClassLoader" and "testClassloader" through the rest of the cod
+        ClassLoader surefireClassLoader =   testsClassLoader;
 
         CommonReflector surefireReflector = new CommonReflector( surefireClassLoader );
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/5c8b4025/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClasspathConfiguration.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClasspathConfiguration.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClasspathConfiguration.java
index de936a9..2df6e46 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClasspathConfiguration.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ClasspathConfiguration.java
@@ -90,6 +90,13 @@ public class ClasspathConfiguration
         return classpathUrls.createClassLoader( null, childDelegation, enableAssertions, "test" );
     }
 
+    public ClassLoader createMergedClassLoader()
+        throws SurefireExecutionException
+    {
+        return Classpath.join( inprocClasspath, classpathUrls)
+            .createClassLoader( null, this.childDelegation, enableAssertions, "test" );
+    }
+
     public ClassLoader createTestClassLoader()
         throws SurefireExecutionException
     {

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/5c8b4025/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
index ea0ddb1..febc53a 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
@@ -214,6 +214,7 @@ public class ForkedBooter
                                                                        ProviderConfiguration providerConfiguration,
                                                                        Object reporterManagerFactory1 )
     {
+
         BaseProviderFactory bpf = new BaseProviderFactory( (ReporterFactory) reporterManagerFactory1, isInsideFork );
         bpf.setTestRequest( providerConfiguration.getTestSuiteDefinition() );
         bpf.setReporterConfiguration( providerConfiguration.getReporterConfiguration() );

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/5c8b4025/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
index d729066..cb95f4e 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
@@ -104,6 +104,7 @@ public class ProviderFactory
 
         StartupConfiguration starterConfiguration = startupConfiguration;
 
+        // Note: Duplicated in ForkedBooter#createProviderInCurrentClassloader
         final Object o =
             surefireReflector.createBooterConfiguration( surefireClassLoader, reporterManagerFactory, isInsideFork );
         surefireReflector.setTestSuiteDefinitionAware( o, providerConfiguration.getTestSuiteDefinition() );