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

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

Introduction

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

Prototype

@Override
    public void start() 

Source Link

Usage

From source file:org.jaffre.springframework.JaffreExporterTestCase.java

public void test() throws Exception {
    final File l_fileAppContext;
    final FileSystemXmlApplicationContext l_appCtx;

    l_fileAppContext = PackageFile.get("test-resources/appcontext01.xml");
    assertTrue(l_fileAppContext.isFile());

    l_appCtx = new FileSystemXmlApplicationContext(l_fileAppContext.getPath());

    l_appCtx.start();

    assertEquals(6, l_appCtx.getBeanDefinitionCount());
    assertNotNull(l_appCtx.getBean("jaffreClient"));
    assertNotNull(l_appCtx.getBean("jaffreServer"));
    assertNotNull(l_appCtx.getBean("jaffreConnector"));
    assertNotNull(l_appCtx.getBean("jaffreExporter"));
    assertNotNull(l_appCtx.getBean("throwException"));
    assertNotNull(l_appCtx.getBean("greeting"));

    l_appCtx.stop();/*from   ww w  . j  av a 2  s. c o  m*/
    l_appCtx.close();
}