}
public void testBug35810() throws Exception {
int defaultConnectTimeout = ((ConnectionProperties) this.conn).getConnectTimeout();
int nonDefaultConnectTimeout = defaultConnectTimeout + 1000 * 2;
MysqlConnectionPoolDataSource cpds = new MysqlConnectionPoolDataSource();
String dsUrl = BaseTestCase.dbUrl;
if (dsUrl.indexOf("?") == -1) {
dsUrl += "?";
} else {
dsUrl += "&";
}
dsUrl += "connectTimeout=" + nonDefaultConnectTimeout;
cpds.setUrl(dsUrl);
Connection dsConn = cpds.getPooledConnection().getConnection();
int configuredConnectTimeout = ((ConnectionProperties) dsConn).getConnectTimeout();
assertEquals("Connect timeout spec'd by URL didn't take", nonDefaultConnectTimeout, configuredConnectTimeout);
assertFalse("Connect timeout spec'd by URL didn't take", defaultConnectTimeout == configuredConnectTimeout);
}