Browse Source

Test chain of filters.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271727 13f79535-47bb-0310-9956-ffa450edef68
master
Magesh Umasankar 23 years ago
parent
commit
069a8898be
2 changed files with 39 additions and 4 deletions
  1. +25
    -0
      proposal/sandbox/filterreaders/src/etc/testcases/taskdefs/loadfile.xml
  2. +14
    -4
      proposal/sandbox/filterreaders/src/testcases/org/apache/tools/ant/taskdefs/LoadFileTest.java

+ 25
- 0
proposal/sandbox/filterreaders/src/etc/testcases/taskdefs/loadfile.xml View File

@@ -61,6 +61,31 @@
<echo>${testEvalProps}</echo> <echo>${testEvalProps}</echo>
</target> </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" <target name="testOneLine"
depends="init"> depends="init">


+ 14
- 4
proposal/sandbox/filterreaders/src/testcases/org/apache/tools/ant/taskdefs/LoadFileTest.java View File

@@ -151,7 +151,7 @@ public class LoadFileTest extends BuildFileTest {
} }
} }


/**
/**
* A unit test for JUnit * A unit test for JUnit
*/ */
public void testEvalProps() public void testEvalProps()
@@ -162,7 +162,19 @@ public class LoadFileTest extends BuildFileTest {
} }
} }


/**
/**
* 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 * A unit test for JUnit
*/ */
public void testOneLine() public void testOneLine()
@@ -171,5 +183,3 @@ public class LoadFileTest extends BuildFileTest {


} }
} }



Loading…
Cancel
Save