Package org.apache.tools.ant

Examples of org.apache.tools.ant.Location


            parser.setEntityResolver(hb);
            parser.setErrorHandler(hb);
            parser.setDTDHandler(hb);
            parser.parse(inputSource);
        } catch (SAXParseException exc) {
            Location location =
                new Location(exc.getSystemId(), exc.getLineNumber(),
                    exc.getColumnNumber());

            Throwable t = exc.getException();
            if (t instanceof BuildException) {
                BuildException be = (BuildException) t;
View Full Code Here


                if (key.equals("name")) {
                    name = value;
                    if (name.equals("")) {
                        throw new BuildException("name attribute must not"
                                                 + " be empty",
                                                 new Location(helperImpl.locator));
                    }
                } else if (key.equals("depends")) {
                    depends = value;
                } else if (key.equals("if")) {
                    ifCond = value;
View Full Code Here

                task.setProject(helperImpl.project);
                //XXX 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

            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());
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 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

    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

        taskCtrl.setReturnValue(project, 2);
        mockTask.getTaskName();
        taskCtrl.setReturnValue("mocktask");
        mockTask.maybeConfigure();
        mockTask.getLocation();
        taskCtrl.setReturnValue(new Location(""));
        mockTask.execute();
        taskCtrl.setThrowable(new BuildException());
       
        taskCtrl.replay();
        xhTask.addTask(mockTask);
View Full Code Here

        Task mockTask1 = (Task)taskCtrl.getMock();
        mockTask1.getProject();
        taskCtrl.setReturnValue(project, 2);
        mockTask1.maybeConfigure();
        mockTask1.getLocation();
        taskCtrl.setReturnValue(new Location(""));
        mockTask1.getTaskName();
        taskCtrl.setReturnValue("foo");
        mockTask1.execute();
        taskCtrl.setThrowable(new AssertionWarningException("XXX"));

        Task mockTask2 = (Task)taskCtrl.getMock();
        mockTask2.getProject();
        taskCtrl.setReturnValue(project, 2);
        mockTask2.maybeConfigure();
        mockTask2.execute();

        Task mockTask3 = (Task)taskCtrl.getMock();
        mockTask3.getProject();
        taskCtrl.setReturnValue(project, 2);
        mockTask3.maybeConfigure();
        mockTask3.getLocation();
        taskCtrl.setReturnValue(new Location(""));
        mockTask3.execute();
        taskCtrl.setThrowable(new AssertionWarningException("XXX"));

        taskCtrl.replay();
        test.addTask(mockTask1);
View Full Code Here

        Task mockTask2 = (Task)taskCtrl.getMock();
        mockTask2.getProject();
        taskCtrl.setReturnValue(project, 2);
        mockTask2.maybeConfigure();
        mockTask2.getLocation();
        taskCtrl.setReturnValue(new Location(""));
        mockTask2.getTaskName();
        taskCtrl.setReturnValue("foo");
        mockTask2.execute();
        taskCtrl.setThrowable(new BuildException("XXX"));
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.