Methods Summary |
---|
public void | setUp()
configureProject("src/etc/testcases/taskdefs/ant.xml");
|
public void | tearDown()
executeTarget("cleanup");
|
public void | test1()
expectBuildException("test1", "recursive call");
|
public void | test2()
expectBuildException("test2", "required argument not specified");
|
public void | test3()
expectBuildException("test1", "recursive call");
|
public void | test4()
expectBuildException("test4", "target attribute must not be empty");
|
public void | test4b()
expectBuildException("test4b", "target doesn't exist");
|
public void | test5()
executeTarget("test5");
|
public void | test6()
executeTarget("test6");
|
protected void | testBaseDirs(java.lang.String target, java.lang.String[] dirs)
BasedirChecker bc = new BasedirChecker(dirs);
project.addBuildListener(bc);
executeTarget(target);
AssertionFailedError ae = bc.getError();
if (ae != null) {
throw ae;
}
project.removeBuildListener(bc);
|
public void | testBasedirTripleCall()
File dir1 = getProjectDir();
File dir2 = project.resolveFile("ant");
testBaseDirs("tripleCall",
new String[] {dir1.getAbsolutePath(),
dir2.getAbsolutePath(),
dir1.getAbsolutePath()
});
|
public void | testBlankTarget()
expectBuildException("blank-target", "target name must not be empty");
|
public void | testDoNotInheritBasedir()
File dir1 = getProjectDir();
File dir2 = project.resolveFile("ant");
String basedir = getProjectDir().getAbsolutePath();
testBaseDirs("doNotInheritBasedir",
new String[] {dir1.getAbsolutePath(),
dir2.getAbsolutePath()
});
|
public void | testExplicitBasedir1()
File dir1 = getProjectDir();
File dir2 = project.resolveFile("..");
testBaseDirs("explicitBasedir1",
new String[] {dir1.getAbsolutePath(),
dir2.getAbsolutePath()
});
|
public void | testExplicitBasedir2()
File dir1 = getProjectDir();
File dir2 = project.resolveFile("..");
testBaseDirs("explicitBasedir2",
new String[] {dir1.getAbsolutePath(),
dir2.getAbsolutePath()
});
|
public void | testInfiniteLoopViaDepends()
expectBuildException("infinite-loop-via-depends", "recursive call");
|
public void | testInheritBasedir()
String basedir = getProjectDir().getAbsolutePath();
testBaseDirs("inheritBasedir", new String[] {basedir, basedir});
|
public void | testInheritPath()
executeTarget("testInheritPath");
|
public void | testInputHandlerInheritance()
InputHandler ih = new PropertyFileInputHandler();
getProject().setInputHandler(ih);
InputHandlerChecker ic = new InputHandlerChecker(ih);
getProject().addBuildListener(ic);
executeTarget("tripleCall");
AssertionFailedError ae = ic.getError();
if (ae != null) {
throw ae;
}
getProject().removeBuildListener(ic);
|
public void | testLogfilePlacement()
File[] logFiles = new File[] {
getProject().resolveFile("test1.log"),
getProject().resolveFile("test2.log"),
getProject().resolveFile("ant/test3.log"),
getProject().resolveFile("ant/test4.log")
};
for (int i=0; i<logFiles.length; i++) {
assertTrue(logFiles[i].getName()+" doesn\'t exist",
!logFiles[i].exists());
}
executeTarget("testLogfilePlacement");
for (int i=0; i<logFiles.length; i++) {
assertTrue(logFiles[i].getName()+" exists",
logFiles[i].exists());
}
|
public void | testMultiSameProperty()
expectLog("multi-same-property", "prop is two");
|
public void | testMultiplePropertyFileChildren()
PropertyChecker pcBar = new PropertyChecker("bar",
new String[] {null, "Bar"});
PropertyChecker pcFoo = new PropertyChecker("foo",
new String[] {null, "Foo"});
project.addBuildListener(pcBar);
project.addBuildListener(pcFoo);
executeTarget("multiple-property-file-children");
AssertionFailedError aeBar = pcBar.getError();
if (aeBar != null) {
throw aeBar;
}
AssertionFailedError aeFoo = pcFoo.getError();
if (aeFoo != null) {
throw aeFoo;
}
project.removeBuildListener(pcBar);
project.removeBuildListener(pcFoo);
|
public void | testMultipleTargets()
expectLog("multiple-targets", "tadadctbdbtc");
|
public void | testMultipleTargets2()
expectLog("multiple-targets-2", "dadctb");
|
public void | testOverrideWinsInheritAll()
expectLogContaining("test-property-override-inheritall-start",
"The value of test is 4");
|
public void | testOverrideWinsNoInheritAll()
expectLogContaining("test-property-override-no-inheritall-start",
"The value of test is 4");
|
public void | testPropertySet()
executeTarget("test-propertyset");
assertTrue(getLog().indexOf("test1 is ${test1}") > -1);
assertTrue(getLog().indexOf("test2 is ${test2}") > -1);
assertTrue(getLog().indexOf("test1.x is 1") > -1);
|
public void | testRefId()
Path testPath = new Path(project);
testPath.createPath().setPath(System.getProperty("java.class.path"));
PropertyChecker pc =
new PropertyChecker("testprop",
new String[] {null,
testPath.toString()});
project.addBuildListener(pc);
executeTarget("testRefid");
AssertionFailedError ae = pc.getError();
if (ae != null) {
throw ae;
}
project.removeBuildListener(pc);
|
protected void | testReference(java.lang.String target, java.lang.String[] keys, boolean[] expect, java.lang.Object value)
ReferenceChecker rc = new ReferenceChecker(keys, expect, value);
project.addBuildListener(rc);
executeTarget(target);
AssertionFailedError ae = rc.getError();
if (ae != null) {
throw ae;
}
project.removeBuildListener(rc);
|
public void | testReferenceInheritance()
Path p = Path.systemClasspath;
p.setProject(project);
project.addReference("path", p);
project.addReference("no-override", p);
testReference("testInherit", new String[] {"path", "path"},
new boolean[] {true, true}, p);
testReference("testInherit",
new String[] {"no-override", "no-override"},
new boolean[] {true, false}, p);
testReference("testInherit",
new String[] {"no-override", "no-override"},
new boolean[] {false, false}, null);
|
public void | testReferenceNoInheritance()
Path p = Path.systemClasspath;
p.setProject(project);
project.addReference("path", p);
project.addReference("no-override", p);
testReference("testNoInherit", new String[] {"path", "path"},
new boolean[] {true, false}, p);
testReference("testNoInherit", new String[] {"path", "path"},
new boolean[] {false, true}, null);
testReference("testInherit",
new String[] {"no-override", "no-override"},
new boolean[] {true, false}, p);
testReference("testInherit",
new String[] {"no-override", "no-override"},
new boolean[] {false, false}, null);
|
public void | testReferenceRename()
Path p = Path.systemClasspath;
p.setProject(project);
project.addReference("path", p);
testReference("testRename", new String[] {"path", "path"},
new boolean[] {true, false}, p);
testReference("testRename", new String[] {"path", "path"},
new boolean[] {false, true}, null);
testReference("testRename", new String[] {"newpath", "newpath"},
new boolean[] {false, true}, p);
|
public void | testTopLevelTarget()
expectLog("topleveltarget", "Hello world");
|
public void | testUserPropertyWinsInheritAll()
getProject().setUserProperty("test", "7");
expectLogContaining("test-property-override-inheritall-start",
"The value of test is 7");
|
public void | testUserPropertyWinsNoInheritAll()
getProject().setUserProperty("test", "7");
expectLogContaining("test-property-override-no-inheritall-start",
"The value of test is 7");
|