FileDocCategorySizeDatePackage
HeadTailTest.javaAPI DocApache Ant 1.706423Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.filters

HeadTailTest

public class HeadTailTest extends org.apache.tools.ant.BuildFileTest
JUnit Testcases for TailFilter and HeadFilter

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

    
       
        super(name);
    
Methods Summary
public voidsetUp()

        configureProject("src/etc/testcases/filters/head-tail.xml");
    
public voidtearDown()

        executeTarget("cleanup");
    
public voidtestFilterReaderHeadLinesSkip()

        executeTarget("testFilterReaderHeadLinesSkip");
        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),
            "expected/head-tail.headLinesSkip.test");
        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),
            "result/head-tail.filterReaderHeadLinesSkip.test");
        assertTrue("testFilterReaderHeadLinesSkip: Result not like expected",
                   FILE_UTILS.contentEquals(expected, result));
    
public voidtestFilterReaderTailLinesSkip()

        executeTarget("testFilterReaderTailLinesSkip");
        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),
            "expected/head-tail.tailLinesSkip.test");
        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),
            "result/head-tail.filterReaderTailLinesSkip.test");
        assertTrue("testFilterReaderTailLinesSkip: Result not like expected",
                   FILE_UTILS.contentEquals(expected, result));
    
public voidtestHead()

        executeTarget("testHead");
        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(), "expected/head-tail.head.test");
        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(), "result/head-tail.head.test");
        assertTrue("testHead: Result not like expected", FILE_UTILS.contentEquals(expected, result));
    
public voidtestHeadLines()

        executeTarget("testHeadLines");
        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(), "expected/head-tail.headLines.test");
        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(), "result/head-tail.headLines.test");
        assertTrue("testHeadLines: Result not like expected", FILE_UTILS.contentEquals(expected, result));
    
public voidtestHeadLinesSkip()

        executeTarget("testHeadLinesSkip");
        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.headLinesSkip.test");
        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.headLinesSkip.test");
        assertTrue("testHeadLinesSkip: Result not like expected", FILE_UTILS.contentEquals(expected, result));
    
public voidtestHeadSkip()

        executeTarget("testHeadSkip");
        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.headSkip.test");
        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.headSkip.test");
        assertTrue("testHeadSkip: Result not like expected", FILE_UTILS.contentEquals(expected, result));
    
public voidtestHeadTail()

        executeTarget("testHeadTail");
        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.headtail.test");
        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.headtail.test");
        assertTrue("testHeadTail: Result not like expected", FILE_UTILS.contentEquals(expected, result));
    
public voidtestTail()

        executeTarget("testTail");
        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.tail.test");
        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.tail.test");
        assertTrue("testTail: Result not like expected", FILE_UTILS.contentEquals(expected, result));
    
public voidtestTailLines()

        executeTarget("testTailLines");
        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.tailLines.test");
        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.tailLines.test");
        assertTrue("testTailLines: Result not like expected", FILE_UTILS.contentEquals(expected, result));
    
public voidtestTailLinesSkip()

        executeTarget("testTailLinesSkip");
        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.tailLinesSkip.test");
        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.tailLinesSkip.test");
        assertTrue("testTailLinesSkip: Result not like expected", FILE_UTILS.contentEquals(expected, result));
    
public voidtestTailSkip()

        executeTarget("testTailSkip");
        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.tailSkip.test");
        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.tailSkip.test");
        assertTrue("testTailSkip: Result not like expected", FILE_UTILS.contentEquals(expected, result));