Package org.apache.tools.ant

Examples of org.apache.tools.ant.Project


    public PathTest(String name) {
        super(name);
    }

    public void setUp() {
        project = new Project();
        project.setBasedir(".");
    }
View Full Code Here


    public MapperTest(String name) {
        super(name);
    }

    public void setUp() {
        project = new Project();
        project.setBasedir(".");
    }
View Full Code Here

    public XMLCatalogTest(String name) {
        super(name);
    }

    public void setUp() {
        project = new Project();
        project.setBasedir(".");

        // This causes XMLCatalog to print out detailed logging
        // messages for debugging
        //
View Full Code Here

    public BaseSelectorTest(String name) {
        super(name);
    }

    public void setUp() {
        project = new Project();
        project.init();
        project.setBaseDir(basedir);
        for (int x = 0; x < files.length; x++) {
            files[x] = new File(beddir,filenames[x]);
            mirrorfiles[x] = new File(mirrordir,filenames[x]);
View Full Code Here

        }

        if ("hibernate".equals(daoFramework)) {
            log("Removing mapping for '" + pojoName + "' from hibernate.cfg.xml");
            String className = project.getGroupId() + ".model." + pojoName;
            Project antProject = AntUtils.createProject();
            Replace replace = (Replace) antProject.createTask("replace");
            replace.setFile(new File(hibernateCfgLocation));
            replace.setToken("    <mapping class=\"" + className + "\"/>");
            replace.execute();
        }
View Full Code Here

     * @param target the name of the target to invoke
     */
    public void ant(File buildFile, String target) {
        assertTrue(buildFile.isFile());

        Project project = new Project();
        project.init();
        project.setUserProperty("ant.file", buildFile.getAbsolutePath());
        ProjectHelper.configureProject(project, buildFile);
        project.executeTarget(target);
    }
View Full Code Here

   * @see org.apache.tools.ant.Task#execute()
   */
  public void execute() throws BuildException {

    BeanFactory parentBeanFactory = getBeanFactory();
    Project project = getProject();

    if ((taskref == null) || !project.getReferences().containsKey(taskref)) {
      throw new BuildException(
          "The project does not contain the required reference: ["
              + taskref + "]");
    }

    // Check that the reference we were given is a valid Task instance
    Object ref = project.getReference(taskref);
    if (!(ref instanceof Task)) {
      throw new BuildException("Reference (" + taskref
          + ") does not refer to a task");
    }
    Task target = (Task) ref;
View Full Code Here

    }

    @Test
    public void shouldCreateNewEmbedderWithAntMonitor() {
        // Given
        Project project = mock(Project.class);
        AbstractEmbedderTask task = new AbstractEmbedderTask() {
        };
        task.setProject(project);
        // When
        Embedder embedder = task.newEmbedder();
View Full Code Here

  }

  public void testResultStreamError() throws Exception {
    List<String> messages = new ArrayList<String>();

    model.addClasspath(new Path(new Project()));
    model.setResultFile("/this/result/file/does/not/exist.txt");
    assertFalse(model.validate(messages));
    assertTrue(messages.contains(TaskModel.ERROR_RESULT_FILE_CREATION_FAILED));
  }
View Full Code Here

  }

  public void testErrorStreamError() throws Exception {
    List<String> messages = new ArrayList<String>();

    model.addClasspath(new Path(new Project()));
    model.setErrorFile("/this/error/file/does/not/exist.txt");
    assertFalse(model.validate(messages));
    assertTrue(messages.contains(TaskModel.ERROR_ERROR_FILE_CREATION_FAILED));
  }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.