From c73ddd1aa894e944a37cbcfb6e29782ccbaabcab Mon Sep 17 00:00:00 2001 From: Jim Kellerman Date: Mon, 17 Dec 2007 20:53:45 +0000 Subject: [PATCH] HADOOP-2441 Fix build failures in TestHBaseCluster git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk/src/contrib/hbase@604999 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../apache/hadoop/hbase/TestHBaseCluster.java | 24 +++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 34b54ac7d7e..2aa0468870a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -83,6 +83,7 @@ Trunk (unreleased changes) HADOOP-2414 Fix ArrayIndexOutOfBoundsException in bloom filters. HADOOP-2430 Master will not shut down if there are no active region servers HADOOP-2199 Add tools for going from hregion filename to region name in logs + HADOOP-2441 Fix build failures in TestHBaseCluster IMPROVEMENTS HADOOP-2401 Add convenience put method that takes writable diff --git a/src/test/org/apache/hadoop/hbase/TestHBaseCluster.java b/src/test/org/apache/hadoop/hbase/TestHBaseCluster.java index 05cdb3996e1..925e8613b17 100644 --- a/src/test/org/apache/hadoop/hbase/TestHBaseCluster.java +++ b/src/test/org/apache/hadoop/hbase/TestHBaseCluster.java @@ -25,8 +25,6 @@ import java.util.Set; import java.util.TreeMap; import org.apache.hadoop.io.Text; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; /** * Test HBase Master and Region servers, client API @@ -43,7 +41,6 @@ public class TestHBaseCluster extends HBaseClusterTestCase { this.desc = null; this.admin = null; this.table = null; - Logger.getRootLogger().setLevel(Level.INFO); // Make the thread wake frequency a little slower so other threads // can run @@ -116,19 +113,22 @@ public class TestHBaseCluster extends HBaseClusterTestCase { Text rowlabel = new Text("row_" + k); byte bodydata[] = table.get(rowlabel, CONTENTS_BASIC); - assertNotNull("no data for row " + rowlabel, bodydata); - String bodystr = new String(bodydata, HConstants.UTF8_ENCODING).trim(); + assertNotNull("no data for row " + rowlabel + "/" + CONTENTS_BASIC, + bodydata); + String bodystr = new String(bodydata, HConstants.UTF8_ENCODING); String teststr = CONTENTSTR + k; - assertEquals("Incorrect value for key: (" + rowlabel + "," + CONTENTS_BASIC - + "), expected: '" + teststr + "' got: '" + bodystr + "'", - bodystr, teststr); + assertTrue("Incorrect value for key: (" + rowlabel + "/" + + CONTENTS_BASIC + "), expected: '" + teststr + "' got: '" + + bodystr + "'", teststr.compareTo(bodystr) == 0); + collabel = new Text(ANCHORNUM + k); bodydata = table.get(rowlabel, collabel); - bodystr = new String(bodydata, HConstants.UTF8_ENCODING).trim(); + assertNotNull("no data for row " + rowlabel + "/" + collabel, bodydata); + bodystr = new String(bodydata, HConstants.UTF8_ENCODING); teststr = ANCHORSTR + k; - assertEquals("Incorrect value for key: (" + rowlabel + "," + collabel - + "), expected: '" + teststr + "' got: '" + bodystr + "'", - bodystr, teststr); + assertTrue("Incorrect value for key: (" + rowlabel + "/" + collabel + + "), expected: '" + teststr + "' got: '" + bodystr + "'", + teststr.compareTo(bodystr) == 0); } System.out.println("Read " + NUM_VALS + " rows. Elapsed time: "