Search in sources :

Example 1 with PoolableWrapper

use of com.alibaba.druid.pool.PoolableWrapper in project druid by alibaba.

the class PoolableWrapperTest method test_unwrap.

public void test_unwrap() throws Exception {
    PoolableWrapper wrapper = new PoolableWrapper(new MockConnection());
    Assert.assertEquals(null, wrapper.unwrap(null));
    Assert.assertEquals(true, wrapper.unwrap(PoolableWrapper.class) != null);
    Assert.assertEquals(true, wrapper.unwrap(MockConnection.class) != null);
}
Also used : PoolableWrapper(com.alibaba.druid.pool.PoolableWrapper) MockConnection(com.alibaba.druid.mock.MockConnection)

Example 2 with PoolableWrapper

use of com.alibaba.druid.pool.PoolableWrapper in project druid by alibaba.

the class PoolableWrapperTest method test_isWrapper.

public void test_isWrapper() throws Exception {
    PoolableWrapper wrapper = new PoolableWrapper(new MockConnection());
    Assert.assertEquals(false, wrapper.isWrapperFor(null));
    Assert.assertEquals(true, wrapper.isWrapperFor(PoolableWrapper.class));
    Assert.assertEquals(true, wrapper.isWrapperFor(MockConnection.class));
}
Also used : PoolableWrapper(com.alibaba.druid.pool.PoolableWrapper) MockConnection(com.alibaba.druid.mock.MockConnection)

Aggregations

MockConnection (com.alibaba.druid.mock.MockConnection)2 PoolableWrapper (com.alibaba.druid.pool.PoolableWrapper)2