Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 e9e9cce81 -> 9c62dadf9


HBASE-13524 TestReplicationAdmin fails on JDK 1.8


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9c62dadf
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9c62dadf
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9c62dadf

Branch: refs/heads/branch-1.1
Commit: 9c62dadf9008ff7ee42f8e935f18cef354b9c372
Parents: e9e9cce
Author: Elliott Clark <ecl...@apache.org>
Authored: Tue Apr 21 11:13:52 2015 -0700
Committer: Elliott Clark <ecl...@apache.org>
Committed: Tue Apr 21 17:06:23 2015 -0700

----------------------------------------------------------------------
 .../client/replication/TestReplicationAdmin.java    | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/9c62dadf/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java
index c0c662f..8a83608 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java
@@ -166,11 +166,23 @@ public class TestReplicationAdmin {
 
     // append table t2 to replication
     admin.appendPeerTableCFs(ID_ONE, "t2");
-    assertEquals("t2;t1", admin.getPeerTableCFs(ID_ONE));
+    String peerTablesOne = admin.getPeerTableCFs(ID_ONE);
+
+    // Different jdk's return different sort order for the tables. ( Not sure 
on why exactly )
+    //
+    // So instead of asserting that the string is exactly we
+    // assert that the string contains all tables and the needed separator.
+    assertTrue("Should contain t1", peerTablesOne.contains("t1"));
+    assertTrue("Should contain t2", peerTablesOne.contains("t2"));
+    assertTrue("Should contain ; as the seperator", 
peerTablesOne.contains(";"));
 
     // append table column family: f1 of t3 to replication
     admin.appendPeerTableCFs(ID_ONE, "t3:f1");
-    assertEquals("t3:f1;t2;t1", admin.getPeerTableCFs(ID_ONE));
+    String peerTablesTwo = admin.getPeerTableCFs(ID_ONE);
+    assertTrue("Should contain t1", peerTablesTwo.contains("t1"));
+    assertTrue("Should contain t2", peerTablesTwo.contains("t2"));
+    assertTrue("Should contain t3:f1", peerTablesTwo.contains("t3:f1"));
+    assertTrue("Should contain ; as the seperator", 
peerTablesTwo.contains(";"));
     admin.removePeer(ID_ONE);
   }
 

Reply via email to