apurtell commented on a change in pull request #1879:
URL: https://github.com/apache/hbase/pull/1879#discussion_r437738544



##########
File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestHQuorumPeer.java
##########
@@ -111,25 +115,39 @@
     QuorumPeerConfig config = new QuorumPeerConfig();
     config.parseProperties(properties);
 
-    assertEquals(this.dataDir.toString(), config.getDataDir());
+    assertEquals(this.dataDir.toString(), config.getDataDir().toString());
     assertEquals(2181, config.getClientPortAddress().getPort());
     Map<Long,QuorumServer> servers = config.getServers();
     assertEquals(3, servers.size());
     assertTrue(servers.containsKey(Long.valueOf(0)));
     QuorumServer server = servers.get(Long.valueOf(0));
-    assertEquals("localhost", server.addr.getHostName());
+    assertEquals("localhost", getHostName(server));
 
     // Override with system property.
     System.setProperty("hbase.master.hostname", "foo.bar");
     is = new ByteArrayInputStream(s.getBytes());
     properties = ZKConfig.parseZooCfg(conf, is);
     assertEquals("foo.bar:2888:3888", properties.get("server.0"));
-
     config.parseProperties(properties);
 
     servers = config.getServers();
     server = servers.get(Long.valueOf(0));
-    assertEquals("foo.bar", server.addr.getHostName());
+    assertEquals("foo.bar", getHostName(server));
+  }
+
+  private static String getHostName(QuorumServer server) throws Exception {
+    String hostname;
+    switch (server.addr.getClass().getName()) {

Review comment:
       I can add a comment. I think the cross-version issues are clear enough 
by this resort to reflection :-( 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to