@Throws(Exception::class) fun testBug77649() { var props: Properties = getPropertiesFromTestsuiteUrl() val host = props.getProperty(NonRegisteringDriver.HOST_PROPERTY_KEY) val port = props.getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY) val hosts = arrayOf(host, "address", "address.somewhere", "addressing", "addressing.somewhere") UnreliableSocketFactory.flushAllStaticData() for (i in 1 until hosts.size) { UnreliableSocketFactory.mapHost(hosts[i], host) } props = getHostFreePropertiesFromTestsuiteUrl() props.setProperty("socketFactory", UnreliableSocketFactory::class.java.getName()) for (h in hosts) { getConnectionWithProps(String.format("jdbc:mysql://%s:%s", h, port), props).close() getConnectionWithProps( String.format( "jdbc:mysql://address=(protocol=tcp)(host=%s)(port=%s)", h, port ), props ).close() } }
Tests fix for Bug # 77649 - URL start with word `` address '' , JDBC ca n't parse the `` host : port '' Correctly .