commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject cvs commit: jakarta-commons-sandbox/attributes/src/test/org/apache/commons/attributes AttributesTest.java
Date Fri, 23 May 2003 17:00:48 GMT
mvdb        2003/05/23 10:00:48

  Modified:    attributes/src/java/org/apache/commons/attributes/task
                        AttributesCompiler.java
               attributes/src/test/org/apache/commons/attributes
                        AttributesTest.java
  Log:
  Applied patch from dan Diephouse (dan at envoisolutions.com
  Basically this patch just makes AttributesCompiler extend MatchingTask so it has automatic
support for includes and excludes.
  
  Revision  Changes    Path
  1.4       +4 -6      jakarta-commons-sandbox/attributes/src/java/org/apache/commons/attributes/task/AttributesCompiler.java
  
  Index: AttributesCompiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/attributes/src/java/org/apache/commons/attributes/task/AttributesCompiler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AttributesCompiler.java	18 Dec 2002 19:00:39 -0000	1.3
  +++ AttributesCompiler.java	23 May 2003 17:00:48 -0000	1.4
  @@ -67,9 +67,9 @@
   import java.io.*;
   import java.util.Properties;
   
  -import org.apache.tools.ant.Task;
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.DirectoryScanner;
  +import org.apache.tools.ant.taskdefs.MatchingTask;
   
   /**
    * <p><code>AttributesCompilerOld</code> is an Ant Task which
  @@ -80,12 +80,12 @@
    * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
    * @version $Revision$
    */
  -public class AttributesCompiler extends Task {
  +public class AttributesCompiler extends MatchingTask {
   
   	private File src;
   	private File dest;
   	private AttributesBuilder builder = new AttributesBuilder();
  -
  +    
   	public void setSrc(File src) {
   		this.src = src;
   	}
  @@ -111,9 +111,7 @@
   	}
   
   	private String[] getJavaFiles() {
  -		DirectoryScanner scanner = new DirectoryScanner();
  -		scanner.setBasedir(src);
  -		scanner.setIncludes(new String[]{"**/*.java"});
  +        DirectoryScanner scanner = getDirectoryScanner(src);
   		scanner.scan();
   		return scanner.getIncludedFiles();
   	}
  
  
  
  1.4       +6 -2      jakarta-commons-sandbox/attributes/src/test/org/apache/commons/attributes/AttributesTest.java
  
  Index: AttributesTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/attributes/src/test/org/apache/commons/attributes/AttributesTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AttributesTest.java	18 Dec 2002 19:00:39 -0000	1.3
  +++ AttributesTest.java	23 May 2003 17:00:48 -0000	1.4
  @@ -75,6 +75,7 @@
   import org.apache.commons.attributes.impl.DefaultAttributeFinder;
   import org.apache.commons.attributes.task.AttributesCompiler;
   import org.apache.commons.attributes.task.TagSet;
  +import org.apache.tools.ant.Project;
   
   /**
    * Test case for using the Attributes facade with the default implementation.
  @@ -114,7 +115,7 @@
   		DefaultAttributeFinder.removeSearchPath(searchPath);
           Attributes.setAttributeFinder(null);
           
  -        Thread.sleep(20000);
  +        //Thread.sleep(20000);
   	}
   
       public static class TestAttributesLoader implements AttributeFinder {
  @@ -201,7 +202,10 @@
   	public void testAttributes()
   		throws IOException, NoSuchMethodException, NoSuchFieldException {
   		AttributesCompiler attributesCompiler = new AttributesCompiler();
  -		attributesCompiler.setSrc(new File("src" + File.separator + "test"));
  +        attributesCompiler.setSrc(new File("src" + File.separator + "test"));
  +        attributesCompiler.setIncludes("**/*.java");
  +        attributesCompiler.setExcludes("");
  +        attributesCompiler.setProject( new Project() );
   		attributesCompiler.setDest(targetDir);
   		attributesCompiler.execute();
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message