public void testManyConnectionsUsingManyThreads(){
  int numTasks=getConnectionNum();
  ThreadPool threadPool=new ThreadPool(numTasks);
  for (int i=0; i < numTasks; i++) {
    threadPool.runTask(createTask(i));
  }
  threadPool.join();
  assertEquals("Unable to create a connection",numTasks,vc.size());
  if (numTasks != Support_SQL.sqlMaxConnections) {
    try {
      Connection c=Support_SQL.getConnection();
      c.close();
      fail("It is possible to create more than " + numTasks + "connections");
    }
 catch (    SQLException sql) {
    }
  }
}

public void testManyConnectionsUsingManyThreads ( ) { int numTasks = getConnectionNum ( ) ; ThreadPool threadPool = new ThreadPool ( numTasks ) ; for ( int i = 0 ; i < numTasks ; i ++ ) { threadPool . runTask ( createTask ( i ) ) ; } threadPool . join ( ) ; assertEquals ( "Unable to create a connection" , numTasks , vc . size ( ) ) ; if ( numTasks != Support_SQL . sqlMaxConnections ) { try { Connection c = Support_SQL . getConnection ( ) ; c . close ( ) ; fail ( "It is possible to create more than " + numTasks + "connections" ) ; } catch ( SQLException sql ) { } } }
stresstest # testmanyconnectionsusingmanythreads ( ) . create many connections to the database using some threads .
