You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2004/06/30 15:16:21 UTC

svn commit: rev 22322 - avalon/trunk/runtime/merlin/unit/src/java/org/apache/avalon/merlin/unit

Author: mcconnell
Date: Wed Jun 30 06:16:20 2004
New Revision: 22322

Modified:
   avalon/trunk/runtime/merlin/unit/src/java/org/apache/avalon/merlin/unit/AbstractMerlinTestCase.java
Log:
Upgrade handling of block implicit references - was using relative paths which break on reactor builds.

Modified: avalon/trunk/runtime/merlin/unit/src/java/org/apache/avalon/merlin/unit/AbstractMerlinTestCase.java
==============================================================================
--- avalon/trunk/runtime/merlin/unit/src/java/org/apache/avalon/merlin/unit/AbstractMerlinTestCase.java	(original)
+++ avalon/trunk/runtime/merlin/unit/src/java/org/apache/avalon/merlin/unit/AbstractMerlinTestCase.java	Wed Jun 30 06:16:20 2004
@@ -55,7 +55,7 @@
     private static final String DEPLOYMENT_MODEL_CLASSNAME = 
       "org.apache.avalon.composition.model.DeploymentModel";
 
-    private static File getWorkDirectory()
+    public static File getWorkDirectory()
     {
         String path = System.getProperty( "project.dir" );
         if( null != path )
@@ -68,7 +68,7 @@
         }
     }
 
-    private static File getBaseDirectory()
+    public static File getBaseDirectory()
     {
         String path = System.getProperty( "basedir" );
         if( null != path )
@@ -81,17 +81,28 @@
         }
     }
 
+    public static File getTargetDirectory()
+    {
+        return new File( getBaseDirectory(), "target" );
+    }
+
+    public static File getClassesDirectory()
+    {
+        return new File( getTargetDirectory(), "classes" );
+    }
+
+    private static File getTestClassesDirectory()
+    {
+        return new File( getTargetDirectory(), "test-classes" );
+    }
 
     //----------------------------------------------------------
     // immutable state
     //----------------------------------------------------------
 
     private Object m_kernel;
-
     private ClassLoader m_classloader;
-
     private Object m_root;
-
     private Method m_locate;
     private Method m_runtime;
     private Method m_resolve;
@@ -280,26 +291,27 @@
     private String buildDefaultTestPath()
     {
         File base = getBaseDirectory();
-        File classes = new File( base, "target/classes/BLOCK-INF/block.xml" );
-        File tests = new File( base, "target/test-classes/BLOCK-INF/block.xml" );
+        File classes = new File( getClassesDirectory(), "BLOCK-INF/block.xml" );
+        File tests = new File( getTestClassesDirectory(), "BLOCK-INF/block.xml" );
         if( classes.exists() && tests.exists() )
         {
-            return "target/classes,target/test-classes";
+            return getClassesDirectory().toString() 
+               + "," + getTestClassesDirectory().toString();
         }
         else if( classes.exists() )
         {
-            return "target/classes";
+            return getClassesDirectory().toString();
         }
         else if( tests.exists() )
         {
-            return "target/test-classes";
+            return getTestClassesDirectory().toString();
         }
         else
         {
             return null;
         }
-    }
-
+    }
+
     private File getHomeDirectory()
     {
         return getCacheDirectory().getParentFile();

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org