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

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

Introduction

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

Prototype

@Override
    public int getBeanDefinitionCount() 

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();/* w  ww  . ja v  a2  s. c om*/

    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();
    l_appCtx.close();
}