FileDocCategorySizeDatePackage
LoadFileTest.javaAPI DocApache Ant 1.704048Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.taskdefs

LoadFileTest

public class LoadFileTest extends org.apache.tools.ant.BuildFileTest
Test the load file task
created
10 December 2001

Fields Summary
Constructors Summary
public LoadFileTest(String name)
Constructor for the LoadFileTest object

param
name Description of Parameter

        super(name);
    
Methods Summary
public voidsetUp()
The JUnit setup method

        configureProject("src/etc/testcases/taskdefs/loadfile.xml");
    
public voidtearDown()
The teardown method for JUnit

        executeTarget("cleanup");
    
public voidtestEvalProps()
A unit test for JUnit

        executeTarget("testEvalProps");
        if(project.getProperty("testEvalProps").indexOf("rain")<0) {
            fail("property eval broken");
        }
    
public voidtestFailOnError()
A unit test for JUnit

        expectPropertyUnset("testFailOnError","testFailOnError");
    
public voidtestFilterChain()
Test FilterChain and FilterReaders

        executeTarget("testFilterChain");
        if(project.getProperty("testFilterChain").indexOf("World!")<0) {
            fail("Filter Chain broken");
        }
    
public voidtestLoadAFile()
A unit test for JUnit

        executeTarget("testLoadAFile");
        if(project.getProperty("testLoadAFile").indexOf("eh?")<0) {
            fail("property is not all in the file");
        }
    
public voidtestLoadAFileEnc()
A unit test for JUnit

        executeTarget("testLoadAFileEnc");
        if(project.getProperty("testLoadAFileEnc")==null) {
            fail("file load failed");
        }
    
public voidtestNoPropertyDefined()
A unit test for JUnit

        expectBuildException("testNoPropertyDefined",
                "output property not defined");
    
public voidtestNoSourcefileDefined()
A unit test for JUnit

        expectBuildException("testNoSourcefileDefined",
                "source file not defined");
    
public voidtestNoSourcefilefound()
A unit test for JUnit

        expectBuildExceptionContaining("testNoSourcefilefound",
                "File not found", " doesn't exist");
    
public voidtestOneLine()
A unit test for JUnit

            expectPropertySet("testOneLine","testOneLine","1,2,3,4");

    
public final voidtestStripJavaComments()
Test StripJavaComments filterreader functionality.

        executeTarget("testStripJavaComments");
        final String expected = project.getProperty("expected");
        final String generated = project.getProperty("testStripJavaComments");
        assertEquals(expected, generated);