1 16 17 package org.apache.commons.dbcp; 18 19 import java.sql.Connection ; 20 import java.sql.DriverManager ; 21 22 import junit.framework.Test; 23 import junit.framework.TestSuite; 24 25 29 public class TestJOCLed extends TestConnectionPool { 30 public TestJOCLed(String 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 getConnection() throws Exception { 42 return DriverManager.getConnection("jdbc:apache:commons:dbcp:/testpool"); 43 } 44 45 private PoolingDriver driver = null; 46 47 public void setUp() throws Exception { 48 driver = new PoolingDriver(); 49 PoolingDriver.setAccessToUnderlyingConnectionAllowed(true); 50 } 51 52 public void tearDown() throws Exception { 53 driver.closePool("testpool"); 54 DriverManager.deregisterDriver(driver); 55 } 56 57 } 58 | Popular Tags |