fix test cases to cover empty and null, and resolveHostName