Examples of UnknownElement


Examples of org.apache.tools.ant.UnknownElement

    }
   
    private UnknownElement getMockUnknownElement(MockControl ctrl,
                                                 Object nested,
                                                 Throwable exception) {
        UnknownElement mockUke = (UnknownElement)ctrl.getMock();
        mockUke.getProject();
        ctrl.setReturnValue(project, 2);
        mockUke.maybeConfigure();
        mockUke.getLocation();
        ctrl.setReturnValue(new Location(""));
        mockUke.getTask();
        ctrl.setReturnValue(nested, 1);
        mockUke.execute();
        if (exception != null) {
            ctrl.setThrowable(exception);
        }
        return mockUke;
    }
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

//                // swallow here, will be thrown again in
//                // UnknownElement.maybeConfigure if the problem persists.
//            }

            if (task == null) {
                UnknownElement ue = new UnknownElement(tag);
                ue.setProject(project);
                ue.setTaskName(tag);
                ue.setNamespace("");
                ue.setQName(tag);
                task = ue;
            }

            task.setLocation(
                new Location(locator.getSystemId(), locator.getLineNumber(),
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

            try {
                String elementName = propType.toLowerCase(Locale.US);

                if (parent instanceof UnknownElement) {
                    UnknownElement uc = new UnknownElement(elementName);

                    uc.setProject(project);
                    ((UnknownElement)parent).addChild(uc);
                    uc.setNamespace(((UnknownElement)parent).getNamespace());
                    uc.setQName(elementName);
                    uc.setOwningTarget(((UnknownElement)parent).getOwningTarget());
                    uc.setTaskName(elementName);
                    child = uc;
                } else {
                    child = ih.createElement(project, parent, elementName);
                }
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

                DBUpgrader upgrader = null;
                if (t instanceof DBUpgrader) {
                    upgrader = (DBUpgrader) t;
                } else if (t instanceof UnknownElement) {
                    if ("dbupgrade".equals(t.getTaskType())) {
                        UnknownElement u = (UnknownElement)t;
                        u.maybeConfigure();

                        if (u.getTask() instanceof DBUpgrader) {
                            upgrader = (DBUpgrader) u.getTask();
                        }
                    }
                }

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

Examples of org.apache.tools.ant.UnknownElement

            } catch (BuildException e) {
                // swallow here, will be thrown again in
                // UnknownElement.maybeConfigure if the problem persists.
            }
            if (task == null) {
                task = new UnknownElement(tag);
                task.setProject(helperImpl.project);
                //XXX task.setTaskType(tag);
                task.setTaskName(tag);
            }
            task.setLocation(new Location(helperImpl.locator));
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

            IntrospectionHelper ih = IntrospectionHelper.getHelper(helperImpl.project, parentClass);

            try {
                String elementName = propType.toLowerCase(Locale.ENGLISH);
                if (parent instanceof UnknownElement) {
                    UnknownElement uc = new UnknownElement(elementName);
                    uc.setProject(helperImpl.project);
                    ((UnknownElement) parent).addChild(uc);
                    child = uc;
                } else {
                    child = ih.createElement(helperImpl.project, parent, elementName);
                }
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

                parent = parentWrapper.getProxy();
            }

            /* UnknownElement is used for tasks and data types - with
               delayed eval */
            UnknownElement task = new UnknownElement(tag);
            task.setProject(context.getProject());
            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) {
                // Nested element
                ((UnknownElement) parent).addChild(task);
            else {
                // Task included in a target ( including the default one ).
                context.getCurrentTarget().addTask(task);
            }

            context.configureId(task, attrs);

            // container.addTask(task);
            // This is a nop in UE: task.init();

            RuntimeConfigurable wrapper = new RuntimeConfigurable(task, task.getTaskName());

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

Examples of org.apache.tools.ant.UnknownElement

     *
     * @param task The started Task.
     */
    protected void taskStartedInternal(Task task) {
        if (isActive()) {
            UnknownElement originalTask = null;
            if (task instanceof UnknownElement) {
                originalTask = (UnknownElement)task;
                originalTask.maybeConfigure();
                task = originalTask.getTask();
            }
           
            TaskLogger newLogger = null;
            if (task instanceof ServiceGroupTask) {
                if ("start".equals(task.getTaskName()) && currentTest != null) {
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

        registry.getNextId();
        trCtrl.setReturnValue(101, 2);
        registry.getProject();
        trCtrl.setReturnValue(project, 2);
       
        UnknownElement uke = new UnknownElement("eggs");

        prCtrl.replay();
        trCtrl.replay();
       
        TaskLogger logger = new TaskLogger(registry, uke, "foo", "bar", "spam");
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

        Task task = (Task)tkCtrl.getMock();
        task.getTaskName();
        tkCtrl.setReturnValue("blah", 2);

        MockControl ukeCtrl = MockClassControl.createControl(UnknownElement.class);
        UnknownElement uke = (UnknownElement)ukeCtrl.getMock();
        uke.maybeConfigure();
        uke.getTask();
        ukeCtrl.setReturnValue(task, 2);

        MockControl evCtrl = MockClassControl.createControl(BuildEvent.class);
        BuildEvent event = (BuildEvent)evCtrl.getMock();
        event.getTask();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.