Search in sources :

Example 1 with DefaultResourceReleaser

use of org.mule.module.artifact.classloader.DefaultResourceReleaser in project mule by mulesoft.

the class ResourceReleaserTestCase method deregisterJdbcDriversSameClassLoaders.

@Test
public void deregisterJdbcDriversSameClassLoaders() throws Exception {
    Driver jdbcDriver = mock(Driver.class);
    registerDriver(jdbcDriver);
    assertThat(list(getDrivers()), hasItem(jdbcDriver));
    new DefaultResourceReleaser().release();
    assertThat(list(getDrivers()), not(hasItem(jdbcDriver)));
}
Also used : DefaultResourceReleaser(org.mule.module.artifact.classloader.DefaultResourceReleaser) DriverManager.registerDriver(java.sql.DriverManager.registerDriver) Driver(java.sql.Driver) DriverManager.deregisterDriver(java.sql.DriverManager.deregisterDriver) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Aggregations

Driver (java.sql.Driver)1 DriverManager.deregisterDriver (java.sql.DriverManager.deregisterDriver)1 DriverManager.registerDriver (java.sql.DriverManager.registerDriver)1 Test (org.junit.Test)1 DefaultResourceReleaser (org.mule.module.artifact.classloader.DefaultResourceReleaser)1 SmallTest (org.mule.tck.size.SmallTest)1