FileDocCategorySizeDatePackage
FixCrLfTest.javaAPI DocApache Ant 1.705759Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.taskdefs

FixCrLfTest

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

Fields Summary
Constructors Summary
public FixCrLfTest(String name)

        super(name);
    
Methods Summary
public voidassertEqualContent(java.io.File expect, java.io.File result)

        if (!result.exists()) {
            fail("Expected file "+result+" doesn\'t exist");
        }

        InputStream inExpect = null;
        InputStream inResult = null;
        try {
            inExpect = new BufferedInputStream(new FileInputStream(expect));
            inResult = new BufferedInputStream(new FileInputStream(result));

            int expectedByte = inExpect.read();
            while (expectedByte != -1) {
                assertEquals(expectedByte, inResult.read());
                expectedByte = inExpect.read();
            }
            assertEquals("End of file", -1, inResult.read());
        } finally {
            if (inResult != null) {
                inResult.close();
            }
            if (inExpect != null) {
                inExpect.close();
            }
        }
    
public voidsetUp()

        configureProject("src/etc/testcases/taskdefs/fixcrlf/build.xml");
    
public voidtearDown()

        executeTarget("cleanup");
    
public voidtest1()

        executeTarget("test1");
    
public voidtest2()

        executeTarget("test2");
    
public voidtest3()

        executeTarget("test3");
    
public voidtest4()

        executeTarget("test4");
    
public voidtest5()

        executeTarget("test5");
    
public voidtest6()

        executeTarget("test6");
    
public voidtest7()

        executeTarget("test7");
    
public voidtest8()

        executeTarget("test8");
    
public voidtest9()

        executeTarget("test9");
    
public voidtestCannotDoubleEof()

        executeTarget("testCannotDoubleEof");
    
public voidtestCrCrLfSequenceDos()

        executeTarget("testCrCrLfSequence-dos");
    
public voidtestCrCrLfSequenceMac()

        executeTarget("testCrCrLfSequence-mac");
    
public voidtestCrCrLfSequenceUnix()

        executeTarget("testCrCrLfSequence-unix");
    
public voidtestCreateParentDirs()
Bugzilla Report 20840 Will fail with an exception if the parent directories do not get created.

        executeTarget("createParentDirs");
    
public voidtestEncoding()

        executeTarget("testEncoding");
    
public voidtestFilter1()

        executeTarget("testFilter1");
    
public voidtestFilter2()

        executeTarget("testFilter2");
    
public voidtestFilter3()

        executeTarget("testFilter3");
    
public voidtestFilter4()

        executeTarget("testFilter4");
    
public voidtestFilter5()

        executeTarget("testFilter5");
    
public voidtestFilter6()

        executeTarget("testFilter6");
    
public voidtestFilter7()

        executeTarget("testFilter7");
    
public voidtestFilter8()

        executeTarget("testFilter8");
    
public voidtestFilter9()

        executeTarget("testFilter9");
    
public voidtestFixFile()

        executeTarget("testFixFile");
    
public voidtestFixFileExclusive()

        expectBuildExceptionContaining("testFixFileExclusive",
                FixCRLF.ERROR_FILE_AND_SRCDIR, FixCRLF.ERROR_FILE_AND_SRCDIR);
    
public voidtestFixlastDos()

        executeTarget("testFixlastDos");
    
public voidtestFixlastFalseMac()

        executeTarget("testFixlastFalseMac");
    
public voidtestLongLines()

        executeTarget("testLongLines");
    
public voidtestMacLines()

        executeTarget("testMacLines");
    
public voidtestNoOverwrite()

        executeTarget("testNoOverwrite");
    
public voidtestOutputEncoding()

        executeTarget("testOutputEncoding");
    
public voidtestPreserveLastModified()

        executeTarget("testPreserveLastModified");
    
public voidtestTabInLiteralInComment()

        executeTarget("testTabInLiteralInComment");