hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1518330 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java
Date Wed, 28 Aug 2013 19:16:27 GMT
Author: stack
Date: Wed Aug 28 19:16:27 2013
New Revision: 1518330

URL: http://svn.apache.org/r1518330
Log:
HBASE-9367 TestRegionServerCoprocessorExceptionWithAbort.testExceptionFromCoprocessorDuringPut
fails

Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java?rev=1518330&r1=1518329&r2=1518330&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionServerCoprocessorExceptionWithAbort.java
Wed Aug 28 19:16:27 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



Mime
View raw message