Resource rs = new ClassPathResource("org/apache/camel/itest/jaxb/BarRoute.xml");
Object value = unmarshaller.unmarshal(rs.getInputStream());
// it should be a RoutesDefinition (we can have multiple routes in the same XML file)
RoutesDefinition routes = (RoutesDefinition) value;
assertNotNull("Should load routes from XML", routes);
assertEquals(1, routes.getRoutes().size());
// add the routes to existing CamelContext
context.addRouteDefinitions(routes.getRoutes());
assertNotNull("Loaded bar route should be there", context.getRoute("bar"));
assertEquals(2, context.getRoutes().size());
// test that loaded route works