Code example for XmlBeanFactory

Methods: getBean

0
    protected void setUp() throws Exception {
        this.beanFactory = new XmlBeanFactory(new ClassPathResource("test-data-orcl-namespace.xml", getClass()));
    } 
 
    public void testSimpleDataSourceDefinition() throws Exception {
        Object bean = this.beanFactory.getBean("simpleDataSource");
        assertEquals("not the correct class", "oracle.jdbc.pool.OracleDataSource", bean.getClass().getName());
    } 
 
    public void testClasspathPropertyFileDataSourceDefinition() throws Exception {
        Object bean = this.beanFactory.getBean("classpathPropertyFileDataSource");
        assertEquals("not the correct class", "oracle.jdbc.pool.OracleDataSource", bean.getClass().getName());
    } 
 
    public void testLocalPropertyFileDataSourceDefinition() throws Exception {
        Object bean = this.beanFactory.getBean("localPropertyFileDataSource");
        assertEquals("not the correct class", "oracle.jdbc.pool.OracleDataSource", bean.getClass().getName());
    } 
 
    public void testConectionPropertiesDataSourceDefinition() throws Exception {