maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dfabul...@apache.org
Subject svn commit: r597815 - /maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
Date Sat, 24 Nov 2007 06:20:53 GMT
Author: dfabulich
Date: Fri Nov 23 22:20:52 2007
New Revision: 597815

URL: http://svn.apache.org/viewvc?rev=597815&view=rev
Log:
[SUREFIRE-164] "wrong" classpath appears in <properties> at top of XML report.  Adding
a surefire.test.class.path property that includes exactly the URLs we want.  Adding URLs back
into the property file for useSystemClassLoader.

Modified:
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java?rev=597815&r1=597814&r2=597815&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java
Fri Nov 23 22:20:52 2007
@@ -301,6 +301,8 @@
             ClassLoader testsClassLoader = useSystemClassLoader() ? getClass().getClassLoader()
// ClassLoader.getSystemClassLoader()
                             : createClassLoader( classPathUrls, null, childDelegation );
 
+            recordTestClassPath();
+            
             ClassLoader surefireClassLoader = createClassLoader( surefireClassPathUrls, testsClassLoader
);
 
             Class surefireClass = surefireClassLoader.loadClass( Surefire.class.getName()
);
@@ -333,6 +335,17 @@
         }
     }
 
+    
+    
+    private void recordTestClassPath()
+    {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < classPathUrls.size(); i++) {
+            sb.append( classPathUrls.get( i ) ).append( File.pathSeparatorChar );
+        }
+        System.setProperty( "surefire.test.class.path", sb.toString() );
+    }
+    
     private boolean runSuitesForkOnce()
         throws SurefireBooterForkException
     {
@@ -455,7 +468,7 @@
         addPropertiesForTypeHolder( reports, properties, REPORT_PROPERTY_PREFIX );
         addPropertiesForTypeHolder( testSuites, properties, TEST_SUITE_PROPERTY_PREFIX );
 
-        for ( int i = 0; i < classPathUrls.size() && !useSystemClassLoader();
i++ )
+        for ( int i = 0; i < classPathUrls.size(); i++ )
         {
             String url = (String) classPathUrls.get( i );
             properties.setProperty( "classPathUrl." + i, url );



Mime
View raw message