Stay backwards compatible to Java 6 in test classes

(getHostString() is available but protected in Java 6)

We could still use this function with Java 6 using reflection, but that would be overkill for tests only ;-)