@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));
}