svn commit: rev 21178 - in avalon/trunk/tools/project/src/main/org/apache/avalon/tools: project tasks

[email protected]
Newsgroups gmane.comp.jakarta.avalon.cvs
Message-ID <[email protected]>
Author: mcconnell
Date: Sun Jun 13 17:28:12 2004
New Revision: 21178

Modified:
   avalon/trunk/tools/project/src/main/org/apache/avalon/tools/project/Definition.java
   avalon/trunk/tools/project/src/main/org/apache/avalon/tools/project/ResourceRef.java
   avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java
Log:
updates to correct some issues concering cascading path creation

Modified: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/project/Definition.java
==============================================================================
--- avalon/trunk/tools/project/src/main/org/apache/avalon/tools/project/Definition.java	(original)
+++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/project/Definition.java	Sun Jun 13 17:28:12 2004
@@ -63,7 +63,6 @@
     public ResourceRef[] getResourceRefs( int mode, int tag, boolean flag )
     {
         ArrayList list = new ArrayList();
-//System.out.println( "#THIS " + this + ", mode: " + mode + ", tag: " + tag );
         getResourceRefs( list, mode, tag, flag );
         return (ResourceRef[]) list.toArray( new ResourceRef[0] );
     }
@@ -76,7 +75,6 @@
             ResourceRef ref = refs[i];
             if( !list.contains( ref ) )
             {
-//System.out.println( "#REF: " + ref + ", " + ref.getPolicy().matches( mode ) + ", " + ref.matches( tag ) );
                 Policy policy = ref.getPolicy();
                 if( policy.matches( mode ) && ref.matches( tag ) )
                 {
@@ -84,7 +82,7 @@
                     if( flag && getHome().isaDefinition( ref ) )
                     {
                         Definition def = getHome().getDefinition( ref );
-                        def.getResourceRefs( list, mode, tag, flag );
+                        def.getResourceRefs( list, mode, ResourceRef.ANY, flag );
                     }
                 }
             }

Modified: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/project/ResourceRef.java
==============================================================================
--- avalon/trunk/tools/project/src/main/org/apache/avalon/tools/project/ResourceRef.java	(original)
+++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/project/ResourceRef.java	Sun Jun 13 17:28:12 2004
@@ -50,7 +50,7 @@
         }
         else
         {
-            return ANY;
+            return IMPL;
         }
     }
 

Modified: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java
==============================================================================
--- avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java	(original)
+++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java	Sun Jun 13 17:28:12 2004
@@ -132,16 +132,13 @@
             classpath.createPathElement().setLocation( jar );
             compile( src, classes, classpath );
             copyCompileResource( src, classes );
-            classpath.createPathElement().setLocation( classes );
 
             //
-            // setup test resources
+            // add the test classes to the test classpath
             //
 
-            File temp = new File( m_test, "temp" );
-            mkDir( temp );
-            copyUnitTestResource( temp );
-            test( src, classpath, temp );
+            classpath.createPathElement().setLocation( classes );
+            test( src, classpath );
         }
 
         String error = project.getProperty( ERROR_KEY );
@@ -229,9 +226,12 @@
         javac.execute();
     }
 
-    private void test( File src, Path classpath, File base )
+    private void test( File src, Path classpath )
     {
         Project project = getProject();
+
+        File base = new File( m_test, "temp" );
+        copyUnitTestResource( base );
 
         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.