1 6 package org.logicalcobwebs.proxool.configuration; 7 8 import org.apache.commons.logging.Log; 9 import org.apache.commons.logging.LogFactory; 10 import org.logicalcobwebs.proxool.AbstractProxoolTest; 11 import org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF; 12 import org.logicalcobwebs.proxool.ProxoolConstants; 13 import org.logicalcobwebs.proxool.ProxoolFacade; 14 import org.logicalcobwebs.proxool.TestConstants; 15 import org.logicalcobwebs.proxool.TestHelper; 16 17 import java.util.Properties ; 18 19 27 public class ConfiguratorTest extends AbstractProxoolTest { 28 29 private static final Log LOG = LogFactory.getLog(ConfiguratorTest.class); 30 31 private static final String TEST_TABLE = "test"; 32 33 36 public ConfiguratorTest(String name) { 37 super(name); 38 } 39 40 public void testConfigurator() throws Exception { 41 42 String testName = "configurator"; 43 String alias = testName; 44 45 String url = TestHelper.buildProxoolUrl(alias, 46 TestConstants.HYPERSONIC_DRIVER, 47 TestConstants.HYPERSONIC_TEST_URL); 48 Properties info = new Properties (); 49 info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); 50 info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); 51 ProxoolFacade.registerConnectionPool(url, info); 52 53 Properties newInfo = new Properties (); 54 newInfo.setProperty(ProxoolConstants.PROTOTYPE_COUNT_PROPERTY, "3"); 55 ProxoolFacade.updateConnectionPool(url, newInfo); 56 57 final ConnectionPoolDefinitionIF cpd = ProxoolFacade.getConnectionPoolDefinition(alias); 58 assertNotNull("definition is null", cpd); 59 assertEquals("prototypeCount", 3, cpd.getPrototypeCount()); 60 61 } 62 63 } 64 65 146 | Popular Tags |