FileDocCategorySizeDatePackage
DynamicFilterTest.javaAPI DocApache Ant 1.703325Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.filters

DynamicFilterTest

public class DynamicFilterTest extends org.apache.tools.ant.BuildFileTest

Fields Summary
private static final org.apache.tools.ant.util.FileUtils
FILE_UTILS
Constructors Summary
public DynamicFilterTest(String name)

    
       
        super(name);
    
Methods Summary
private voidexpectFileContains(java.lang.String name, java.lang.String contains)

        String content = getFileString(name);
        assertTrue(
            "expecting file " + name + " to contain " + contains +
            " but got " + content, content.indexOf(contains) > -1);
    
private voidexpectFileContains(java.lang.String target, java.lang.String name, java.lang.String contains)

        executeTarget(target);
        expectFileContains(name, contains);
    
private java.lang.StringgetFileString(java.lang.String filename)

        Reader r = null;
        try {
            r = new FileReader(FILE_UTILS.resolveFile(getProject().getBaseDir(), filename));
            return  FileUtils.readFully(r);
        }
        finally {
            FileUtils.close(r);
        }

    
public voidsetUp()

        configureProject("src/etc/testcases/filters/dynamicfilter.xml");
        executeTarget("init");
    
public voidtearDown()

        executeTarget("cleanup");
    
public voidtestCustomFilter()

        expectFileContains("dynamicfilter", "result/dynamicfilter",
                           "hellO wOrld");