}
public void testLeak() throws Throwable {
TestRunnable runners[] = new TestRunnable[RUNNER_COUNT];
for (int i = 0; i < RUNNER_COUNT; i++) {
ClientThread thread = new HsqlDialectEpsgMediatorStressTest.ClientThread(i, mediator);
thread.iterations = ITERATIONS;
runners[i] = thread;
}
MultiThreadedTestRunner mttr = new MultiThreadedTestRunner(runners, null);
mttr.runTestRunnables(MAX_TIME);
//count exceptions and metrics
int exceptions = 0;
for (int i = 0; i < RUNNER_COUNT; i++) {
ClientThread thread = (ClientThread) runners[i];
exceptions += thread.exceptions;
}
//destroy the mediator, check for open connections or exceptions
mediator.dispose();
assertEquals(0, datasource.getNumActive());