Code example for XmlBeanFactory

Methods: getBean

0
        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 {
        Object bean = this.beanFactory.getBean("connectionPropertiesDataSource");
        assertEquals("not the correct class", "oracle.jdbc.pool.OracleDataSource", bean.getClass().getName());
        assertTrue("connection properties not found", ((OracleDataSource)bean).getConnectionProperties().size() > 0);
        assertTrue("cache properties not found", ((OracleDataSource)bean).getConnectionCacheProperties().size() > 0);
    } 
Experience pair programming with AI  Get Codota for Java