Try alternative class loader.

pull/192/head
Brett Wooldridge 10 years ago
parent ed67c24665
commit 682826efe5

@ -109,9 +109,8 @@ public class MiscTest
Connection connection = ds.getConnection();
PoolUtilities.quietlySleep(TimeUnit.SECONDS.toMillis(3));
ps.flush();
connection.close();
ps.close();
connection.close();
String s = new String(baos.toByteArray());
Assert.assertTrue(s.contains("Connection leak detection"));
}

@ -77,7 +77,7 @@ public final class TestElf
{
SimpleLogger simpleLogger = (SimpleLogger) LoggerFactory.getLogger(clazz);
try {
Field field = SimpleLogger.class.getDeclaredField("TARGET_STREAM");
Field field = clazz.getClassLoader().loadClass("org.slf4j.impl.SimpleLogger").getDeclaredField("TARGET_STREAM");
field.setAccessible(true);
field.set(simpleLogger, stream);
}

@ -109,9 +109,8 @@ public class MiscTest
Connection connection = ds.getConnection();
PoolUtilities.quietlySleep(TimeUnit.SECONDS.toMillis(3));
ps.flush();
connection.close();
ps.close();
connection.close();
String s = new String(baos.toByteArray());
Assert.assertTrue(s.contains("Connection leak detection"));
}

@ -77,7 +77,7 @@ public final class TestElf
{
SimpleLogger simpleLogger = (SimpleLogger) LoggerFactory.getLogger(clazz);
try {
Field field = SimpleLogger.class.getDeclaredField("TARGET_STREAM");
Field field = clazz.getClassLoader().loadClass("org.slf4j.impl.SimpleLogger").getDeclaredField("TARGET_STREAM");
field.setAccessible(true);
field.set(simpleLogger, stream);
}

Loading…
Cancel
Save