1 21 22 package org.opensubsystems.core.persist.db.connectionpool; 23 24 import java.sql.Connection ; 25 import java.util.Iterator ; 26 import java.util.List ; 27 28 import junit.extensions.TestSetup; 29 import junit.framework.Test; 30 import junit.framework.TestSuite; 31 32 import org.opensubsystems.core.error.OSSInternalErrorException; 33 import org.opensubsystems.core.persist.db.DatabaseTestSetup; 34 import org.opensubsystems.core.persist.db.DatabaseTestSuite; 35 36 44 public final class ProxoolDatabaseConnectionFactoryTest 45 { 46 48 51 private ProxoolDatabaseConnectionFactoryTest( 52 ) 53 { 54 } 56 57 59 65 public static Test suite( 66 ) 67 { 68 TestSuite suite = new DatabaseTestSuite("ProxoolDatabaseConnectionFactoryTest"); 69 suite.addTestSuite(ProxoolDatabaseConnectionFactoryTestInternal.class); 70 TestSetup wrapper = new DatabaseTestSetup(suite); 71 72 return wrapper; 73 } 74 75 80 public static class ProxoolDatabaseConnectionFactoryTestInternal 81 extends PooledDatabaseConnectionFactoryImplBaseTest 82 { 83 88 public ProxoolDatabaseConnectionFactoryTestInternal( 89 String strTestName 90 ) 91 { 92 super(strTestName); 93 } 94 95 100 protected void setUp( 101 ) throws Exception 102 { 103 m_connectionFactory = new ProxoolDatabaseConnectionFactoryImpl(); 105 106 super.setUp(); 107 } 108 109 112 protected boolean containsConnection( 113 List lstConnections, 114 Connection newConnection 115 ) throws OSSInternalErrorException 116 { 117 Connection cConnectionFromList = null; 118 Iterator itHelp; 119 boolean bReturn = false; 120 121 124 itHelp = lstConnections.iterator(); 127 while (itHelp.hasNext()) 128 { 129 cConnectionFromList = (Connection )itHelp.next(); 130 bReturn = bReturn || (cConnectionFromList == newConnection); 147 } 148 149 return bReturn; 150 } 151 } 152 } 153 | Popular Tags |