KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > dbcp > TestJOCLed


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.commons.dbcp;
18
19 import java.sql.Connection JavaDoc;
20 import java.sql.DriverManager JavaDoc;
21
22 import junit.framework.Test;
23 import junit.framework.TestSuite;
24
25 /**
26  * @author Rodney Waldhoff
27  * @version $Revision: 1.8 $ $Date: 2004/05/20 17:54:50 $
28  */

29 public class TestJOCLed extends TestConnectionPool {
30     public TestJOCLed(String JavaDoc testName) {
31         super(testName);
32         if(null == System.getProperty("org.xml.sax.driver")) {
33             System.setProperty("org.xml.sax.driver","org.apache.xerces.parsers.SAXParser");
34         }
35     }
36
37     public static Test suite() {
38         return new TestSuite(TestJOCLed.class);
39     }
40
41     protected Connection JavaDoc getConnection() throws Exception JavaDoc {
42         return DriverManager.getConnection("jdbc:apache:commons:dbcp:/testpool");
43     }
44
45     private PoolingDriver driver = null;
46     
47     public void setUp() throws Exception JavaDoc {
48         driver = new PoolingDriver();
49         PoolingDriver.setAccessToUnderlyingConnectionAllowed(true);
50     }
51
52     public void tearDown() throws Exception JavaDoc {
53         driver.closePool("testpool");
54         DriverManager.deregisterDriver(driver);
55     }
56
57 }
58
Popular Tags