    @Test
    public void testMBeanRegisteredThroughFactory() throws Exception {

        final ManagedBasicDataSource testDataSource = (ManagedBasicDataSource) ManagedBasicDataSourceFactory.createDataSource(new Properties());
        assertTrue(getMBeanServerConnection().isRegistered(new ObjectName(testDataSource.getMBeanName())));
    }