Search in sources :

Example 56 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 57 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 58 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 59 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 60 with ClassPathXmlApplicationContext

use of org.springframework.context.support.ClassPathXmlApplicationContext in project redisson by redisson.

the class SpringNamespaceObjectTest method startContext.

public static void startContext() {
    TestREntity entity = new TestREntity("live-object");
    entity.setValue("1");
    defaultRedisson.getLiveObjectService().merge(entity);
    entity = new TestREntity("live-object-ext");
    entity.setValue("1");
    defaultRedisson.getLiveObjectService().merge(entity);
    System.setProperty("redisAddress", RedisRunner.getDefaultRedisServerBindAddressAndPort());
    context = new ClassPathXmlApplicationContext("classpath:org/redisson/spring/support/redisson_objects.xml");
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) TestREntity(org.redisson.RedissonLiveObjectServiceTest.TestREntity)

Aggregations

ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)561 Test (org.junit.Test)265 ApplicationContext (org.springframework.context.ApplicationContext)167 Before (org.junit.Before)53 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)18 SpringCamelContext (org.apache.camel.spring.SpringCamelContext)16 AbstractApplicationContext (org.springframework.context.support.AbstractApplicationContext)16 Bus (org.apache.cxf.Bus)14 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)14 ArrayList (java.util.ArrayList)13 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)12 DemoService (com.alibaba.dubbo.config.spring.api.DemoService)11 IOException (java.io.IOException)10 ProducerTemplate (org.apache.camel.ProducerTemplate)10