Search in sources :

Example 1 with ClassPathXmlApplicationContext

use of org.springframework.context.support.ClassPathXmlApplicationContext in project camel by apache.

the class CxfEndpointTest method testSpringCxfEndpoint.

@Test
public void testSpringCxfEndpoint() throws Exception {
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(new String[] { "org/apache/camel/component/cxf/CxfEndpointBeans.xml" });
    CxfComponent cxfComponent = new CxfComponent(new SpringCamelContext(ctx));
    CxfSpringEndpoint endpoint = (CxfSpringEndpoint) cxfComponent.createEndpoint("cxf://bean:serviceEndpoint");
    assertEquals("Got the wrong endpoint address", endpoint.getAddress(), "http://localhost:" + port2 + "/CxfEndpointTest/helloworld");
    assertEquals("Got the wrong endpont service class", endpoint.getServiceClass().getCanonicalName(), "org.apache.camel.component.cxf.HelloService");
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) SpringCamelContext(org.apache.camel.spring.SpringCamelContext) Test(org.junit.Test)

Example 2 with ClassPathXmlApplicationContext

use of org.springframework.context.support.ClassPathXmlApplicationContext in project camel by apache.

the class CxfPayloadProducerNamespaceOnEnvelopeTest method setUp.

@Before
public void setUp() throws Exception {
    applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/GetTokenBeans.xml");
    super.setUp();
    assertNotNull("Should have created a valid spring context", applicationContext);
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) Before(org.junit.Before)

Example 3 with ClassPathXmlApplicationContext

use of org.springframework.context.support.ClassPathXmlApplicationContext in project camel by apache.

the class CxfRsProducerClientFactoryCacheTest method setUp.

@Before
public void setUp() throws Exception {
    applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest1.xml");
    context1 = SpringCamelContext.springCamelContext(applicationContext, false);
    context1.start();
    template1 = context1.createProducerTemplate();
    template1.start();
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) Before(org.junit.Before)

Example 4 with ClassPathXmlApplicationContext

use of org.springframework.context.support.ClassPathXmlApplicationContext in project camel by apache.

the class CamelJaxbSpringTest method createCamelContext.

protected CamelContext createCamelContext() throws Exception {
    setUseRouteBuilder(false);
    final AbstractXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/apache/camel/jaxb/CamelJaxbTest.xml");
    setCamelContextService(new Service() {

        public void start() throws Exception {
            applicationContext.start();
        }

        public void stop() throws Exception {
            applicationContext.stop();
        }
    });
    return SpringCamelContext.springCamelContext(applicationContext);
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) Service(org.apache.camel.Service) AbstractXmlApplicationContext(org.springframework.context.support.AbstractXmlApplicationContext)

Example 5 with ClassPathXmlApplicationContext

use of org.springframework.context.support.ClassPathXmlApplicationContext in project cas by apereo.

the class JdbcDataSourceMonitorTests method setUp.

@Before
public void setUp() {
    final ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:/jpaTestApplicationContext.xml");
    this.dataSource = ctx.getBean("dataSource", DataSource.class);
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) DataSource(javax.sql.DataSource) Before(org.junit.Before)

Aggregations

ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)480 Test (org.junit.Test)212 ApplicationContext (org.springframework.context.ApplicationContext)149 Before (org.junit.Before)47 ConfigurableMessenger (org.springframework.scripting.ConfigurableMessenger)33 ITestBean (org.springframework.tests.sample.beans.ITestBean)30 Messenger (org.springframework.scripting.Messenger)29 CamelContext (org.apache.camel.CamelContext)25 Refreshable (org.springframework.aop.target.dynamic.Refreshable)23 AbstractXmlApplicationContext (org.springframework.context.support.AbstractXmlApplicationContext)22 DataSource (javax.sql.DataSource)17 SpringCamelContext (org.apache.camel.spring.SpringCamelContext)16 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)13 AbstractApplicationContext (org.springframework.context.support.AbstractApplicationContext)13 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)12 DemoService (com.alibaba.dubbo.config.spring.api.DemoService)11 ProducerTemplate (org.apache.camel.ProducerTemplate)10 File (java.io.File)9 URL (com.alibaba.dubbo.common.URL)8 Service (org.apache.camel.Service)8