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

InputTest

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

Fields Summary
Constructors Summary
public InputTest(String name)

        super(name);
    
Methods Summary
private java.lang.StringgetKey(java.lang.String key)

        return key; // XXX what is this for?
    
public voidsetUp()

        configureProject("src/etc/testcases/taskdefs/input.xml");
        System.getProperties()
            .put(PropertyFileInputHandler.FILE_NAME_KEY,
                 getProject().resolveFile("input.properties")
                 .getAbsolutePath());
        getProject().setInputHandler(new PropertyFileInputHandler());
    
private voidstdin()

        try {
            System.setIn(new FileInputStream(
                getProject().resolveFile("input.stdin")));
        } catch (Exception e) {
            throw e instanceof RuntimeException
                ? (RuntimeException) e : new RuntimeException(e.getMessage());
        }
    
public voidtest1()

        executeTarget("test1");
    
public voidtest2()

        executeTarget("test2");
    
public voidtest3()

        expectSpecificBuildException("test3", "invalid input",
                                     "Found invalid input test for \'"
                                     + getKey("All data is"
                                              + " going to be deleted from DB"
                                              + " continue?")
                                     + "\'");
    
public voidtest5()

        executeTarget("test5");
    
public voidtest6()

        executeTarget("test6");
        assertEquals("scott", project.getProperty("db.user"));
    
public voidtestDefaultInlineHandler()

        stdin();
        executeTarget("testDefaultInlineHandler");
    
public voidtestGreedyInlineHandler()

        stdin();
        executeTarget("testGreedyInlineHandler");
    
public voidtestGreedyInlineHandlerClassname()

        stdin();
        executeTarget("testGreedyInlineHandlerClassname");
    
public voidtestGreedyInlineHandlerRefid()

        stdin();
        executeTarget("testGreedyInlineHandlerRefid");
    
public voidtestPropertyFileInlineHandler()

        executeTarget("testPropertyFileInlineHandler");