01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.commons.dbcp;
19:
20: import java.sql.Connection;
21: import java.sql.DriverManager;
22:
23: import junit.framework.Test;
24: import junit.framework.TestSuite;
25:
26: /**
27: * @author Rodney Waldhoff
28: * @version $Revision: 479137 $ $Date: 2006-11-25 08:51:48 -0700 (Sat, 25 Nov 2006) $
29: */
30: public class TestJOCLed extends TestConnectionPool {
31: public TestJOCLed(String testName) {
32: super (testName);
33: if (null == System.getProperty("org.xml.sax.driver")) {
34: System.setProperty("org.xml.sax.driver",
35: "org.apache.xerces.parsers.SAXParser");
36: }
37: }
38:
39: public static Test suite() {
40: return new TestSuite(TestJOCLed.class);
41: }
42:
43: protected Connection getConnection() throws Exception {
44: return DriverManager
45: .getConnection("jdbc:apache:commons:dbcp:/testpool");
46: }
47:
48: private PoolingDriver driver = null;
49:
50: public void setUp() throws Exception {
51: super .setUp();
52: driver = new PoolingDriver();
53: PoolingDriver.setAccessToUnderlyingConnectionAllowed(true);
54: }
55:
56: public void tearDown() throws Exception {
57: driver.closePool("testpool");
58: DriverManager.deregisterDriver(driver);
59: super.tearDown();
60: }
61:
62: }
|