Search in sources :

Example 1 with PropertyFileInputHandler

use of org.apache.tools.ant.input.PropertyFileInputHandler in project ant by apache.

the class InputTest method setUp.

@Before
public void setUp() {
    buildRule.configureProject("src/etc/testcases/taskdefs/input.xml");
    System.getProperties().put(PropertyFileInputHandler.FILE_NAME_KEY, buildRule.getProject().resolveFile("input.properties").getAbsolutePath());
    buildRule.getProject().setInputHandler(new PropertyFileInputHandler());
    originalStdIn = System.in;
}
Also used : PropertyFileInputHandler(org.apache.tools.ant.input.PropertyFileInputHandler) Before(org.junit.Before)

Example 2 with PropertyFileInputHandler

use of org.apache.tools.ant.input.PropertyFileInputHandler in project ant by apache.

the class AntTest method testInputHandlerInheritance.

@Test
public void testInputHandlerInheritance() {
    InputHandler ih = new PropertyFileInputHandler();
    buildRule.getProject().setInputHandler(ih);
    InputHandlerChecker ic = new InputHandlerChecker(ih);
    buildRule.getProject().addBuildListener(ic);
    buildRule.executeTarget("tripleCall");
    AssertionFailedError ae = ic.getError();
    if (ae != null) {
        throw ae;
    }
    buildRule.getProject().removeBuildListener(ic);
}
Also used : InputHandler(org.apache.tools.ant.input.InputHandler) PropertyFileInputHandler(org.apache.tools.ant.input.PropertyFileInputHandler) PropertyFileInputHandler(org.apache.tools.ant.input.PropertyFileInputHandler) AssertionFailedError(junit.framework.AssertionFailedError) Test(org.junit.Test)

Example 3 with PropertyFileInputHandler

use of org.apache.tools.ant.input.PropertyFileInputHandler in project ant by apache.

the class ProjectTest method testInputHandler.

@Test
public void testInputHandler() {
    InputHandler ih = p.getInputHandler();
    assertNotNull(ih);
    assertTrue(ih instanceof DefaultInputHandler);
    InputHandler pfih = new PropertyFileInputHandler();
    p.setInputHandler(pfih);
    assertSame(pfih, p.getInputHandler());
}
Also used : InputHandler(org.apache.tools.ant.input.InputHandler) PropertyFileInputHandler(org.apache.tools.ant.input.PropertyFileInputHandler) DefaultInputHandler(org.apache.tools.ant.input.DefaultInputHandler) PropertyFileInputHandler(org.apache.tools.ant.input.PropertyFileInputHandler) DefaultInputHandler(org.apache.tools.ant.input.DefaultInputHandler) Test(org.junit.Test)

Aggregations

PropertyFileInputHandler (org.apache.tools.ant.input.PropertyFileInputHandler)3 InputHandler (org.apache.tools.ant.input.InputHandler)2 Test (org.junit.Test)2 AssertionFailedError (junit.framework.AssertionFailedError)1 DefaultInputHandler (org.apache.tools.ant.input.DefaultInputHandler)1 Before (org.junit.Before)1