@Test
public void testConnectionPool() throws SQLException, ObjectCreationException, IOException {

  Server server = Server.createTcpServer(new String[]{"-tcpPort", "9123", "-tcpAllowOthers"}).start();
  try {
    File tempDB = File.createTempFile("test", "h2db");
    String connStr = "jdbc:h2:tcp://localhost:9123/nio:" + tempDB.getAbsolutePath() + ";AUTO_SERVER=TRUE";
    PooledDataSource pds = new PooledDataSource(1, 2, new JdbcConnectionFactory("org.h2.Driver",
            connStr, "sa", "sa"));
    try (Connection conn = pds.getConnection()) {
      Assert.assertTrue(conn.isValid(10));
    }
  } finally {
    server.stop();
  }
}