mirror of https://github.com/apache/druid.git
Fix max connections in DruidAvaticaHandlerTest (#5188)
* Fix max connections in DruidAvaticaHandlerTest * Fix additional tests * Added comment
This commit is contained in:
parent
6582b16a81
commit
ba873c614b
|
@ -96,7 +96,8 @@ public class DruidAvaticaHandlerTest
|
||||||
@Override
|
@Override
|
||||||
public int getMaxConnections()
|
public int getMaxConnections()
|
||||||
{
|
{
|
||||||
return 2;
|
// This must match the number of Connection objects created in setUp()
|
||||||
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -667,9 +668,13 @@ public class DruidAvaticaHandlerTest
|
||||||
final Connection connection2 = DriverManager.getConnection(url);
|
final Connection connection2 = DriverManager.getConnection(url);
|
||||||
final Statement statement2 = connection2.createStatement();
|
final Statement statement2 = connection2.createStatement();
|
||||||
|
|
||||||
expectedException.expect(AvaticaClientRuntimeException.class);
|
|
||||||
expectedException.expectMessage("Too many connections, limit is[2]");
|
|
||||||
final Connection connection3 = DriverManager.getConnection(url);
|
final Connection connection3 = DriverManager.getConnection(url);
|
||||||
|
final Statement statement3 = connection3.createStatement();
|
||||||
|
|
||||||
|
expectedException.expect(AvaticaClientRuntimeException.class);
|
||||||
|
expectedException.expectMessage("Too many connections, limit is[3]");
|
||||||
|
|
||||||
|
final Connection connection4 = DriverManager.getConnection(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -682,6 +687,9 @@ public class DruidAvaticaHandlerTest
|
||||||
connection2.createStatement().close();
|
connection2.createStatement().close();
|
||||||
|
|
||||||
final Connection connection3 = DriverManager.getConnection(url);
|
final Connection connection3 = DriverManager.getConnection(url);
|
||||||
|
connection3.createStatement().close();
|
||||||
|
|
||||||
|
final Connection connection4 = DriverManager.getConnection(url);
|
||||||
Assert.assertTrue(true);
|
Assert.assertTrue(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue