Package org.apache.tools.ant

Examples of org.apache.tools.ant.Location


                task = new UnknownElement(tag);
                task.setProject(helperImpl.project);
                //TODO task.setTaskType(tag);
                task.setTaskName(tag);
            }
            task.setLocation(new Location(helperImpl.locator));
            helperImpl.configureId(task, attrs);

            task.setOwningTarget(target);
            container.addTask(task);
            task.init();
View Full Code Here


        try {
            buildRule.configureProject(
                "src/etc/testcases/taskdefs/import/import_bad_import.xml");
            fail("Build exception should have been thrown");
        } catch (BuildException ex) {
            Location lo = ex.getLocation();
            assertNotNull(
                "expected location of build exception to be set", lo);
            assertContains(
                "expected location to contain calling file", "import_bad_import.xml", lo.getFileName());
            assertContains(
                "expected message of ex to contain called file", "bad.xml", ex.getMessage());
        }
    }
View Full Code Here

            Project project = context.getProject();
            Target target = "target".equals(tag)
                ? new Target() : new ExtensionPoint();
            target.setProject(project);
            target.setLocation(new Location(context.getLocator()));
            context.addTarget(target);

            for (int i = 0; i < attrs.getLength(); i++) {
                String attrUri = attrs.getURI(i);
                if (attrUri != null && !attrUri.equals("") && !attrUri.equals(uri)) {
View Full Code Here

            task.setNamespace(uri);
            task.setQName(qname);
            task.setTaskType(ProjectHelper.genComponentName(task.getNamespace(), tag));
            task.setTaskName(qname);

            Location location = new Location(context.getLocator().getSystemId(), context
                                             .getLocator().getLineNumber(), context.getLocator().getColumnNumber());
            task.setLocation(location);
            task.setOwningTarget(context.getCurrentTarget());

            if (parent != null) {
View Full Code Here

    /**  Tests VSSHistory commandline generation with date calculation.  */
    @Test
    public void testHistoryCommandLine3() {
        // Set up a Timestamp
        Tstamp tstamp = new Tstamp();
        Location location = new Location("src/etc/testcases/taskdefs/optional/vss/vss.xml");
        tstamp.setLocation(location);
        tstamp.setProject(project);
        Tstamp.CustomFormat format = tstamp.createFormat();
        format.setProperty("today");
        format.setPattern("HH:mm:ss z");
View Full Code Here

    /**  Tests VSSHistory commandline generation with date calculation.  */
    public void testHistoryCommandLine3() {
        // Set up a Timestamp
        Tstamp tstamp = new Tstamp();
        Location location = new Location("src/etc/testcases/taskdefs/optional/vss/vss.xml");
        tstamp.setLocation(location);
        tstamp.setProject(project);
        Tstamp.CustomFormat format = tstamp.createFormat();
        format.setProperty("today");
        format.setPattern("HH:mm:ss z");
View Full Code Here

    public void testImportError() {
        try {
            configureProject(
                "src/etc/testcases/taskdefs/import/import_bad_import.xml");
        } catch (BuildException ex) {
            Location lo = ex.getLocation();
            assertTrue(
                "expected location of build exception to be set",
                (lo != null));
            assertTrue(
                "expected location to contain calling file",
                lo.getFileName().indexOf("import_bad_import.xml") != -1);
            assertTrue(
                "expected message of ex to contain called file",
                ex.getMessage().indexOf("bad.xml") != -1);
            return;
        }
View Full Code Here

    public TStampTest(String s) {
        super(s);
    }

    protected void setUp() throws Exception {
        location = new Location("test.xml");
        project = new Project();
        tstamp = new Tstamp();
        tstamp.setLocation(location);
        tstamp.setProject(project);
    }
View Full Code Here

        {
          // call stack of ant calls (if any)
        final Element antCallStack = addNewElement(failure, "antStack");
        for (int i=locations.size()-1; i>=0; --i)
        {
          final Location loc = (Location) locations.get(i);
          final Element antCall = addNewElement(antCallStack, "call");
          antCall.setAttribute("filename", loc.getFileName());
          antCall.setAttribute("line", String.valueOf(loc.getLineNumber()));
        }
        }
        if (rootCause instanceof WebTestException)
        {
          final WebTestException e = (WebTestException) rootCause;
View Full Code Here

     * @param buildFile  ant build file
     */
    public void setBuildFile(File buildFile) {
        this.buildFile = buildFile;
        this.buildFileParent = new File(buildFile.getParent());
        implicitTarget.setLocation(new Location(buildFile.getAbsolutePath()));
    }
View Full Code Here

TOP

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

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.