ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant ProjectTest.java
Date Tue, 23 Apr 2002 07:27:20 GMT
bodewig     02/04/23 00:27:20

  Modified:    src/main/org/apache/tools/ant Project.java
               src/testcases/org/apache/tools/ant ProjectTest.java
  Log:
  Make live easier for projects that subclass Project by setting the
  input handler to a default value.
  
  Revision  Changes    Path
  1.106     +4 -2      jakarta-ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- Project.java	22 Apr 2002 11:55:21 -0000	1.105
  +++ Project.java	23 Apr 2002 07:27:20 -0000	1.106
  @@ -69,6 +69,7 @@
   import org.apache.tools.ant.types.FilterSetCollection; 
   import org.apache.tools.ant.util.FileUtils; 
   import org.apache.tools.ant.util.JavaEnvUtils;
  +import org.apache.tools.ant.input.DefaultInputHandler;
   import org.apache.tools.ant.input.InputHandler;
   
   /**
  @@ -83,7 +84,7 @@
    *
    * @author duncan@x180.com
    *
  - * @version $Revision: 1.105 $
  + * @version $Revision: 1.106 $
    */
   
   public class Project {
  @@ -209,6 +210,7 @@
        */
       public Project() {
           fileUtils = FileUtils.newFileUtils();
  +        inputHandler = new DefaultInputHandler();
       }
       
       /**
  @@ -1470,7 +1472,7 @@
        */
       public void setFileLastModified(File file, long time) 
            throws BuildException {
  -        if (JavaEnvUtils.getJavaVersion() == JavaEnvUtils.JAVA_1_1) {
  +        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
               log("Cannot change the modification time of " + file
                   + " in JDK 1.1", Project.MSG_WARN);
               return;
  
  
  
  1.12      +12 -0     jakarta-ant/src/testcases/org/apache/tools/ant/ProjectTest.java
  
  Index: ProjectTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/ProjectTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ProjectTest.java	24 Feb 2002 14:45:14 -0000	1.11
  +++ ProjectTest.java	23 Apr 2002 07:27:20 -0000	1.12
  @@ -54,6 +54,9 @@
   
   package org.apache.tools.ant;
   
  +import org.apache.tools.ant.input.DefaultInputHandler;
  +import org.apache.tools.ant.input.InputHandler;
  +import org.apache.tools.ant.input.PropertyFileInputHandler;
   import org.apache.tools.ant.types.*;
   
   import java.io.File;
  @@ -219,6 +222,15 @@
           assertEquals(DummyTaskWithNonVoidExecute.class, p.getTaskDefinitions().get("NonVoidExecute"));
       }
           
  +    public void testInputHandler() {
  +        InputHandler ih = p.getInputHandler();
  +        assertNotNull(ih);
  +        assertTrue(ih instanceof DefaultInputHandler);
  +        InputHandler pfih = new PropertyFileInputHandler();
  +        p.setInputHandler(pfih);
  +        assertSame(pfih, p.getInputHandler());
  +    }
  +
       private class DummyTaskPrivate extends Task {
           public DummyTaskPrivate() {}
           public void execute() {}
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message