public void testAnt() throws Exception {
    Ant.AntInstallation ant = configureDefaultAnt();
    String antPath = ant.getHome();
    Jenkins.getInstance()
        .getDescriptorByType(Ant.DescriptorImpl.class)
        .setInstallations(new AntInstallation("ant", "THIS IS WRONG"));

    project.setScm(new SingleFileSCM("build.xml", "<project name='foo'/>"));
    project.getBuildersList().add(new Ant("-version", "ant", null, null, null));
    configureDumpEnvBuilder();

    Build build = project.scheduleBuild2(0).get();
    assertBuildStatus(Result.FAILURE, build);

    ToolLocationNodeProperty property =
        new ToolLocationNodeProperty(
            new ToolLocationNodeProperty.ToolLocation(
                jenkins.getDescriptorByType(AntInstallation.DescriptorImpl.class), "ant", antPath));
    slave.getNodeProperties().add(property);

    build = project.scheduleBuild2(0).get();
    System.out.println(build.getLog());
    assertBuildStatus(Result.SUCCESS, build);
  }