Code example for XmlBeanFactory

Methods: getBean

0
        assertTrue("connection properties not found", ((OracleDataSource)bean).getConnectionProperties().size() > 0);
        assertTrue("cache properties not found", ((OracleDataSource)bean).getConnectionCacheProperties().size() > 0);
    } 
 
    public void testConnectionCachingIsEnabledByDefault() throws Exception {
        Object bean = this.beanFactory.getBean("cachingByDefaultDataSource");
        assertEquals("not the correct class", "oracle.jdbc.pool.OracleDataSource", bean.getClass().getName());
        assertTrue("caching not enabled", ((OracleDataSource)bean).getConnectionCachingEnabled());
    } 
 
    public void testConnectionCachingCanBeDisabled() throws Exception {
        Object bean = this.beanFactory.getBean("nonCachingDataSource");
        assertEquals("not the correct class", "oracle.jdbc.pool.OracleDataSource", bean.getClass().getName());
        assertTrue("caching not enabled", !((OracleDataSource)bean).getConnectionCachingEnabled());
    } 
 
    public void testConnectionCachingDisabledViaProperties() throws Exception {
        Object bean = this.beanFactory.getBean("nonCachingDataSourceUsingProperties");
        assertEquals("not the correct class", "oracle.jdbc.pool.OracleDataSource", bean.getClass().getName());
        assertTrue("caching not enabled", !((OracleDataSource)bean).getConnectionCachingEnabled());
Experience pair programming with AI  Get Codota for Java