svn commit: rev 22455 - avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks

[email protected]
Newsgroups gmane.comp.jakarta.avalon.cvs
Message-ID <[email protected]>
Author: mcconnell
Date: Fri Jul  2 01:01:38 2004
New Revision: 22455

Modified:
   avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java
Log:
Update to ensure that we copy unit test resources before doing the test to see if unit tests exist.  This is to deal with builds that override the test target but still need the target/test directory setup and populated.

Modified: avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java
==============================================================================
--- avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java	(original)
+++ avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java	Fri Jul  2 01:01:38 2004
@@ -101,6 +101,9 @@
         final String testPath = project.getProperty( TEST_SRC_KEY );
         final File src = new File( build, testPath );
 
+        final File working = getContext().getTestDirectory();
+        copyUnitTestResource( working );
+
         if( src.exists() )
         {
             final File classes = getContext().getTestClassesDirectory();
@@ -125,7 +128,7 @@
             //
 
             classpath.createPathElement().setLocation( classes );
-            test( src, classpath );
+            test( src, classpath, working );
         }
 
         final String error = project.getProperty( ERROR_KEY );
@@ -212,13 +215,9 @@
         javac.execute();
     }
 
-    private void test( final File src, final Path classpath )
+    private void test( final File src, final Path classpath, File working )
     {
         final Project project = getProject();
-
-        final File working = getContext().getTestDirectory();
-        mkDir( working );
-        copyUnitTestResource( working );
 
         final FileSet fileset = new FileSet();
         fileset.setDir( src );
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.