You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2013/08/28 21:16:45 UTC
svn commit: r1518331 -
/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java
Author: stack
Date: Wed Aug 28 19:16:45 2013
New Revision: 1518331
URL: http://svn.apache.org/r1518331
Log:
HBASE-9367 TestRegionServerCoprocessorExceptionWithAbort.testExceptionFromCoprocessorDuringPut fails
Modified:
hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java
Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java?rev=1518331&r1=1518330&r2=1518331&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java (original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java Wed Aug 28 19:16:45 2013
@@ -21,7 +21,6 @@ package org.apache.hadoop.hbase.coproces
import java.io.IOException;
-import junit.framework.Assert;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
@@ -33,6 +32,7 @@ import org.apache.hadoop.hbase.regionser
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
import org.junit.AfterClass;
+import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -49,6 +49,7 @@ import static org.junit.Assert.*;
public class TestRegionServerCoprocessorExceptionWithAbort {
static final Log LOG = LogFactory.getLog(TestRegionServerCoprocessorExceptionWithAbort.class);
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
+ private static final byte[] ROW = Bytes.toBytes("aaa");
private static final TableName TABLE_NAME =
TableName.valueOf("observed_table");
@@ -82,13 +83,12 @@ public class TestRegionServerCoprocessor
// Note which regionServer will abort (after put is attempted).
final HRegionServer regionServer = TEST_UTIL.getRSForFirstRegionInTable(TEST_TABLE);
-
- final byte[] ROW = Bytes.toBytes("aaa");
Put put = new Put(ROW);
put.add(TEST_FAMILY, ROW, ROW);
Assert.assertFalse("The region server should be available", regionServer.isAborted());
try {
+ LOG.info("Running put " + put);
table.put(put);
fail("The put should have failed, as the coprocessor is buggy");
} catch (IOException ignored) {
@@ -105,10 +105,9 @@ public class TestRegionServerCoprocessor
final Durability durability) {
TableName tableName =
c.getEnvironment().getRegion().getRegionInfo().getTableName();
- if (TABLE_NAME.equals(tableName)) {
- throw new NullPointerException("Buggy coprocessor");
+ if (TABLE_NAME.equals(tableName) && Bytes.equals(put.getRow(), ROW)) {
+ throw new NullPointerException("Buggy coprocessor: " + put);
}
}
}
-
-}
+}
\ No newline at end of file