minor cleanup

pull/502/head
Nitin 9 years ago
parent 8277a55c58
commit fc09055538

@ -59,7 +59,7 @@ public class ExceptionTest
connection.close();
Assert.assertTrue("Totals (3) connections not as expected", TestElf.getPool(ds).getTotalConnections() >= 0);
Assert.assertTrue("Total (3) connections not as expected", TestElf.getPool(ds).getTotalConnections() >= 0);
Assert.assertTrue("Idle (3) connections not as expected", TestElf.getPool(ds).getIdleConnections() >= 0);
}

@ -26,7 +26,7 @@ public class RampUpDown
try (HikariDataSource ds = new HikariDataSource(config)) {
ds.setIdleTimeout(1000);
Assert.assertSame("Totals connections not as expected", 5, TestElf.getPool(ds).getTotalConnections());
Assert.assertSame("Total connections not as expected", 5, TestElf.getPool(ds).getTotalConnections());
Connection[] connections = new Connection[ds.getMaximumPoolSize()];
for (int i = 0; i < connections.length; i++)
@ -34,7 +34,7 @@ public class RampUpDown
connections[i] = ds.getConnection();
}
Assert.assertSame("Totals connections not as expected", 60, TestElf.getPool(ds).getTotalConnections());
Assert.assertSame("Total connections not as expected", 60, TestElf.getPool(ds).getTotalConnections());
for (Connection connection : connections)
{
@ -43,7 +43,7 @@ public class RampUpDown
Thread.sleep(2500);
Assert.assertSame("Totals connections not as expected", 5, TestElf.getPool(ds).getTotalConnections());
Assert.assertSame("Total connections not as expected", 5, TestElf.getPool(ds).getTotalConnections());
}
}
}

@ -37,14 +37,12 @@ public class StatementTest
@Test
public void testStatementClose() throws SQLException
{
Connection connection = ds.getConnection();
Assert.assertNotNull(connection);
connection.close();
ds.getConnection().close();
Assert.assertTrue("Total connections not as expected", TestElf.getPool(ds).getTotalConnections() >= 1);
Assert.assertTrue("Idle connections not as expected", TestElf.getPool(ds).getIdleConnections() >= 1);
connection = ds.getConnection();
Connection connection = ds.getConnection();
Assert.assertNotNull(connection);
Assert.assertTrue("Total connections not as expected", TestElf.getPool(ds).getTotalConnections() >= 1);

@ -261,7 +261,7 @@ public class TestConnectionTimeoutRetry
connection6.close();
connection7.close();
Assert.assertSame("Totals connections not as expected", 10, TestElf.getPool(ds).getTotalConnections());
Assert.assertSame("Total connections not as expected", 10, TestElf.getPool(ds).getTotalConnections());
Assert.assertSame("Idle connections not as expected", 10, TestElf.getPool(ds).getIdleConnections());
}
}

@ -324,9 +324,10 @@ public class TestConnections
try (final HikariDataSource ds = new HikariDataSource(config)) {
TestElf.setSlf4jLogLevel(HikariPool.class, Level.DEBUG);
final HikariPool pool = TestElf.getPool(ds);
ds.getConnection().close();
TestElf.setSlf4jLogLevel(HikariPool.class, Level.DEBUG);
Thread[] threads = new Thread[20];
for (int i = 0; i < threads.length; i++) {

@ -45,12 +45,10 @@ public class UnwrapTest
HikariDataSource ds = new HikariDataSource(config);
try {
Connection connection = ds.getConnection();
Assert.assertNotNull(connection);
connection.close();
ds.getConnection().close();
Assert.assertSame("Idle connections not as expected", 1, TestElf.getPool(ds).getIdleConnections());
connection = ds.getConnection();
Connection connection = ds.getConnection();
Assert.assertNotNull(connection);
StubConnection unwrapped = connection.unwrap(StubConnection.class);

Loading…
Cancel
Save