maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r365709 - /maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/SurefireBooter.java
Date Tue, 03 Jan 2006 18:49:25 GMT
Author: jvanzyl
Date: Tue Jan  3 10:49:23 2006
New Revision: 365709

URL: http://svn.apache.org/viewcvs?rev=365709&view=rev
Log:
      PR: SUREFIRE-27
     URL: http://jira.codehaus.org/browse/SUREFIRE-27
 Summary: classloader stuct should be dumped if -X is passed to maven
Reporter: Hiram Chirino


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

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/SurefireBooter.java
URL: http://svn.apache.org/viewcvs/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/SurefireBooter.java?rev=365709&r1=365708&r2=365709&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/SurefireBooter.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/SurefireBooter.java
Tue Jan  3 10:49:23 2006
@@ -369,6 +369,10 @@
             throw new SurefireBooterForkException( "Error while executing forked tests.",
e );
         }
 
+        /*
+
+        The standard reporting modules should do this work ... jvz
+        
         String string = stringWriter.toString();
 
         if ( string != null && string.length() > 0 )
@@ -382,6 +386,7 @@
                 System.out.println( string );
             }
         }
+        */
 
         if ( returnCode != 0 )
         {
@@ -492,6 +497,8 @@
 
         p.setProperty( "batteryConfig", batteryConfig );
 
+        p.setProperty( "debug", "" + debug );
+
         fos = new FileOutputStream( new File( basedir, SUREFIRE_PROPERTIES ) );
 
         p.store( fos, "surefire properties" );
@@ -620,8 +627,6 @@
 
         ClassLoader classLoader = createForkingClassLoader( basedir );
 
-        // Dumps the classloader stuff
-        //logClassLoader(classLoader);
 
         Thread.currentThread().setContextClassLoader( classLoader );
 
@@ -629,6 +634,12 @@
 
         Properties p = getSurefireProperties( basedir );
 
+        boolean debug = "true".equals( p.getProperty( "debug", "false" ) );
+        if ( debug )
+        {
+            logClassLoader( classLoader );
+        }
+
         String batteryExecutorName = p.getProperty( "batteryExecutorName" );
 
         Class batteryExecutorClass = classLoader.loadClass( batteryExecutorName );
@@ -740,12 +751,18 @@
     private static void logClassLoader( ClassLoader classLoader )
     {
         if ( classLoader.getParent() != null )
+        {
             logClassLoader( classLoader.getParent() );
+        }
+
         if ( classLoader instanceof URLClassLoader )
         {
             System.out.println( "ClassLoader: type" + classLoader.getClass() + ", value="
+ classLoader );
+
             URLClassLoader ucl = (URLClassLoader) classLoader;
+
             URL[] u = ucl.getURLs();
+
             for ( int i = 0; i < u.length; i++ )
             {
                 System.out.println( "           : " + u[i] );
@@ -756,6 +773,5 @@
             System.out.println( "ClassLoader: type" + classLoader.getClass() + ", value="
+ classLoader );
         }
     }
-
 }
 



Mime
View raw message