1 package org.logicalcobwebs.proxool.admin.jmx; 2 3 import java.util.Properties ; 4 import java.sql.SQLException ; 5 import java.sql.DriverManager ; 6 7 import org.logicalcobwebs.proxool.AbstractProxoolTest; 8 import org.logicalcobwebs.proxool.TestHelper; 9 import org.logicalcobwebs.proxool.TestConstants; 10 import org.logicalcobwebs.proxool.ProxoolConstants; 11 12 20 public class AbstractJMXTest extends AbstractProxoolTest { 21 24 public AbstractJMXTest(String alias) { 25 super(alias); 26 } 27 28 34 protected Properties createBasicPool(String alias) throws SQLException { 35 final String url = TestHelper.buildProxoolUrl(alias, 36 TestConstants.HYPERSONIC_DRIVER, 37 TestConstants.HYPERSONIC_TEST_URL); 38 final Properties info = createBasicProperties(alias); 39 DriverManager.getConnection(url, info).close(); 40 return info; 41 } 42 43 48 protected Properties createBasicProperties(String alias) { 49 final Properties info = new Properties (); 50 info.setProperty(ProxoolConstants.USER_PROPERTY, TestConstants.HYPERSONIC_USER); 51 info.setProperty(ProxoolConstants.PASSWORD_PROPERTY, TestConstants.HYPERSONIC_PASSWORD); 52 info.setProperty(ProxoolConstants.JMX_PROPERTY, Boolean.TRUE.toString()); 53 info.setProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, alias); 54 return info; 55 } 56 } 57 | Popular Tags |