Examples of FromDefinition


Examples of org.apache.camel.model.FromDefinition

        // stop the route
        context.stopRoute(route);

        // lets mutate the route...
        FromDefinition fromType = assertOneElement(route.getInputs());
        fromType.setUri("seda:test.C");
        context.startRoute(route);

        // now lets check it works
        // send from C over B to results
        results.reset();
View Full Code Here

Examples of org.apache.camel.model.FromDefinition

        assertEquals("One Route should be found", 1, routes.size());

        for (RouteDefinition route : routes) {
            List<FromDefinition> inputs = route.getInputs();
            assertEquals("Number of inputs", 1, inputs.size());
            FromDefinition fromType = inputs.get(0);
            assertEquals("from URI", "seda:test.a", fromType.getUri());

            List<ProcessorDefinition> outputs = route.getOutputs();
            assertEquals("Number of outputs", 1, outputs.size());
        }
    }
View Full Code Here

Examples of org.apache.camel.model.FromDefinition

    }

    protected NodeData getNodeData(Object node) {
        Object key = node;
        if (node instanceof FromDefinition) {
            FromDefinition fromType = (FromDefinition) node;
            key = fromType.getUriOrRef();
        } else if (node instanceof ToDefinition) {
            ToDefinition toType = (ToDefinition) node;
            key = toType.getUriOrRef();
        }
        NodeData answer = null;
View Full Code Here

Examples of org.apache.camel.model.FromDefinition

        if (node instanceof ProcessorDefinition) {
            ProcessorDefinition<?> processorType = (ProcessorDefinition<?>)node;
            this.edgeLabel = processorType.getLabel();
        }
        if (node instanceof FromDefinition) {
            FromDefinition fromType = (FromDefinition)node;
            this.tooltop = fromType.getLabel();
            this.label = removeQueryString(this.tooltop);
            this.url = "http://camel.apache.org/message-endpoint.html";
        } else if (node instanceof ToDefinition) {
            ToDefinition toType = (ToDefinition)node;
            this.tooltop = toType.getLabel();
View Full Code Here

Examples of org.apache.camel.model.FromDefinition

    }

    public static AdviceWithTask replaceFromWith(final RouteDefinition route, final String uri) {
        return new AdviceWithTask() {
            public void task() throws Exception {
                FromDefinition from = route.getInputs().get(0);
                LOG.info("AdviceWith replace input from [{}] --> [{}]", from.getUriOrRef(), uri);
                from.setEndpoint(null);
                from.setRef(null);
                from.setUri(uri);
            }
        };
    }
View Full Code Here

Examples of org.apache.camel.model.FromDefinition

    }

    public static AdviceWithTask replaceFrom(final RouteDefinition route, final Endpoint endpoint) {
        return new AdviceWithTask() {
            public void task() throws Exception {
                FromDefinition from = route.getInputs().get(0);
                LOG.info("AdviceWith replace input from [{}] --> [{}]", from.getUriOrRef(), endpoint.getEndpointUri());
                from.setRef(null);
                from.setUri(null);
                from.setEndpoint(endpoint);
            }
        };
    }
View Full Code Here

Examples of org.apache.camel.model.FromDefinition

        if (node instanceof ProcessorDefinition) {
            ProcessorDefinition<?> processorType = (ProcessorDefinition<?>)node;
            this.edgeLabel = processorType.getLabel();
        }
        if (node instanceof FromDefinition) {
            FromDefinition fromType = (FromDefinition)node;
            this.tooltop = fromType.getLabel();
            this.label = removeQueryString(this.tooltop);
            this.url = "http://camel.apache.org/message-endpoint.html";
        } else if (node instanceof ToDefinition) {
            ToDefinition toType = (ToDefinition)node;
            this.tooltop = toType.getLabel();
View Full Code Here

Examples of org.apache.camel.model.FromDefinition

    public void testCustomId() {
        RouteDefinition route = context.getRouteDefinition("myRoute");
        assertNotNull(route);
        assertTrue(route.hasCustomIdAssigned());

        FromDefinition from = route.getInputs().get(0);
        assertEquals("fromFile", from.getId());
        assertTrue(from.hasCustomIdAssigned());

        ChoiceDefinition choice = (ChoiceDefinition) route.getOutputs().get(0);
        assertEquals("myChoice", choice.getId());
        assertTrue(choice.hasCustomIdAssigned());
View Full Code Here

Examples of org.apache.camel.model.FromDefinition

        assertEquals("One Route should be found", 1, routes.size());

        for (RouteDefinition route : routes) {
            List<FromDefinition> inputs = route.getInputs();
            assertEquals("Number of inputs", 1, inputs.size());
            FromDefinition fromType = inputs.get(0);
            assertEquals("from URI", "seda:test.a", fromType.getUri());

            List<?> outputs = route.getOutputs();
            assertEquals("Number of outputs", 1, outputs.size());
        }
    }
View Full Code Here

Examples of org.apache.camel.model.FromDefinition

    public void testCustomId() {
        RouteDefinition route = context.getRouteDefinition("myRoute");
        assertNotNull(route);
        assertTrue(route.hasCustomIdAssigned());

        FromDefinition from = route.getInputs().get(0);
        assertEquals("fromFile", from.getId());
        assertTrue(from.hasCustomIdAssigned());

        ChoiceDefinition choice = (ChoiceDefinition) route.getOutputs().get(0);
        assertEquals("myChoice", choice.getId());
        assertTrue(choice.hasCustomIdAssigned());
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.