Examples of RuntimeConfigurable


Examples of org.apache.tools.ant.RuntimeConfigurable

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

        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"));
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

        MockControl prCtrl = MockClassControl.createNiceControl(Project.class);
        Project project = (Project)prCtrl.getMock();

        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"));
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

        xhTask.getProject();
        xhCtrl.setReturnValue(project);
        xhTask.getErrorProperty();
        xhCtrl.setReturnValue(null);
        xhTask.getRuntimeConfigurableWrapper();
        xhCtrl.setReturnValue(new RuntimeConfigurable(new Object(), "xharness"));
       
        MockControl tkCtrl = MockClassControl.createControl(TestCaseTask.class);
        TestCaseTask tcTask = (TestCaseTask)tkCtrl.getMock();
        tcTask.getRuntimeConfigurableWrapper();
        tkCtrl.setReturnValue(new RuntimeConfigurable(new Object(), "testcase"));

        prCtrl.replay();
        xhCtrl.replay();
        tkCtrl.replay();
       
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

        trCtrl.setReturnValue(project);
       
        MockControl tkCtrl = MockClassControl.createControl(ServiceDef.class);
        ServiceDef task = (ServiceDef)tkCtrl.getMock();
        task.getRuntimeConfigurableWrapper();
        tkCtrl.setReturnValue(new RuntimeConfigurable(new Object(), "foo"));
        task.wasStopped();
        tkCtrl.setReturnValue(false);

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

Examples of org.apache.tools.ant.RuntimeConfigurable

        trCtrl.setReturnValue(project);
       
        MockControl tkCtrl = MockClassControl.createControl(ServiceDef.class);
        ServiceDef task = (ServiceDef)tkCtrl.getMock();
        task.getRuntimeConfigurableWrapper();
        tkCtrl.setReturnValue(new RuntimeConfigurable(new Object(), "foo"));
        task.wasStopped();
        tkCtrl.setReturnValue(true);

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

Examples of org.apache.tools.ant.RuntimeConfigurable

        trCtrl.setReturnValue(project);
       
        MockControl tkCtrl = MockClassControl.createControl(Task.class);
        Task task = (Task)tkCtrl.getMock();
        task.getRuntimeConfigurableWrapper();
        tkCtrl.setReturnValue(new RuntimeConfigurable(new Object(), "foo"));

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

Examples of org.apache.tools.ant.RuntimeConfigurable

                } else {
                    child = ih.createElement(helperImpl.project, parent, elementName);
                }
                helperImpl.configureId(child, attrs);

                childWrapper = new RuntimeConfigurable(child, propType);
                childWrapper.setAttributes(attrs);
                parentWrapper.addChild(childWrapper);
            } catch (BuildException exc) {
                throw new SAXParseException(exc.getMessage(), helperImpl.locator, exc);
            }
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

            try {
                element = helperImpl.project.createDataType(propType);
                if (element == null) {
                    throw new BuildException("Unknown data type " + propType);
                }
                wrapper = new RuntimeConfigurable(element, propType);
                wrapper.setAttributes(attrs);
                target.addDataType(wrapper);
            } catch (BuildException exc) {
                throw new SAXParseException(exc.getMessage(), helperImpl.locator, exc);
            }
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

         * @exception SAXParseException in case of error (not thrown in
         *                              this implementation)
         */
        public void onStartElement(String uri, String tag, String qname, Attributes attrs,
                                   AntXMLContext context) throws SAXParseException {
            RuntimeConfigurable parentWrapper = context.currentWrapper();
            Object parent = null;

            if (parentWrapper != null) {
                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)) {
                    name = attrUri + ":" + attrs.getQName(i);
                }
                String value = attrs.getValue(i);
                // PR: Hack for ant-type value
                //  an ant-type is a component name which can
                // be namespaced, need to extract the name
                // and convert from qualified name to uri/name
                if (ANT_TYPE.equals(name)
                    || (ANT_CORE_URI.equals(attrUri)
                        && ANT_TYPE.equals(attrs.getLocalName(i)))) {
                    name = ANT_TYPE;
                    int index = value.indexOf(":");
                    if (index >= 0) {
                        String prefix = value.substring(0, index);
                        String mappedUri = context.getPrefixMapping(prefix);
                        if (mappedUri == null) {
                            throw new BuildException("Unable to find XML NS prefix \"" + prefix
                                                     + "\"");
                        }
                        value = ProjectHelper.genComponentName(mappedUri, value
                                                               .substring(index + 1));
                    }
                }
                wrapper.setAttribute(name, value);
            }
            if (parentWrapper != null) {
                parentWrapper.addChild(wrapper);
            }
            context.pushWrapper(wrapper);
View Full Code Here

Examples of org.apache.tools.ant.RuntimeConfigurable

         *
         * @see ProjectHelper#addText(Project,java.lang.Object,char[],int,int)
         */
        public void characters(char[] buf, int start, int count,
                               AntXMLContext context) throws SAXParseException {
            RuntimeConfigurable wrapper = context.currentWrapper();
            wrapper.addText(buf, start, count);
        }
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.