use of org.springframework.context.support.AbstractXmlApplicationContext in project camel by apache.
the class SpringRemotingTwoCamelContextTest method testProxyWithTwoCamelContext.
public void testProxyWithTwoCamelContext() throws Exception {
AbstractXmlApplicationContext applicationContext = createApplicationContext();
CamelContext camelContext = SpringCamelContext.springCamelContext(applicationContext);
ISay proxy = applicationContext.getBean("sayProxy1", ISay.class);
String rc = proxy.say();
assertEquals("context-1", rc);
proxy = applicationContext.getBean("sayProxy2", ISay.class);
rc = proxy.say();
assertEquals("context-2", rc);
camelContext.stop();
IOHelper.close(applicationContext);
}
use of org.springframework.context.support.AbstractXmlApplicationContext in project camel by apache.
the class SpringRemotingBeanConverterTest method testBeanRoutes.
public void testBeanRoutes() throws Exception {
AbstractXmlApplicationContext applicationContext = createApplicationContext();
CamelContext camelContext = SpringCamelContext.springCamelContext(applicationContext);
Invoker invoker = applicationContext.getBean("invokerProxy", Invoker.class);
String response = invoker.invoke(new Bean.SubClass());
assertEquals("Hello from Sub", response);
camelContext.stop();
IOHelper.close(applicationContext);
}
use of org.springframework.context.support.AbstractXmlApplicationContext in project camel by apache.
the class SpringMarshalDomainObjectJSONTest method createCamelContext.
protected CamelContext createCamelContext() throws Exception {
setUseRouteBuilder(false);
final AbstractXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/dataformat/xstream/SpringMarshalDomainObjectJSONTest.xml");
setCamelContextService(new Service() {
public void start() throws Exception {
applicationContext.start();
}
public void stop() throws Exception {
applicationContext.stop();
}
});
return SpringCamelContext.springCamelContext(applicationContext);
}
use of org.springframework.context.support.AbstractXmlApplicationContext in project camel by apache.
the class SpringMarshalListTest method createCamelContext.
protected CamelContext createCamelContext() throws Exception {
setUseRouteBuilder(false);
final AbstractXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/dataformat/xstream/SpringMarshalListTest.xml");
setCamelContextService(new Service() {
public void start() throws Exception {
applicationContext.start();
}
public void stop() throws Exception {
applicationContext.stop();
}
});
return SpringCamelContext.springCamelContext(applicationContext);
}
use of org.springframework.context.support.AbstractXmlApplicationContext in project camel by apache.
the class SpringXStreamConfigurationTest method createCamelContext.
protected CamelContext createCamelContext() throws Exception {
setUseRouteBuilder(false);
final AbstractXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/dataformat/xstream/SpringXStreamConfigurationTest.xml");
setCamelContextService(new Service() {
public void start() throws Exception {
applicationContext.start();
}
public void stop() throws Exception {
applicationContext.stop();
}
});
return SpringCamelContext.springCamelContext(applicationContext);
}
Aggregations