Skip to content

Commit

Permalink
fixing baos violation (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
emopers authored and garydgregory committed Oct 15, 2019
1 parent af38a4e commit 8c8c901
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -273,13 +273,15 @@ public void testStackTrace() throws Exception {
abandonedConfig.setLogAbandoned(true);
abandonedConfig.setRemoveAbandonedTimeout(1);
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final PrintWriter pw = new PrintWriter(new BufferedOutputStream(baos));
final BufferedOutputStream bos = new BufferedOutputStream(baos);
final PrintWriter pw = new PrintWriter(bos);
abandonedConfig.setLogWriter(pw);
pool.setAbandonedConfig(abandonedConfig);
pool.setTimeBetweenEvictionRunsMillis(100);
final PooledTestObject o1 = pool.borrowObject();
Thread.sleep(2000);
Assert.assertTrue(o1.isDestroyed());
bos.flush();
Assert.assertTrue(baos.toString().indexOf("Pooled object") >= 0);
}

Expand Down

0 comments on commit 8c8c901

Please sign in to comment.