/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.apache.tomcat.jdbc.test;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

import javax.sql.PooledConnection;


import org.apache.tomcat.jdbc.pool.interceptor.QueryTimeoutInterceptor;
import org.apache.tomcat.jdbc.test.driver.Driver;


public class TestQueryTimeoutInterceptor extends DefaultTestCase {

    private static final int iterations = 500000; //(new Random(System.currentTimeMillis())).nextInt(1000000)+100000;
    public TestQueryTimeoutInterceptor(String name) {
        super(name);
    }
    
    public void testTimeout() throws Exception {
        long start = System.currentTimeMillis();
        int timeout = 10;
        int withoutuser =10;
        int withuser = withoutuser;
        this.init();
        this.datasource.setMaxActive(withuser+withoutuser);
        this.datasource.setJdbcInterceptors(QueryTimeoutInterceptor.class.getName()+"(queryTimeout="+timeout+")");
        this.datasource.setDriverClassName(Driver.class.getName());
        this.datasource.setUrl("jdbc:tomcat:test");
        Connection con = this.datasource.getConnection();
        Statement st = con.createStatement();
        assertEquals(st.getClass().getName(),timeout,st.getQueryTimeout());
        st.close();
        st = con.prepareStatement("");
        assertEquals(st.getClass().getName(),timeout,st.getQueryTimeout());
        st.close();
        st = con.prepareCall("");
        assertEquals(st.getClass().getName(),timeout,st.getQueryTimeout());
        st.close();
        con.close();
    }
}

@@ -915,300 +915,17 @@
 ql.S
-QLException;%0D%0Aimport java.sql.Statement;%0D%0Aimport java.util.Arrays;%0D%0Aimport java.util.List;%0D%0Aimport java.util.concurrent.Callable;%0D%0Aimport java.util.concurrent.ExecutorService;%0D%0Aimport java.util.concurrent.Executors;%0D%0Aimport java.util.concurrent.Future;%0D%0A%0D%0Aimport javax.sql.PooledConnection;%0D%0A
+tatement;
 %0D%0A%0D%0A
@@ -1126,127 +1126,8 @@
 %0D%0A%0D%0A
-    private static final int iterations = 500000; //(new Random(System.currentTimeMillis())).nextInt(1000000)+100000;%0D%0A
     
@@ -1206,20 +1206,16 @@
 %0A    %7D%0D%0A
-    
 %0D%0A    pu
@@ -1262,58 +1262,8 @@
  %7B%0D%0A
-        long start = System.currentTimeMillis();%0D%0A
     

Remove unused code