ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From umag...@apache.org
Subject cvs commit: jakarta-ant/proposal/sandbox/filterreaders/src/testcases/org/apache/tools/ant/taskdefs LoadFileTest.java
Date Tue, 05 Mar 2002 00:21:28 GMT
umagesh     02/03/04 16:21:28

  Modified:    proposal/sandbox/filterreaders/src/etc/testcases/taskdefs
                        loadfile.xml
               proposal/sandbox/filterreaders/src/testcases/org/apache/tools/ant/taskdefs
                        LoadFileTest.java
  Log:
  Test chain of filters.
  
  Revision  Changes    Path
  1.3       +25 -0     jakarta-ant/proposal/sandbox/filterreaders/src/etc/testcases/taskdefs/loadfile.xml
  
  Index: loadfile.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/filterreaders/src/etc/testcases/taskdefs/loadfile.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- loadfile.xml	4 Mar 2002 20:48:17 -0000	1.2
  +++ loadfile.xml	5 Mar 2002 00:21:28 -0000	1.3
  @@ -61,6 +61,31 @@
       <echo>${testEvalProps}</echo>
     </target>
   
  +  <target name="testFilterChain"
  +    depends="init">
  +      <echo file="loadfile1.tmp">#Line 1
  +REM Line 2
  +--Line 3
  +Line 4
  +Hello World!</echo>
  +      <loadfile srcFile="loadfile1.tmp" 
  +        property="testFilterChain">
  +        <filterchain>
  +          <headfilter lines="5"/>
  +          <striplinecomments>
  +            <comment value="--"/>
  +            <comment value="REM "/>
  +            <comment value="#"/>
  +          </striplinecomments>
  +          <filterreader classname="org.apache.tools.ant.filters.TailFilter">
  +            <param name="lines" value="1"/>
  +          </filterreader>
  +          <linecontains>
  +            <contains value="World!"/>
  +          </linecontains>
  +        </filterchain>
  +      </loadfile>
  +  </target>
   
     <target name="testOneLine"
       depends="init">
  
  
  
  1.2       +14 -4     jakarta-ant/proposal/sandbox/filterreaders/src/testcases/org/apache/tools/ant/taskdefs/LoadFileTest.java
  
  Index: LoadFileTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/filterreaders/src/testcases/org/apache/tools/ant/taskdefs/LoadFileTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LoadFileTest.java	4 Mar 2002 01:07:41 -0000	1.1
  +++ LoadFileTest.java	5 Mar 2002 00:21:28 -0000	1.2
  @@ -151,7 +151,7 @@
           }
       }
   
  -        /**
  +    /**
        * A unit test for JUnit
        */
       public void testEvalProps()
  @@ -162,7 +162,19 @@
           }
       }
   
  -        /**
  +    /**
  +     * A unit test for JUnit
  +     */
  +    public void testFilterChain()
  +            throws BuildException {
  +        executeTarget("testFilterChain");
  +        if(project.getProperty("testFilterChain").indexOf("World!")<0) {
  +            fail("Filter Chain broken");
  +        }
  +    }
  +
  +
  +    /**
        * A unit test for JUnit
        */
       public void testOneLine()
  @@ -171,5 +183,3 @@
   
       }
   }
  -
  -
  
  
  

--
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