Java Code Examples for org.apache.tomcat.jdbc.pool.PoolUtilities

The following examples show how to use org.apache.tomcat.jdbc.pool.PoolUtilities. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Tomcat8-Source-Read   Source File: JmxPasswordTest.java    License: MIT License 5 votes vote down vote up
@Test
public void testPassword() throws Exception {
    Assert.assertEquals("Passwords should match when not using JMX.",password,datasource.getPoolProperties().getPassword());
    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    ConnectionPoolMBean mbean = JMX.newMBeanProxy(mbs, oname, ConnectionPoolMBean.class);
    String jmxPassword = mbean.getPassword();
    Properties jmxProperties = mbean.getDbProperties();
    Assert.assertFalse("Passwords should not match.", password.equals(jmxPassword));
    Assert.assertFalse("Password property should be missing", jmxProperties.containsKey(PoolUtilities.PROP_PASSWORD));
}
 
Example 2
Source Project: Tomcat7.0.67   Source File: JmxPasswordTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testPassword() throws Exception {
    Assert.assertEquals("Passwords should match when not using JMX.",password,datasource.getPoolProperties().getPassword());
    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    ConnectionPoolMBean mbean = JMX.newMBeanProxy(mbs, oname, ConnectionPoolMBean.class);
    String jmxPassword = mbean.getPassword();
    Properties jmxProperties = mbean.getDbProperties();
    Assert.assertFalse("Passwords should not match.", password.equals(jmxPassword));
    Assert.assertFalse("Password property should be missing", jmxProperties.containsKey(PoolUtilities.PROP_PASSWORD));
}
 
Example 3
Source Project: tomcatsrc   Source File: JmxPasswordTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testPassword() throws Exception {
    Assert.assertEquals("Passwords should match when not using JMX.",password,datasource.getPoolProperties().getPassword());
    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    ConnectionPoolMBean mbean = JMX.newMBeanProxy(mbs, oname, ConnectionPoolMBean.class);
    String jmxPassword = mbean.getPassword();
    Properties jmxProperties = mbean.getDbProperties();
    Assert.assertFalse("Passwords should not match.", password.equals(jmxPassword));
    Assert.assertFalse("Password property should be missing", jmxProperties.containsKey(PoolUtilities.PROP_PASSWORD));
}
 
Example 4
Source Project: Tomcat8-Source-Read   Source File: ConnectionPool.java    License: MIT License 4 votes vote down vote up
@Override
public Properties getDbProperties() {
    return PoolUtilities.cloneWithoutPassword(getPoolProperties().getDbProperties());
}
 
Example 5
Source Project: Tomcat7.0.67   Source File: ConnectionPool.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Properties getDbProperties() {
    return PoolUtilities.cloneWithoutPassword(getPoolProperties().getDbProperties());
}
 
Example 6
Source Project: tomcatsrc   Source File: ConnectionPool.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Properties getDbProperties() {
    return PoolUtilities.cloneWithoutPassword(getPoolProperties().getDbProperties());
}