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
This commit is contained in:
Jim Kellerman 2007-12-17 20:53:45 +00:00
parent 6da6ebed1e
commit c73ddd1aa8
2 changed files with 13 additions and 12 deletions

View File

@ -83,6 +83,7 @@ Trunk (unreleased changes)
HADOOP-2414 Fix ArrayIndexOutOfBoundsException in bloom filters. HADOOP-2414 Fix ArrayIndexOutOfBoundsException in bloom filters.
HADOOP-2430 Master will not shut down if there are no active region servers 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-2199 Add tools for going from hregion filename to region name in logs
HADOOP-2441 Fix build failures in TestHBaseCluster
IMPROVEMENTS IMPROVEMENTS
HADOOP-2401 Add convenience put method that takes writable HADOOP-2401 Add convenience put method that takes writable

View File

@ -25,8 +25,6 @@ import java.util.Set;
import java.util.TreeMap; import java.util.TreeMap;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
/** /**
* Test HBase Master and Region servers, client API * Test HBase Master and Region servers, client API
@ -43,7 +41,6 @@ public class TestHBaseCluster extends HBaseClusterTestCase {
this.desc = null; this.desc = null;
this.admin = null; this.admin = null;
this.table = null; this.table = null;
Logger.getRootLogger().setLevel(Level.INFO);
// Make the thread wake frequency a little slower so other threads // Make the thread wake frequency a little slower so other threads
// can run // can run
@ -116,19 +113,22 @@ public class TestHBaseCluster extends HBaseClusterTestCase {
Text rowlabel = new Text("row_" + k); Text rowlabel = new Text("row_" + k);
byte bodydata[] = table.get(rowlabel, CONTENTS_BASIC); byte bodydata[] = table.get(rowlabel, CONTENTS_BASIC);
assertNotNull("no data for row " + rowlabel, bodydata); assertNotNull("no data for row " + rowlabel + "/" + CONTENTS_BASIC,
String bodystr = new String(bodydata, HConstants.UTF8_ENCODING).trim(); bodydata);
String bodystr = new String(bodydata, HConstants.UTF8_ENCODING);
String teststr = CONTENTSTR + k; String teststr = CONTENTSTR + k;
assertEquals("Incorrect value for key: (" + rowlabel + "," + CONTENTS_BASIC assertTrue("Incorrect value for key: (" + rowlabel + "/" +
+ "), expected: '" + teststr + "' got: '" + bodystr + "'", CONTENTS_BASIC + "), expected: '" + teststr + "' got: '" +
bodystr, teststr); bodystr + "'", teststr.compareTo(bodystr) == 0);
collabel = new Text(ANCHORNUM + k); collabel = new Text(ANCHORNUM + k);
bodydata = table.get(rowlabel, collabel); 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; teststr = ANCHORSTR + k;
assertEquals("Incorrect value for key: (" + rowlabel + "," + collabel assertTrue("Incorrect value for key: (" + rowlabel + "/" + collabel +
+ "), expected: '" + teststr + "' got: '" + bodystr + "'", "), expected: '" + teststr + "' got: '" + bodystr + "'",
bodystr, teststr); teststr.compareTo(bodystr) == 0);
} }
System.out.println("Read " + NUM_VALS + " rows. Elapsed time: " System.out.println("Read " + NUM_VALS + " rows. Elapsed time: "