use of org.apache.tools.ant.helper.ProjectHelper2 in project ant by apache.
the class ProjectHelperRepositoryTest method testFind.
@Test
public void testFind() {
ProjectHelperRepository repo = ProjectHelperRepository.getInstance();
repo.registerProjectHelper(SomeHelper.class);
Resource r = new FileResource(new File("test.xml"));
ProjectHelper helper = repo.getProjectHelperForBuildFile(r);
assertTrue(helper instanceof ProjectHelper2);
helper = repo.getProjectHelperForAntlib(r);
assertTrue(helper instanceof ProjectHelper2);
r = new FileResource(new File("test.myext"));
helper = repo.getProjectHelperForBuildFile(r);
assertTrue(helper instanceof SomeHelper);
helper = repo.getProjectHelperForAntlib(r);
assertTrue(helper instanceof SomeHelper);
r = new StringResource("test.myext");
helper = repo.getProjectHelperForBuildFile(r);
assertTrue(helper instanceof ProjectHelper2);
helper = repo.getProjectHelperForAntlib(r);
assertTrue(helper instanceof ProjectHelper2);
r = new StringResource("test.other");
helper = repo.getProjectHelperForBuildFile(r);
assertTrue(helper instanceof ProjectHelper2);
helper = repo.getProjectHelperForAntlib(r);
assertTrue(helper instanceof ProjectHelper2);
}
Aggregations