camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Help to re-write route
Date Fri, 11 Oct 2013 11:22:08 GMT
Hi guys,

I was wondering if someone could give me some help out how to re-write this
camel test into a proper camel program. The issue is I know how to write a
simple route and then execute it. But after the route is executed and I want
to grab the parsed xml in a fashion similar to testStaxExpression how would
I do this in a real Camel application. I know the configure method in the
route is not the right place to do it.

Where is the right place. Sorry for the easy questions. I am a beginner.

package org.apache.camel.component.stax;

import org.apache.camel.EndpointInject;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.component.stax.model.Record;
import org.apache.camel.component.stax.model.RecordsUtil;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.BeforeClass;
import org.junit.Test;

import static org.apache.camel.component.stax.StAXBuilder.stax;

public class StAXJAXBIteratorExpressionTest extends CamelTestSupport {
    @EndpointInject(uri = "mock:records")
    private MockEndpoint recordsEndpoint;

    public static void initRouteExample() {

    public RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() throws Exception {
   "Doing route");
                // START SNIPPET: e1
                    // split the file using StAX (the stax method is from
                    // and use streaming mode in the splitter
                // END SNIPPET: e1

    public void testStaxExpression() throws InterruptedException {


        Record five =
        assertEquals("4", five.getKey());
        assertEquals("#4", five.getValue());

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message