Example usage for org.springframework.context.support AbstractXmlApplicationContext start

List of usage examples for org.springframework.context.support AbstractXmlApplicationContext start

Introduction

In this page you can find the example usage for org.springframework.context.support AbstractXmlApplicationContext start.

Prototype

@Override
    public void start() 

Source Link

Usage

From source file:org.jboss.fuse.camel.c24io.spring.SpringTestHelper.java

public static CamelContext createSpringCamelContext(CamelTestSupport test, String classpathUri)
        throws Exception {
    test.setUseRouteBuilder(false);//  w ww.j  a  v a 2s . c o m

    final AbstractXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(classpathUri);
    test.setCamelContextService(new Service() {
        public void start() throws Exception {
            applicationContext.start();
        }

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

    return SpringCamelContext.springCamelContext(applicationContext);
}

From source file:org.jboss.fuse.camel.c24io.spring.SpringWithBadElementNameTest.java

@Test
public void testBadElementName() throws Exception {
    try {//ww  w .j av a2 s.c o m
        AbstractXmlApplicationContext appContext = new ClassPathXmlApplicationContext(
                "org/jboss/fuse/camel/c24io/spring/badElementName.xml");
        appContext.start();
        fail("should have failed!");
    } catch (RuntimeCamelException e) {
        System.out.println("Caught expected: " + e);
        e.printStackTrace();
    }
}