maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r356193 - /maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/SurefireBooter.java
Date Mon, 12 Dec 2005 07:18:23 GMT
Author: jvanzyl
Date: Sun Dec 11 23:18:22 2005
New Revision: 356193

URL: http://svn.apache.org/viewcvs?rev=356193&view=rev
Log: (empty)

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=356193&r1=356192&r2=356193&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
Sun Dec 11 23:18:22 2005
@@ -64,7 +64,7 @@
 
     private String forkMode;
 
-    private static String basedir;
+    private String basedir;
 
     private String jvm;
 
@@ -162,6 +162,11 @@
         this.argLine = argLine;
     }
 
+    public void setBasedir( String basedir )
+    {
+        this.basedir = basedir;
+    }
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -266,12 +271,8 @@
     private boolean fork()
         throws Exception
     {
-        File workingDirectory = new File( "." );
-
         Commandline cli = new Commandline();
 
-        basedir = workingDirectory.getAbsolutePath();
-
         cli.setWorkingDirectory( basedir );
 
         cli.setExecutable( jvm );
@@ -517,7 +518,7 @@
     //
     // ----------------------------------------------------------------------
 
-    private static Properties loadProperties( String file )
+    private static Properties loadProperties( String basedir, String file )
         throws Exception
     {
         File f = new File( basedir, file );
@@ -536,16 +537,16 @@
         return p;
     }
 
-    private static Properties getSurefireProperties()
+    private static Properties getSurefireProperties( String basedir )
         throws Exception
     {
-        return loadProperties( SUREFIRE_PROPERTIES );
+        return loadProperties( basedir, SUREFIRE_PROPERTIES );
     }
 
-    private static void  setSystemProperties()
+    private static void  setSystemProperties( String basedir )
         throws Exception
     {
-        Properties p = loadProperties( SYSTEM_PROPERTIES );
+        Properties p = loadProperties( basedir, SYSTEM_PROPERTIES );
 
         for ( Iterator i = p.keySet().iterator(); i.hasNext(); )
         {
@@ -555,10 +556,10 @@
         }
     }
 
-    private static ClassLoader createForkingClassLoader()
+    private static ClassLoader createForkingClassLoader( String basedir )
         throws Exception
     {
-        Properties p = loadProperties( CLASSLOADER_PROPERTIES );
+        Properties p = loadProperties( basedir, CLASSLOADER_PROPERTIES );
 
         IsolatedClassLoader classLoader = new IsolatedClassLoader( ClassLoader.getSystemClassLoader()
);
 
@@ -583,11 +584,13 @@
     public static void main( String[] args )
         throws Exception
     {
-        ClassLoader classLoader = createForkingClassLoader();
+        String basedir = args[0];
+
+        ClassLoader classLoader = createForkingClassLoader( basedir );
 
-        setSystemProperties();
+        setSystemProperties( basedir );
 
-        Properties p = getSurefireProperties();
+        Properties p = getSurefireProperties( basedir );
 
         String batteryExecutorName = p.getProperty( "batteryExecutorName" );
 



Mime
View raw message