@Test public void testPoolDescriptor() { poolDescriptor = new PoolDescriptor("test-server", "test-jdbcUrl", connConfig, poolConfig, null); assertEquals("test-server", poolDescriptor.getServer()); assertEquals("test-jdbcUrl", poolDescriptor.getJdbcUrl()); assertEquals("test-password", poolDescriptor.getPassword()); assertNotEquals(connConfig, poolDescriptor.getConnectionConfig()); connConfig.remove("user"); connConfig.remove("password"); assertEquals(connConfig, poolDescriptor.getConnectionConfig()); assertNotSame(connConfig, poolDescriptor.getConnectionConfig()); assertEquals(poolConfig, poolDescriptor.getPoolConfig()); assertNotSame(poolConfig, poolDescriptor.getPoolConfig()); }
public PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier) { this.server = server; this.jdbcUrl = jdbcUrl; if (connectionConfig != null) { this.connectionConfig = (Properties) connectionConfig.clone(); this.user = (String) this.connectionConfig.remove(USER_PROPERTY_NAME); this.password = (String) this.connectionConfig.remove(PASSWORD_PROPERTY_NAME); } this.poolConfig = (Properties) poolConfig.clone(); this.qualifier = qualifier; PROHIBITED_PROPERTIES.forEach(p -> ensurePoolPropertyNotPresent(p)); }
PoolDescriptor { public PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier) { this.server = server; this.jdbcUrl = jdbcUrl; if (connectionConfig != null) { this.connectionConfig = (Properties) connectionConfig.clone(); this.user = (String) this.connectionConfig.remove(USER_PROPERTY_NAME); this.password = (String) this.connectionConfig.remove(PASSWORD_PROPERTY_NAME); } this.poolConfig = (Properties) poolConfig.clone(); this.qualifier = qualifier; PROHIBITED_PROPERTIES.forEach(p -> ensurePoolPropertyNotPresent(p)); } }
PoolDescriptor { public PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier) { this.server = server; this.jdbcUrl = jdbcUrl; if (connectionConfig != null) { this.connectionConfig = (Properties) connectionConfig.clone(); this.user = (String) this.connectionConfig.remove(USER_PROPERTY_NAME); this.password = (String) this.connectionConfig.remove(PASSWORD_PROPERTY_NAME); } this.poolConfig = (Properties) poolConfig.clone(); this.qualifier = qualifier; PROHIBITED_PROPERTIES.forEach(p -> ensurePoolPropertyNotPresent(p)); } PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier); }
PoolDescriptor { public PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier) { this.server = server; this.jdbcUrl = jdbcUrl; if (connectionConfig != null) { this.connectionConfig = (Properties) connectionConfig.clone(); this.user = (String) this.connectionConfig.remove(USER_PROPERTY_NAME); this.password = (String) this.connectionConfig.remove(PASSWORD_PROPERTY_NAME); } this.poolConfig = (Properties) poolConfig.clone(); this.qualifier = qualifier; PROHIBITED_PROPERTIES.forEach(p -> ensurePoolPropertyNotPresent(p)); } PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier); String getServer(); String getJdbcUrl(); String getUser(); String getPassword(); Properties getConnectionConfig(); Properties getPoolConfig(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
PoolDescriptor { public PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier) { this.server = server; this.jdbcUrl = jdbcUrl; if (connectionConfig != null) { this.connectionConfig = (Properties) connectionConfig.clone(); this.user = (String) this.connectionConfig.remove(USER_PROPERTY_NAME); this.password = (String) this.connectionConfig.remove(PASSWORD_PROPERTY_NAME); } this.poolConfig = (Properties) poolConfig.clone(); this.qualifier = qualifier; PROHIBITED_PROPERTIES.forEach(p -> ensurePoolPropertyNotPresent(p)); } PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier); String getServer(); String getJdbcUrl(); String getUser(); String getPassword(); Properties getConnectionConfig(); Properties getPoolConfig(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }