Examples of UnknownElement


Examples of org.apache.tools.ant.UnknownElement

        tkCtrl.replay();

        RuntimeConfigurable wrapper = new RuntimeConfigurable(task, "blubb");

        MockControl ukeCtrl = MockClassControl.createControl(UnknownElement.class);
        UnknownElement uke = (UnknownElement)ukeCtrl.getMock();
        uke.maybeConfigure();
        ukeCtrl.setThrowable(new BuildException("bang"));
        uke.getWrapper();
        ukeCtrl.setReturnValue(wrapper);

        MockControl evCtrl = MockClassControl.createControl(BuildEvent.class);
        BuildEvent event = (BuildEvent)evCtrl.getMock();
        event.getTask();
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

        TaskRegistry registry = TaskRegistry.init(project);

        RuntimeConfigurable wrapper = new RuntimeConfigurable(new Object(), "blubb");

        MockControl ukeCtrl = MockClassControl.createControl(UnknownElement.class);
        UnknownElement uke = (UnknownElement)ukeCtrl.getMock();
        uke.maybeConfigure();
        ukeCtrl.setThrowable(new BuildException("bang"));
        uke.getWrapper();
        ukeCtrl.setReturnValue(wrapper);
        uke.getTaskName();
        ukeCtrl.setReturnValue("blah", 2);

        MockControl evCtrl = MockClassControl.createControl(BuildEvent.class);
        BuildEvent event = (BuildEvent)evCtrl.getMock();
        event.getTask();
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

        Project project = (Project)prCtrl.getMock();

        TaskRegistry registry = TaskRegistry.init(project);

        MockControl ukeCtrl = MockClassControl.createControl(UnknownElement.class);
        UnknownElement uke = (UnknownElement)ukeCtrl.getMock();
        uke.maybeConfigure();
        uke.getTask();
        ukeCtrl.setReturnValue(null);
        uke.getTaskName();
        ukeCtrl.setReturnValue("blah", 2);

        MockControl evCtrl = MockClassControl.createControl(BuildEvent.class);
        BuildEvent event = (BuildEvent)evCtrl.getMock();
        event.getTask();
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

        ServiceDef task = (ServiceDef)tkCtrl.getMock();
        task.getTaskName();
        tkCtrl.setReturnValue("blah");

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

        MockControl tlCtrl = MockClassControl.createControl(TestLogger.class);
        TestLogger parent = (TestLogger)tlCtrl.getMock();
        parent.getFullName();
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

            if (parser == null) {
                ProjectHelperRepository helperRepository =
                    ProjectHelperRepository.getInstance();
                parser = helperRepository.getProjectHelperForAntlib(antlibResource);
            }
            UnknownElement ue =
                parser.parseAntlibDescriptor(project, antlibResource);
            // Check name is "antlib"
            if (!(ue.getTag().equals(TAG))) {
                throw new BuildException(
                    "Unexpected tag " + ue.getTag() + " expecting "
                    + TAG, ue.getLocation());
            }
            Antlib antlib = new Antlib();
            antlib.setProject(project);
            antlib.setLocation(ue.getLocation());
            antlib.setTaskName("antlib");
            antlib.init();
            ue.configure(antlib);
            return antlib;
        } finally {
            helper.exitAntLib();
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

     * any tasks that derive from Definer.
     */
    public void execute() {
        //TODO handle tasks added via #addTask()
        for (Iterator<Object> i = tasks.iterator(); i.hasNext();) {
            UnknownElement ue = (UnknownElement) i.next();
            setLocation(ue.getLocation());
            ue.maybeConfigure();
            Object configuredObject = ue.getRealThing();
            if (configuredObject == null) {
                continue;
            }
            if (!(configuredObject instanceof AntlibDefinition)) {
                throw new BuildException(
                    "Invalid task in antlib " + ue.getTag()
                    + " " + configuredObject.getClass() + " does not "
                    + "extend org.apache.tools.ant.taskdefs.AntlibDefinition");
            }
            AntlibDefinition def = (AntlibDefinition) configuredObject;
            def.setURI(uri);
View Full Code Here

Examples of org.apache.tools.ant.UnknownElement

        Dispatchable dispatchable = null;
        try {
            if (task instanceof Dispatchable) {
                dispatchable = (Dispatchable) task;
            } else if (task instanceof UnknownElement) {
                UnknownElement ue = (UnknownElement) task;
                Object realThing = ue.getRealThing();
                if (realThing != null
                    && realThing instanceof Dispatchable
                    && realThing instanceof Task) {
                    dispatchable = (Dispatchable) realThing;
                }
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);
                //TODO 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
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.