hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [03/10] hbase git commit: HBASE-9702 Changed unit tests to use method names for tables
Date Mon, 13 Feb 2017 21:29:12 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
index 14b65cf..7c7bfd3 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
@@ -40,8 +40,10 @@ import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.wal.WALFactory;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 import java.io.IOException;
 import java.io.InterruptedIOException;
@@ -62,6 +64,9 @@ public class TestCompactionArchiveConcurrentClose {
   private Path testDir;
   private AtomicBoolean archived = new AtomicBoolean();
 
+  @Rule
+  public TestName name = new TestName();
+
   @Before
   public void setup() throws Exception {
     testUtil = HBaseTestingUtility.createLocalHTU();
@@ -80,7 +85,7 @@ public class TestCompactionArchiveConcurrentClose {
     byte[] col = Bytes.toBytes("c");
     byte[] val = Bytes.toBytes("val");
 
-    TableName tableName = TableName.valueOf(getClass().getSimpleName());
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     HTableDescriptor htd = new HTableDescriptor(tableName);
     htd.addFamily(new HColumnDescriptor(fam));
     HRegionInfo info = new HRegionInfo(tableName, null, null, false);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java
index d9471f9..cf99258 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveIOException.java
@@ -48,8 +48,10 @@ import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.wal.WALFactory;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -67,6 +69,9 @@ public class TestCompactionArchiveIOException {
 
   private Path testDir;
 
+  @Rule
+  public TestName name = new TestName();
+
   @Before
   public void setup() throws Exception {
     testUtil = new HBaseTestingUtility();
@@ -87,7 +92,7 @@ public class TestCompactionArchiveIOException {
     byte[] col = Bytes.toBytes("c");
     byte[] val = Bytes.toBytes("val");
 
-    TableName tableName = TableName.valueOf(getClass().getSimpleName());
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     HTableDescriptor htd = new HTableDescriptor(tableName);
     htd.addFamily(new HColumnDescriptor(fam));
     HRegionInfo info = new HRegionInfo(tableName, null, null, false);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
index 9e83afb..0e6fb54 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java
@@ -39,8 +39,10 @@ import org.apache.hadoop.hbase.testclassification.VerySlowRegionServerTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 /** Unit tests to test retrieving table/region compaction state*/
 @Category({VerySlowRegionServerTests.class, LargeTests.class})
@@ -49,6 +51,9 @@ public class TestCompactionState {
   private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private final static Random random = new Random();
 
+  @Rule
+  public TestName name = new TestName();
+
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster();
@@ -61,48 +66,48 @@ public class TestCompactionState {
 
   @Test(timeout=600000)
   public void testMajorCompaction() throws IOException, InterruptedException {
-    compaction("testMajorCompaction", 8, CompactionState.MAJOR, false);
+    compaction(name.getMethodName(), 8, CompactionState.MAJOR, false);
   }
 
   @Test(timeout=600000)
   public void testMinorCompaction() throws IOException, InterruptedException {
-    compaction("testMinorCompaction", 15, CompactionState.MINOR, false);
+    compaction(name.getMethodName(), 15, CompactionState.MINOR, false);
   }
 
   @Test(timeout=600000)
   public void testMajorCompactionOnFamily() throws IOException, InterruptedException {
-    compaction("testMajorCompactionOnFamily", 8, CompactionState.MAJOR, true);
+    compaction(name.getMethodName(), 8, CompactionState.MAJOR, true);
   }
 
   @Test(timeout=600000)
   public void testMinorCompactionOnFamily() throws IOException, InterruptedException {
-    compaction("testMinorCompactionOnFamily", 15, CompactionState.MINOR, true);
+    compaction(name.getMethodName(), 15, CompactionState.MINOR, true);
   }
 
   @Test
   public void testInvalidColumnFamily() throws IOException, InterruptedException {
-    TableName table = TableName.valueOf("testInvalidColumnFamily");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     byte [] family = Bytes.toBytes("family");
     byte [] fakecf = Bytes.toBytes("fakecf");
     boolean caughtMinorCompact = false;
     boolean caughtMajorCompact = false;
     Table ht = null;
     try {
-      ht = TEST_UTIL.createTable(table, family);
+      ht = TEST_UTIL.createTable(tableName, family);
       Admin admin = TEST_UTIL.getAdmin();
       try {
-        admin.compact(table, fakecf);
+        admin.compact(tableName, fakecf);
       } catch (IOException ioe) {
         caughtMinorCompact = true;
       }
       try {
-        admin.majorCompact(table, fakecf);
+        admin.majorCompact(tableName, fakecf);
       } catch (IOException ioe) {
         caughtMajorCompact = true;
       }
     } finally {
       if (ht != null) {
-        TEST_UTIL.deleteTable(table);
+        TEST_UTIL.deleteTable(tableName);
       }
       assertTrue(caughtMinorCompact);
       assertTrue(caughtMajorCompact);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
index 7c7551a..43c185a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
@@ -948,9 +948,9 @@ public class TestDefaultMemStore {
         conf, FSTableDescriptors.createMetaTableDescriptor(conf),
         wFactory.getMetaWAL(HRegionInfo.FIRST_META_REGIONINFO.
             getEncodedNameAsBytes()));
-    HRegionInfo hri = new HRegionInfo(TableName.valueOf("testShouldFlushMeta"),
+    HRegionInfo hri = new HRegionInfo(TableName.valueOf(name.getMethodName()),
         Bytes.toBytes("row_0200"), Bytes.toBytes("row_0300"));
-    HTableDescriptor desc = new HTableDescriptor(TableName.valueOf("testShouldFlushMeta"));
+    HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     desc.addFamily(new HColumnDescriptor("foo".getBytes()));
     HRegion r =
         HRegion.createHRegion(hri, testDir, conf, desc,

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java
index b0f3468..9dd6885 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDeleteMobTable.java
@@ -37,8 +37,10 @@ import org.apache.hadoop.hbase.util.HFileArchiveUtil;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 @Category(MediumTests.class)
 public class TestDeleteMobTable {
@@ -48,6 +50,9 @@ public class TestDeleteMobTable {
   private final static byte[] QF = Bytes.toBytes("qualifier");
   private static Random random = new Random();
 
+  @Rule
+  public TestName name = new TestName();
+
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster(1);
@@ -103,79 +108,79 @@ public class TestDeleteMobTable {
 
   @Test
   public void testDeleteMobTable() throws Exception {
-    TableName tn = TableName.valueOf("testDeleteMobTable");
-    HTableDescriptor htd = createTableDescriptor(tn, true);
+    final TableName tableName = TableName.valueOf(name.getMethodName());
+    HTableDescriptor htd = createTableDescriptor(tableName, true);
     HColumnDescriptor hcd = htd.getFamily(FAMILY);
 
     String fileName = null;
     Table table = createTableWithOneFile(htd);
     try {
       // the mob file exists
-      Assert.assertEquals(1, countMobFiles(tn, hcd.getNameAsString()));
-      Assert.assertEquals(0, countArchiveMobFiles(tn, hcd.getNameAsString()));
-      fileName = assertHasOneMobRow(table, tn, hcd.getNameAsString());
-      Assert.assertFalse(mobArchiveExist(tn, hcd.getNameAsString(), fileName));
-      Assert.assertTrue(mobTableDirExist(tn));
+      Assert.assertEquals(1, countMobFiles(tableName, hcd.getNameAsString()));
+      Assert.assertEquals(0, countArchiveMobFiles(tableName, hcd.getNameAsString()));
+      fileName = assertHasOneMobRow(table, tableName, hcd.getNameAsString());
+      Assert.assertFalse(mobArchiveExist(tableName, hcd.getNameAsString(), fileName));
+      Assert.assertTrue(mobTableDirExist(tableName));
     } finally {
       table.close();
-      TEST_UTIL.deleteTable(tn);
+      TEST_UTIL.deleteTable(tableName);
     }
 
-    Assert.assertFalse(TEST_UTIL.getAdmin().tableExists(tn));
-    Assert.assertEquals(0, countMobFiles(tn, hcd.getNameAsString()));
-    Assert.assertEquals(1, countArchiveMobFiles(tn, hcd.getNameAsString()));
-    Assert.assertTrue(mobArchiveExist(tn, hcd.getNameAsString(), fileName));
-    Assert.assertFalse(mobTableDirExist(tn));
+    Assert.assertFalse(TEST_UTIL.getAdmin().tableExists(tableName));
+    Assert.assertEquals(0, countMobFiles(tableName, hcd.getNameAsString()));
+    Assert.assertEquals(1, countArchiveMobFiles(tableName, hcd.getNameAsString()));
+    Assert.assertTrue(mobArchiveExist(tableName, hcd.getNameAsString(), fileName));
+    Assert.assertFalse(mobTableDirExist(tableName));
   }
 
   @Test
   public void testDeleteNonMobTable() throws Exception {
-    TableName tn = TableName.valueOf("testDeleteNonMobTable");
-    HTableDescriptor htd = createTableDescriptor(tn, false);
+    final TableName tableName = TableName.valueOf(name.getMethodName());
+    HTableDescriptor htd = createTableDescriptor(tableName, false);
     HColumnDescriptor hcd = htd.getFamily(FAMILY);
 
     Table table = createTableWithOneFile(htd);
     try {
       // the mob file doesn't exist
-      Assert.assertEquals(0, countMobFiles(tn, hcd.getNameAsString()));
-      Assert.assertEquals(0, countArchiveMobFiles(tn, hcd.getNameAsString()));
-      Assert.assertFalse(mobTableDirExist(tn));
+      Assert.assertEquals(0, countMobFiles(tableName, hcd.getNameAsString()));
+      Assert.assertEquals(0, countArchiveMobFiles(tableName, hcd.getNameAsString()));
+      Assert.assertFalse(mobTableDirExist(tableName));
     } finally {
       table.close();
-      TEST_UTIL.deleteTable(tn);
+      TEST_UTIL.deleteTable(tableName);
     }
 
-    Assert.assertFalse(TEST_UTIL.getAdmin().tableExists(tn));
-    Assert.assertEquals(0, countMobFiles(tn, hcd.getNameAsString()));
-    Assert.assertEquals(0, countArchiveMobFiles(tn, hcd.getNameAsString()));
-    Assert.assertFalse(mobTableDirExist(tn));
+    Assert.assertFalse(TEST_UTIL.getAdmin().tableExists(tableName));
+    Assert.assertEquals(0, countMobFiles(tableName, hcd.getNameAsString()));
+    Assert.assertEquals(0, countArchiveMobFiles(tableName, hcd.getNameAsString()));
+    Assert.assertFalse(mobTableDirExist(tableName));
   }
 
   @Test
   public void testMobFamilyDelete() throws Exception {
-    TableName tn = TableName.valueOf("testMobFamilyDelete");
-    HTableDescriptor htd = createTableDescriptor(tn, true);
+    final TableName tableName = TableName.valueOf(name.getMethodName());
+    HTableDescriptor htd = createTableDescriptor(tableName, true);
     HColumnDescriptor hcd = htd.getFamily(FAMILY);
     htd.addFamily(new HColumnDescriptor(Bytes.toBytes("family2")));
 
     Table table = createTableWithOneFile(htd);
     try {
       // the mob file exists
-      Assert.assertEquals(1, countMobFiles(tn, hcd.getNameAsString()));
-      Assert.assertEquals(0, countArchiveMobFiles(tn, hcd.getNameAsString()));
-      String fileName = assertHasOneMobRow(table, tn, hcd.getNameAsString());
-      Assert.assertFalse(mobArchiveExist(tn, hcd.getNameAsString(), fileName));
-      Assert.assertTrue(mobTableDirExist(tn));
-
-      TEST_UTIL.getAdmin().deleteColumnFamily(tn, FAMILY);
-
-      Assert.assertEquals(0, countMobFiles(tn, hcd.getNameAsString()));
-      Assert.assertEquals(1, countArchiveMobFiles(tn, hcd.getNameAsString()));
-      Assert.assertTrue(mobArchiveExist(tn, hcd.getNameAsString(), fileName));
-      Assert.assertFalse(mobColumnFamilyDirExist(tn, hcd.getNameAsString()));
+      Assert.assertEquals(1, countMobFiles(tableName, hcd.getNameAsString()));
+      Assert.assertEquals(0, countArchiveMobFiles(tableName, hcd.getNameAsString()));
+      String fileName = assertHasOneMobRow(table, tableName, hcd.getNameAsString());
+      Assert.assertFalse(mobArchiveExist(tableName, hcd.getNameAsString(), fileName));
+      Assert.assertTrue(mobTableDirExist(tableName));
+
+      TEST_UTIL.getAdmin().deleteColumnFamily(tableName, FAMILY);
+
+      Assert.assertEquals(0, countMobFiles(tableName, hcd.getNameAsString()));
+      Assert.assertEquals(1, countArchiveMobFiles(tableName, hcd.getNameAsString()));
+      Assert.assertTrue(mobArchiveExist(tableName, hcd.getNameAsString(), fileName));
+      Assert.assertFalse(mobColumnFamilyDirExist(tableName, hcd.getNameAsString()));
     } finally {
       table.close();
-      TEST_UTIL.deleteTable(tn);
+      TEST_UTIL.deleteTable(tableName);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java
index a5134ce..3eb86be 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java
@@ -53,8 +53,10 @@ import org.apache.hadoop.hbase.util.Bytes;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 @Category({RegionServerTests.class, MediumTests.class})
 public class TestEncryptionKeyRotation {
@@ -63,6 +65,10 @@ public class TestEncryptionKeyRotation {
   private static final Configuration conf = TEST_UTIL.getConfiguration();
   private static final Key initialCFKey;
   private static final Key secondCFKey;
+
+  @Rule
+  public TestName name = new TestName();
+
   static {
     // Create the test encryption keys
     SecureRandom rng = new SecureRandom();
@@ -93,8 +99,7 @@ public class TestEncryptionKeyRotation {
   @Test
   public void testCFKeyRotation() throws Exception {
     // Create the table schema
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("default",
-      "testCFKeyRotation"));
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("default", name.getMethodName()));
     HColumnDescriptor hcd = new HColumnDescriptor("cf");
     String algorithm =
         conf.get(HConstants.CRYPTO_KEY_ALGORITHM_CONF_KEY, HConstants.CIPHER_AES);
@@ -161,8 +166,7 @@ public class TestEncryptionKeyRotation {
   @Test
   public void testMasterKeyRotation() throws Exception {
     // Create the table schema
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("default",
-      "testMasterKeyRotation"));
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("default", name.getMethodName()));
     HColumnDescriptor hcd = new HColumnDescriptor("cf");
     String algorithm =
         conf.get(HConstants.CRYPTO_KEY_ALGORITHM_CONF_KEY, HConstants.CIPHER_AES);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
index cb4f1c3..9ed0c2a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
@@ -66,11 +66,13 @@ import org.apache.hadoop.hbase.util.StoppableImplementation;
 import org.apache.hadoop.hbase.util.Threads;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.google.common.collect.Iterators;
 import com.google.common.collect.Sets;
+import org.junit.rules.TestName;
 
 @Category(LargeTests.class)
 public class TestEndToEndSplitTransaction {
@@ -78,6 +80,9 @@ public class TestEndToEndSplitTransaction {
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static final Configuration CONF = TEST_UTIL.getConfiguration();
 
+  @Rule
+  public TestName name = new TestName();
+
   @BeforeClass
   public static void beforeAllTests() throws Exception {
     TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 5);
@@ -95,17 +100,16 @@ public class TestEndToEndSplitTransaction {
   @Test
   public void testFromClientSideWhileSplitting() throws Throwable {
     LOG.info("Starting testFromClientSideWhileSplitting");
-    final TableName TABLENAME =
-        TableName.valueOf("testFromClientSideWhileSplitting");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     final byte[] FAMILY = Bytes.toBytes("family");
 
     //SplitTransaction will update the meta table by offlining the parent region, and adding info
     //for daughters.
-    Table table = TEST_UTIL.createTable(TABLENAME, FAMILY);
+    Table table = TEST_UTIL.createTable(tableName, FAMILY);
 
     Stoppable stopper = new StoppableImplementation();
     RegionSplitter regionSplitter = new RegionSplitter(table);
-    RegionChecker regionChecker = new RegionChecker(CONF, stopper, TABLENAME);
+    RegionChecker regionChecker = new RegionChecker(CONF, stopper, tableName);
     final ChoreService choreService = new ChoreService("TEST_SERVER");
 
     choreService.scheduleChore(regionChecker);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java
index 920f172..9a49c5d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFSErrorsExposed.java
@@ -54,8 +54,10 @@ import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.testclassification.RegionServerTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.Assume;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 /**
  * Test cases that ensure that file system level errors are bubbled up
@@ -67,6 +69,9 @@ public class TestFSErrorsExposed {
 
   HBaseTestingUtility util = new HBaseTestingUtility();
 
+  @Rule
+  public TestName name = new TestName();
+
   /**
    * Injects errors into the pread calls of an on-disk file, and makes
    * sure those bubble up to the HFile scanner
@@ -186,7 +191,7 @@ public class TestFSErrorsExposed {
       util.getConfiguration().setInt("hbase.lease.recovery.timeout", 10000);
       util.getConfiguration().setInt("hbase.lease.recovery.dfs.timeout", 1000);
       util.startMiniCluster(1);
-      TableName tableName = TableName.valueOf("table");
+      final TableName tableName = TableName.valueOf(name.getMethodName());
       byte[] fam = Bytes.toBytes("fam");
 
       Admin admin = util.getAdmin();

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushRegionEntry.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushRegionEntry.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushRegionEntry.java
index abd8c59..fe90711 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushRegionEntry.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestFlushRegionEntry.java
@@ -22,11 +22,15 @@ import org.apache.hadoop.hbase.util.ManualEnvironmentEdge;
 import org.apache.hadoop.hbase.regionserver.MemStoreFlusher.FlushRegionEntry;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 @Category({RegionServerTests.class, MediumTests.class})
 public class TestFlushRegionEntry {
+  @Rule
+  public TestName name = new TestName();
 
   @BeforeClass
   public static void setUp() throws Exception {
@@ -42,7 +46,7 @@ public class TestFlushRegionEntry {
 
   @Test
   public void testFlushRegionEntryEquality() {
-    HRegionInfo hri = new HRegionInfo(1, TableName.valueOf("TestTable"), 0);
+    HRegionInfo hri = new HRegionInfo(1, TableName.valueOf(name.getMethodName()), 0);
     HRegion r = mock(HRegion.class);
     doReturn(hri).when(r).getRegionInfo();
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
index 3bdce5d..35f1b7d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
@@ -1338,10 +1338,10 @@ public class TestHRegion {
    */
   @Test
   public void testWeirdCacheBehaviour() throws Exception {
-    TableName TABLE = TableName.valueOf("testWeirdCacheBehaviour");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     byte[][] FAMILIES = new byte[][] { Bytes.toBytes("trans-blob"), Bytes.toBytes("trans-type"),
         Bytes.toBytes("trans-date"), Bytes.toBytes("trans-tags"), Bytes.toBytes("trans-group") };
-    this.region = initHRegion(TABLE, method, CONF, FAMILIES);
+    this.region = initHRegion(tableName, method, CONF, FAMILIES);
     try {
       String value = "this is the value";
       String value2 = "this is some other value";
@@ -1381,8 +1381,8 @@ public class TestHRegion {
 
   @Test
   public void testAppendWithReadOnlyTable() throws Exception {
-    TableName TABLE = TableName.valueOf("readOnlyTable");
-    this.region = initHRegion(TABLE, method, CONF, true, Bytes.toBytes("somefamily"));
+    final TableName tableName = TableName.valueOf(name.getMethodName());
+    this.region = initHRegion(tableName, method, CONF, true, Bytes.toBytes("somefamily"));
     boolean exceptionCaught = false;
     Append append = new Append(Bytes.toBytes("somerow"));
     append.setDurability(Durability.SKIP_WAL);
@@ -1401,8 +1401,8 @@ public class TestHRegion {
 
   @Test
   public void testIncrWithReadOnlyTable() throws Exception {
-    TableName TABLE = TableName.valueOf("readOnlyTable");
-    this.region = initHRegion(TABLE, method, CONF, true, Bytes.toBytes("somefamily"));
+    final TableName tableName = TableName.valueOf(name.getMethodName());
+    this.region = initHRegion(tableName, method, CONF, true, Bytes.toBytes("somefamily"));
     boolean exceptionCaught = false;
     Increment inc = new Increment(Bytes.toBytes("somerow"));
     inc.setDurability(Durability.SKIP_WAL);
@@ -4018,7 +4018,7 @@ public class TestHRegion {
 
   @Test
   public void testAllColumnsWithBloomFilter() throws IOException {
-    byte[] TABLE = Bytes.toBytes("testAllColumnsWithBloomFilter");
+    byte[] TABLE = Bytes.toBytes(name.getMethodName());
     byte[] FAMILY = Bytes.toBytes("family");
 
     // Create table
@@ -4217,7 +4217,7 @@ public class TestHRegion {
   public void testRegionInfoFileCreation() throws IOException {
     Path rootDir = new Path(dir + "testRegionInfoFileCreation");
 
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("testtb"));
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     htd.addFamily(new HColumnDescriptor("cf"));
 
     HRegionInfo hri = new HRegionInfo(htd.getTableName());
@@ -4605,14 +4605,14 @@ public class TestHRegion {
   public void testRegionReplicaSecondary() throws IOException {
     // create a primary region, load some data and flush
     // create a secondary region, and do a get against that
-    Path rootDir = new Path(dir + "testRegionReplicaSecondary");
+    Path rootDir = new Path(dir + name.getMethodName());
     FSUtils.setRootDir(TEST_UTIL.getConfiguration(), rootDir);
 
     byte[][] families = new byte[][] {
         Bytes.toBytes("cf1"), Bytes.toBytes("cf2"), Bytes.toBytes("cf3")
     };
     byte[] cq = Bytes.toBytes("cq");
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("testRegionReplicaSecondary"));
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     for (byte[] family : families) {
       htd.addFamily(new HColumnDescriptor(family));
     }
@@ -4655,14 +4655,14 @@ public class TestHRegion {
   public void testRegionReplicaSecondaryIsReadOnly() throws IOException {
     // create a primary region, load some data and flush
     // create a secondary region, and do a put against that
-    Path rootDir = new Path(dir + "testRegionReplicaSecondary");
+    Path rootDir = new Path(dir + name.getMethodName());
     FSUtils.setRootDir(TEST_UTIL.getConfiguration(), rootDir);
 
     byte[][] families = new byte[][] {
         Bytes.toBytes("cf1"), Bytes.toBytes("cf2"), Bytes.toBytes("cf3")
     };
     byte[] cq = Bytes.toBytes("cq");
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("testRegionReplicaSecondary"));
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     for (byte[] family : families) {
       htd.addFamily(new HColumnDescriptor(family));
     }
@@ -4716,14 +4716,14 @@ public class TestHRegion {
 
   @Test
   public void testCompactionFromPrimary() throws IOException {
-    Path rootDir = new Path(dir + "testRegionReplicaSecondary");
+    Path rootDir = new Path(dir + name.getMethodName());
     FSUtils.setRootDir(TEST_UTIL.getConfiguration(), rootDir);
 
     byte[][] families = new byte[][] {
         Bytes.toBytes("cf1"), Bytes.toBytes("cf2"), Bytes.toBytes("cf3")
     };
     byte[] cq = Bytes.toBytes("cq");
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("testRegionReplicaSecondary"));
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     for (byte[] family : families) {
       htd.addFamily(new HColumnDescriptor(family));
     }
@@ -5691,11 +5691,10 @@ public class TestHRegion {
 
   @Test
   public void testOpenRegionWrittenToWAL() throws Exception {
-    final ServerName serverName = ServerName.valueOf("testOpenRegionWrittenToWAL", 100, 42);
+    final ServerName serverName = ServerName.valueOf(name.getMethodName(), 100, 42);
     final RegionServerServices rss = spy(TEST_UTIL.createMockRegionServerService(serverName));
 
-    HTableDescriptor htd
-        = new HTableDescriptor(TableName.valueOf("testOpenRegionWrittenToWAL"));
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     htd.addFamily(new HColumnDescriptor(fam1));
     htd.addFamily(new HColumnDescriptor(fam2));
 
@@ -5774,7 +5773,7 @@ public class TestHRegion {
 
   @Test
   public void testFlushedFileWithNoTags() throws Exception {
-    TableName tableName = TableName.valueOf(getClass().getSimpleName());
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     HTableDescriptor htd = new HTableDescriptor(tableName);
     htd.addFamily(new HColumnDescriptor(fam1));
     HRegionInfo info = new HRegionInfo(tableName, null, null, false);
@@ -5795,12 +5794,10 @@ public class TestHRegion {
   @Test
   public void testOpenRegionWrittenToWALForLogReplay() throws Exception {
     // similar to the above test but with distributed log replay
-    final ServerName serverName = ServerName.valueOf("testOpenRegionWrittenToWALForLogReplay",
-        100, 42);
+    final ServerName serverName = ServerName.valueOf(name.getMethodName(), 100, 42);
     final RegionServerServices rss = spy(TEST_UTIL.createMockRegionServerService(serverName));
 
-    HTableDescriptor htd
-        = new HTableDescriptor(TableName.valueOf("testOpenRegionWrittenToWALForLogReplay"));
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     htd.addFamily(new HColumnDescriptor(fam1));
     htd.addFamily(new HColumnDescriptor(fam2));
 
@@ -5909,8 +5906,7 @@ public class TestHRegion {
     final ServerName serverName = ServerName.valueOf("testCloseRegionWrittenToWAL", 100, 42);
     final RegionServerServices rss = spy(TEST_UTIL.createMockRegionServerService(serverName));
 
-    HTableDescriptor htd
-    = new HTableDescriptor(TableName.valueOf("testOpenRegionWrittenToWAL"));
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     htd.addFamily(new HColumnDescriptor(fam1));
     htd.addFamily(new HColumnDescriptor(fam2));
 
@@ -6025,7 +6021,7 @@ public class TestHRegion {
     final byte[] q3 = Bytes.toBytes("q3");
     final byte[] q4 = Bytes.toBytes("q4");
 
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("testCellTTLs"));
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     HColumnDescriptor hcd = new HColumnDescriptor(fam1);
     hcd.setTimeToLive(10); // 10 seconds
     htd.addFamily(hcd);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionFileSystem.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionFileSystem.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionFileSystem.java
index 7875e68..88bbffb 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionFileSystem.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionFileSystem.java
@@ -53,8 +53,10 @@ import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.util.Progressable;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 @Category({RegionServerTests.class, SmallTests.class})
 public class TestHRegionFileSystem {
@@ -65,6 +67,9 @@ public class TestHRegionFileSystem {
     Bytes.add(PerformanceEvaluation.FAMILY_NAME, Bytes.toBytes("-B")) };
   private static final TableName TABLE_NAME = TableName.valueOf("TestTable");
 
+  @Rule
+  public TestName name = new TestName();
+
   @Test
   public void testBlockStoragePolicy() throws Exception {
     TEST_UTIL = new HBaseTestingUtility();
@@ -188,7 +193,7 @@ public class TestHRegionFileSystem {
     Configuration conf = TEST_UTIL.getConfiguration();
 
     // Create a Region
-    HRegionInfo hri = new HRegionInfo(TableName.valueOf("TestTable"));
+    HRegionInfo hri = new HRegionInfo(TableName.valueOf(name.getMethodName()));
     HRegionFileSystem regionFs = HRegionFileSystem.createRegionOnFileSystem(conf, fs,
         FSUtils.getTableDir(rootDir, hri.getTable()), hri);
 
@@ -220,7 +225,7 @@ public class TestHRegionFileSystem {
     Configuration conf = TEST_UTIL.getConfiguration();
 
     // Create a Region
-    HRegionInfo hri = new HRegionInfo(TableName.valueOf("TestTable"));
+    HRegionInfo hri = new HRegionInfo(TableName.valueOf(name.getMethodName()));
     HRegionFileSystem regionFs = HRegionFileSystem.createRegionOnFileSystem(conf, fs, rootDir, hri);
     assertTrue(fs.exists(regionFs.getRegionDir()));
 
@@ -345,7 +350,7 @@ public class TestHRegionFileSystem {
 
     // Create a Region
     String familyName = "cf";
-    HRegionInfo hri = new HRegionInfo(TableName.valueOf("TestTable"));
+    HRegionInfo hri = new HRegionInfo(TableName.valueOf(name.getMethodName()));
     HRegionFileSystem regionFs = HRegionFileSystem.createRegionOnFileSystem(conf, fs, rootDir, hri);
 
     // New region, no store files

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
index cd76b17..1b5ee08 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionInfo.java
@@ -44,11 +44,16 @@ import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.FSTableDescriptors;
 import org.apache.hadoop.hbase.util.MD5Hash;
 import org.junit.Assert;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 @Category({RegionServerTests.class, SmallTests.class})
 public class TestHRegionInfo {
+  @Rule
+  public TestName name = new TestName();
+
   @Test
   public void testPb() throws DeserializationException {
     HRegionInfo hri = HRegionInfo.FIRST_META_REGIONINFO;
@@ -91,7 +96,7 @@ public class TestHRegionInfo {
 
   @Test
   public void testCreateHRegionInfoName() throws Exception {
-    String tableName = "tablename";
+    final String tableName = name.getMethodName();
     final TableName tn = TableName.valueOf(tableName);
     String startKey = "startkey";
     final byte[] sk = Bytes.toBytes(startKey);
@@ -115,7 +120,7 @@ public class TestHRegionInfo {
 
   @Test
   public void testContainsRange() {
-    HTableDescriptor tableDesc = new HTableDescriptor(TableName.valueOf("testtable"));
+    HTableDescriptor tableDesc = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     HRegionInfo hri = new HRegionInfo(
         tableDesc.getTableName(), Bytes.toBytes("a"), Bytes.toBytes("g"));
     // Single row range at start of region
@@ -143,7 +148,7 @@ public class TestHRegionInfo {
 
   @Test
   public void testLastRegionCompare() {
-    HTableDescriptor tableDesc = new HTableDescriptor(TableName.valueOf("testtable"));
+    HTableDescriptor tableDesc = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     HRegionInfo hrip = new HRegionInfo(
         tableDesc.getTableName(), Bytes.toBytes("a"), new byte[0]);
     HRegionInfo hric = new HRegionInfo(
@@ -158,10 +163,10 @@ public class TestHRegionInfo {
 
   @Test
   public void testComparator() {
-    TableName tablename = TableName.valueOf("comparatorTablename");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     byte[] empty = new byte[0];
-    HRegionInfo older = new HRegionInfo(tablename, empty, empty, false, 0L);
-    HRegionInfo newer = new HRegionInfo(tablename, empty, empty, false, 1L);
+    HRegionInfo older = new HRegionInfo(tableName, empty, empty, false, 0L);
+    HRegionInfo newer = new HRegionInfo(tableName, empty, empty, false, 1L);
     assertTrue(older.compareTo(newer) < 0);
     assertTrue(newer.compareTo(older) > 0);
     assertTrue(older.compareTo(older) == 0);
@@ -170,7 +175,7 @@ public class TestHRegionInfo {
 
   @Test
   public void testRegionNameForRegionReplicas() throws Exception {
-    String tableName = "tablename";
+    String tableName = name.getMethodName();
     final TableName tn = TableName.valueOf(tableName);
     String startKey = "startkey";
     final byte[] sk = Bytes.toBytes(startKey);
@@ -198,7 +203,7 @@ public class TestHRegionInfo {
 
   @Test
   public void testParseName() throws IOException {
-    TableName tableName = TableName.valueOf("testParseName");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     byte[] startKey = Bytes.toBytes("startKey");
     long regionId = System.currentTimeMillis();
     int replicaId = 42;
@@ -226,7 +231,7 @@ public class TestHRegionInfo {
 
   @Test
   public void testConvert() {
-    TableName tableName = TableName.valueOf("ns1:table1");
+    final TableName tableName = TableName.valueOf("ns1:" + name.getMethodName());
     byte[] startKey = Bytes.toBytes("startKey");
     byte[] endKey = Bytes.toBytes("endKey");
     boolean split = false;
@@ -266,10 +271,10 @@ public class TestHRegionInfo {
     byte[] endKey = new byte[] {0x01, 0x01, 0x02, 0x04};
     Configuration conf = new Configuration();
     conf.setBoolean("hbase.display.keys", false);
-    HRegionInfo h = new HRegionInfo(TableName.valueOf("foo"), startKey, endKey);
+    HRegionInfo h = new HRegionInfo(TableName.valueOf(name.getMethodName()), startKey, endKey);
     checkEquality(h, conf);
     // check HRIs with non-default replicaId
-    h = new HRegionInfo(TableName.valueOf("foo"), startKey, endKey, false,
+    h = new HRegionInfo(TableName.valueOf(name.getMethodName()), startKey, endKey, false,
         System.currentTimeMillis(), 1);
     checkEquality(h, conf);
     Assert.assertArrayEquals(HRegionInfo.HIDDEN_END_KEY,

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java
index 108af10..23c96a2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionOnCluster.java
@@ -44,8 +44,10 @@ import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.testclassification.RegionServerTests;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 
 /**
@@ -59,6 +61,9 @@ public class TestHRegionOnCluster {
   private static final Log LOG = LogFactory.getLog(TestHRegionOnCluster.class);
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
 
+  @Rule
+  public TestName name = new TestName();
+
   @Test (timeout=300000)
   public void testDataCorrectnessReplayingRecoveredEdits() throws Exception {
     final int NUM_MASTERS = 1;
@@ -67,29 +72,29 @@ public class TestHRegionOnCluster {
     TEST_UTIL.startMiniCluster(NUM_MASTERS, NUM_RS);
 
     try {
-      final TableName TABLENAME = TableName.valueOf("testDataCorrectnessReplayingRecoveredEdits");
+      final TableName tableName = TableName.valueOf(name.getMethodName());
       final byte[] FAMILY = Bytes.toBytes("family");
       MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
       HMaster master = cluster.getMaster();
 
       // Create table
-      HTableDescriptor desc = new HTableDescriptor(TABLENAME);
+      HTableDescriptor desc = new HTableDescriptor(tableName);
       desc.addFamily(new HColumnDescriptor(FAMILY));
       hbaseAdmin = master.getConnection().getAdmin();
       hbaseAdmin.createTable(desc);
 
-      assertTrue(hbaseAdmin.isTableAvailable(TABLENAME));
+      assertTrue(hbaseAdmin.isTableAvailable(tableName));
 
       // Put data: r1->v1
-      LOG.info("Loading r1 to v1 into " + TABLENAME);
-      Table table = TEST_UTIL.getConnection().getTable(TABLENAME);
+      LOG.info("Loading r1 to v1 into " + tableName);
+      Table table = TEST_UTIL.getConnection().getTable(tableName);
       putDataAndVerify(table, "r1", FAMILY, "v1", 1);
 
       TEST_UTIL.waitUntilAllRegionsAssigned(table.getName());
       // Move region to target server
 
       HRegionInfo regionInfo;
-      try (RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(TABLENAME)) {
+      try (RegionLocator locator = TEST_UTIL.getConnection().getRegionLocator(tableName)) {
         regionInfo = locator.getRegionLocation(Bytes.toBytes("r1")).getRegionInfo();
       }
 
@@ -108,7 +113,7 @@ public class TestHRegionOnCluster {
       } while (cluster.getServerWith(regionInfo.getRegionName()) == originServerNum);
 
       // Put data: r2->v2
-      LOG.info("Loading r2 to v2 into " + TABLENAME);
+      LOG.info("Loading r2 to v2 into " + tableName);
       putDataAndVerify(table, "r2", FAMILY, "v2", 2);
 
       TEST_UTIL.waitUntilAllRegionsAssigned(table.getName());
@@ -121,7 +126,7 @@ public class TestHRegionOnCluster {
       } while (cluster.getServerWith(regionInfo.getRegionName()) == targetServerNum);
 
       // Put data: r3->v3
-      LOG.info("Loading r3 to v3 into " + TABLENAME);
+      LOG.info("Loading r3 to v3 into " + tableName);
       putDataAndVerify(table, "r3", FAMILY, "v3", 3);
 
       // Kill target server
@@ -138,7 +143,7 @@ public class TestHRegionOnCluster {
       cluster.getRegionServerThreads().get(originServerNum).join();
 
       // Put data: r4->v4
-      LOG.info("Loading r4 to v4 into " + TABLENAME);
+      LOG.info("Loading r4 to v4 into " + tableName);
       putDataAndVerify(table, "r4", FAMILY, "v4", 4);
 
     } finally {

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java
index 3f42276..00cc50a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestJoinedScanners.java
@@ -47,8 +47,10 @@ import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
 import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.testclassification.RegionServerTests;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 /**
  * Test performance improvement of joined scanners optimization:
@@ -71,6 +73,9 @@ public class TestJoinedScanners {
   private static int selectionRatio = 30;
   private static int valueWidth = 128 * 1024;
 
+  @Rule
+  public TestName name = new TestName();
+
   @Test
   public void testJoinedScanners() throws Exception {
     String dataNodeHosts[] = new String[] { "host1", "host2", "host3" };
@@ -88,7 +93,7 @@ public class TestJoinedScanners {
       cluster = htu.startMiniCluster(1, regionServersCount, dataNodeHosts);
       byte [][] families = {cf_essential, cf_joined};
 
-      TableName tableName = TableName.valueOf(this.getClass().getSimpleName());
+      final TableName tableName = TableName.valueOf(name.getMethodName());
       HTableDescriptor desc = new HTableDescriptor(tableName);
       for(byte[] family : families) {
         HColumnDescriptor hcd = new HColumnDescriptor(family);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java
index b480e8b..ac8ed21 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMobStoreScanner.java
@@ -53,8 +53,10 @@ import org.apache.hadoop.hbase.util.HFileArchiveUtil;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 @Category(MediumTests.class)
 public class TestMobStoreScanner {
@@ -75,6 +77,9 @@ public class TestMobStoreScanner {
   private FileSystem fs;
   private Configuration conf;
 
+  @Rule
+  public TestName name = new TestName();
+
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.getConfiguration().setInt("hbase.client.keyvalue.maxsize", 100 * 1024 * 1024);
@@ -148,7 +153,7 @@ public class TestMobStoreScanner {
 
   @Test(timeout=60000)
   public void testGetMassive() throws Exception {
-    setUp(defaultThreshold, TableName.valueOf("testGetMassive"));
+    setUp(defaultThreshold, TableName.valueOf(name.getMethodName()));
 
     // Put some data 5 10, 15, 20  mb ok  (this would be right below protobuf
     // default max size of 64MB.
@@ -168,8 +173,8 @@ public class TestMobStoreScanner {
 
   @Test
   public void testReadPt() throws Exception {
-    TableName tn = TableName.valueOf("testReadPt");
-    setUp(0L, tn);
+    final TableName tableName = TableName.valueOf(name.getMethodName());
+    setUp(0L, tableName);
     long ts = System.currentTimeMillis();
     byte[] value1 = Bytes.toBytes("value1");
     Put put1 = new Put(row1);
@@ -196,7 +201,7 @@ public class TestMobStoreScanner {
     Cell cell = result.getColumnLatestCell(family, qf1);
     Assert.assertArrayEquals(value1, CellUtil.cloneValue(cell));
 
-    admin.flush(tn);
+    admin.flush(tableName);
     result = rs.next();
     cell = result.getColumnLatestCell(family, qf1);
     Assert.assertArrayEquals(value2, CellUtil.cloneValue(cell));
@@ -204,9 +209,9 @@ public class TestMobStoreScanner {
 
   @Test
   public void testReadFromCorruptMobFilesWithReadEmptyValueOnMobCellMiss() throws Exception {
-    TableName tn = TableName.valueOf("testReadFromCorruptMobFilesWithReadEmptyValueOnMobCellMiss");
-    setUp(0, tn);
-    createRecordAndCorruptMobFile(tn, row1, family, qf1, Bytes.toBytes("value1"));
+    final TableName tableName = TableName.valueOf(name.getMethodName());
+    setUp(0, tableName);
+    createRecordAndCorruptMobFile(tableName, row1, family, qf1, Bytes.toBytes("value1"));
     Get get = new Get(row1);
     get.setAttribute(MobConstants.EMPTY_VALUE_ON_MOBCELL_MISS, Bytes.toBytes(true));
     Result result = table.get(get);
@@ -216,9 +221,9 @@ public class TestMobStoreScanner {
 
   @Test
   public void testReadFromCorruptMobFiles() throws Exception {
-    TableName tn = TableName.valueOf("testReadFromCorruptMobFiles");
-    setUp(0, tn);
-    createRecordAndCorruptMobFile(tn, row1, family, qf1, Bytes.toBytes("value1"));
+    final TableName tableName = TableName.valueOf(name.getMethodName());
+    setUp(0, tableName);
+    createRecordAndCorruptMobFile(tableName, row1, family, qf1, Bytes.toBytes("value1"));
     Get get = new Get(row1);
     IOException ioe = null;
     try {

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java
index b19ba0a..97d13b1 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java
@@ -38,8 +38,10 @@ import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 import org.mockito.Mockito;
 
 import com.google.common.collect.Lists;
@@ -75,6 +77,9 @@ public class TestRSStatusServlet {
   private final ServerName fakeMasterAddress =
       ServerName.valueOf("localhost", 60010, 1212121212);
 
+  @Rule
+  public TestName name = new TestName();
+
   @Before
   public void setupBasicMocks() throws IOException, ServiceException {
     rs = Mockito.mock(HRegionServer.class);
@@ -118,7 +123,7 @@ public class TestRSStatusServlet {
   
   @Test
   public void testWithRegions() throws IOException, ServiceException {
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("mytable"));
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     List<HRegionInfo> regions = Lists.newArrayList(
         new HRegionInfo(htd.getTableName(), Bytes.toBytes("a"), Bytes.toBytes("d")),
         new HRegionInfo(htd.getTableName(), Bytes.toBytes("d"), Bytes.toBytes("z"))

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java
index dae2233..3e6d180 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java
@@ -138,9 +138,8 @@ public class TestRegionMergeTransactionOnCluster {
 
   @Test
   public void testWholesomeMerge() throws Exception {
-    LOG.info("Starting testWholesomeMerge");
-    final TableName tableName =
-        TableName.valueOf("testWholesomeMerge");
+    LOG.info("Starting " + name.getMethodName());
+    final TableName tableName = TableName.valueOf(name.getMethodName());
 
     // Create table and load data.
     Table table = createTableAndLoadData(MASTER, tableName);
@@ -189,7 +188,7 @@ public class TestRegionMergeTransactionOnCluster {
    */
   @Test
   public void testMergeAndRestartingMaster() throws Exception {
-    final TableName tableName = TableName.valueOf("testMergeAndRestartingMaster");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
 
     // Create table and load data.
     Table table = createTableAndLoadData(MASTER, tableName);
@@ -208,11 +207,10 @@ public class TestRegionMergeTransactionOnCluster {
 
   @Test
   public void testCleanMergeReference() throws Exception {
-    LOG.info("Starting testCleanMergeReference");
+    LOG.info("Starting " + name.getMethodName());
     ADMIN.enableCatalogJanitor(false);
     try {
-      final TableName tableName =
-          TableName.valueOf("testCleanMergeReference");
+      final TableName tableName = TableName.valueOf(name.getMethodName());
       // Create table and load data.
       Table table = createTableAndLoadData(MASTER, tableName);
       // Merge 1st and 2nd region
@@ -320,8 +318,8 @@ public class TestRegionMergeTransactionOnCluster {
    */
   @Test
   public void testMerge() throws Exception {
-    LOG.info("Starting testMerge");
-    final TableName tableName = TableName.valueOf("testMerge");
+    LOG.info("Starting " + name.getMethodName());
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     final Admin admin = TEST_UTIL.getAdmin();
     final int syncWaitTimeout = 10 * 60000; // 10min
 
@@ -372,7 +370,7 @@ public class TestRegionMergeTransactionOnCluster {
 
   @Test
   public void testMergeWithReplicas() throws Exception {
-    final TableName tableName = TableName.valueOf("testMergeWithReplicas");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     // Create table and load data.
     createTableAndLoadData(MASTER, tableName, 5, 2);
     List<Pair<HRegionInfo, ServerName>> initialRegionToServers =

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
index 2cae887..b2909e2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionSplitPolicy.java
@@ -37,8 +37,10 @@ import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 import org.mockito.Mockito;
 
 @Category({RegionServerTests.class, SmallTests.class})
@@ -50,6 +52,9 @@ public class TestRegionSplitPolicy {
   private List<Store> stores;
   private static final TableName TABLENAME = TableName.valueOf("t");
 
+  @Rule
+  public TestName name = new TestName();
+
   @Before
   public void setupMocks() {
     conf = HBaseConfiguration.create();
@@ -229,7 +234,7 @@ public class TestRegionSplitPolicy {
    */
   @Test
   public void testCustomPolicy() throws IOException {
-    HTableDescriptor myHtd = new HTableDescriptor(TableName.valueOf("foobar"));
+    HTableDescriptor myHtd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     myHtd.setValue(HTableDescriptor.SPLIT_POLICY,
         KeyPrefixRegionSplitPolicy.class.getName());
     myHtd.setValue(KeyPrefixRegionSplitPolicy.PREFIX_LENGTH_KEY, String.valueOf(2));
@@ -338,7 +343,7 @@ public class TestRegionSplitPolicy {
 
   @Test
   public void testDelimitedKeyPrefixRegionSplitPolicy() throws IOException {
-    HTableDescriptor myHtd = new HTableDescriptor(TableName.valueOf("foobar"));
+    HTableDescriptor myHtd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
     myHtd.setValue(HTableDescriptor.SPLIT_POLICY,
         DelimitedKeyPrefixRegionSplitPolicy.class.getName());
     myHtd.setValue(DelimitedKeyPrefixRegionSplitPolicy.DELIMITER_KEY, ",");

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java
index 755e8e3..eb7a1a1 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRemoveRegionMetrics.java
@@ -36,8 +36,10 @@ import org.apache.hadoop.hbase.testclassification.RegionServerTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Threads;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 import java.io.IOException;
 
@@ -49,6 +51,9 @@ public class TestRemoveRegionMetrics {
   private static HBaseTestingUtility TEST_UTIL;
   private static MetricsAssertHelper metricsHelper;
 
+  @Rule
+  public TestName name = new TestName();
+
   @BeforeClass
   public static void startCluster() throws Exception {
     metricsHelper = CompatibilityFactory.getInstance(MetricsAssertHelper.class);
@@ -72,7 +77,7 @@ public class TestRemoveRegionMetrics {
 
   @Test
   public void testMoveRegion() throws IOException, InterruptedException {
-    String tableNameString = "testMoveRegion";
+    String tableNameString = name.getMethodName();
     TableName tableName = TableName.valueOf(tableNameString);
     Table t = TEST_UTIL.createTable(tableName, Bytes.toBytes("D"));
     TEST_UTIL.waitUntilAllRegionsAssigned(t.getName());

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
index 3e02243..3a952ee 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
@@ -33,11 +33,15 @@ import org.apache.hadoop.hbase.client.Durability;
 import org.apache.hadoop.hbase.testclassification.RegionServerTests;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 @Category({RegionServerTests.class, SmallTests.class})
 public class TestResettingCounters {
+  @Rule
+  public TestName name = new TestName();
 
   @Test
   public void testResettingCounters() throws Exception {
@@ -45,7 +49,7 @@ public class TestResettingCounters {
     HBaseTestingUtility htu = new HBaseTestingUtility();
     Configuration conf = htu.getConfiguration();
     FileSystem fs = FileSystem.get(conf);
-    byte [] table = Bytes.toBytes("table");
+    byte [] table = Bytes.toBytes(name.getMethodName());
     byte [][] families = new byte [][] {
         Bytes.toBytes("family1"),
         Bytes.toBytes("family2"),

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
index 00e8f0a..ea16edf 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
@@ -60,10 +60,13 @@ import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.testclassification.RegionServerTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Pair;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.google.common.collect.Lists;
+import org.junit.rules.TestName;
+
 /**
  * Test cases against ReversibleKeyValueScanner
  */
@@ -85,6 +88,9 @@ public class TestReversibleScanners {
   private static final int VALUESIZE = 3;
   private static byte[][] VALUES = makeN(VALUE, VALUESIZE);
 
+  @Rule
+  public TestName name = new TestName();
+
   @Test
   public void testReversibleStoreFileScanner() throws IOException {
     FileSystem fs = TEST_UTIL.getTestFileSystem();
@@ -310,7 +316,7 @@ public class TestReversibleScanners {
   @Test
   public void testReversibleRegionScanner() throws IOException {
     byte[] FAMILYNAME2 = Bytes.toBytes("testCf2");
-    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("testtable"))
+    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()))
         .addFamily(new HColumnDescriptor(FAMILYNAME))
         .addFamily(new HColumnDescriptor(FAMILYNAME2));
     Region region = TEST_UTIL.createLocalHRegion(htd, null, null);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java
index 178b537..07dd2a9 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java
@@ -47,13 +47,18 @@ import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 @Category({RegionServerTests.class, MediumTests.class})
 public class TestScannerWithBulkload {
   private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
 
+  @Rule
+  public TestName name = new TestName();
+
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     TEST_UTIL.startMiniCluster(1);
@@ -69,7 +74,7 @@ public class TestScannerWithBulkload {
 
   @Test
   public void testBulkLoad() throws Exception {
-    TableName tableName = TableName.valueOf("testBulkLoad");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     long l = System.currentTimeMillis();
     Admin admin = TEST_UTIL.getAdmin();
     createTable(admin, tableName);
@@ -207,7 +212,7 @@ public class TestScannerWithBulkload {
 
   @Test
   public void testBulkLoadWithParallelScan() throws Exception {
-    final TableName tableName = TableName.valueOf("testBulkLoadWithParallelScan");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
       final long l = System.currentTimeMillis();
     final Admin admin = TEST_UTIL.getAdmin();
     createTable(admin, tableName);
@@ -250,7 +255,7 @@ public class TestScannerWithBulkload {
 
   @Test
   public void testBulkLoadNativeHFile() throws Exception {
-    TableName tableName = TableName.valueOf("testBulkLoadNativeHFile");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     long l = System.currentTimeMillis();
     Admin admin = TEST_UTIL.getAdmin();
     createTable(admin, tableName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
index 0b0e683..966d794 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
@@ -99,8 +99,10 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 /**
  * The below tests are testing split region against a running cluster
@@ -117,6 +119,9 @@ public class TestSplitTransactionOnCluster {
   static final HBaseTestingUtility TESTING_UTIL =
     new HBaseTestingUtility();
 
+  @Rule
+  public TestName name = new TestName();
+
   @BeforeClass public static void before() throws Exception {
     TESTING_UTIL.getConfiguration().setInt(HConstants.HBASE_BALANCER_PERIOD, 60000);
     TESTING_UTIL.startMiniCluster(1, NB_SERVERS, null, MyMaster.class, null);
@@ -174,8 +179,7 @@ public class TestSplitTransactionOnCluster {
 
   @Test(timeout = 60000)
   public void testRITStateForRollback() throws Exception {
-    final TableName tableName =
-        TableName.valueOf("testRITStateForRollback");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     final HMaster master = cluster.getMaster();
     try {
       // Create table then get the single region for our new table.
@@ -222,7 +226,7 @@ public class TestSplitTransactionOnCluster {
 
   @Test(timeout = 60000)
   public void testSplitFailedCompactionAndSplit() throws Exception {
-    final TableName tableName = TableName.valueOf("testSplitFailedCompactionAndSplit");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     // Create table then get the single region for our new table.
     HTableDescriptor htd = new HTableDescriptor(tableName);
     byte[] cf = Bytes.toBytes("cf");
@@ -282,8 +286,7 @@ public class TestSplitTransactionOnCluster {
 
   @Test (timeout = 300000)
   public void testExistingZnodeBlocksSplitAndWeRollback() throws IOException, InterruptedException {
-    final TableName tableName =
-        TableName.valueOf("testExistingZnodeBlocksSplitAndWeRollback");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
 
     // Create table then get the single region for our new table.
     Table t = createTableAndWait(tableName, HConstants.CATALOG_FAMILY);
@@ -341,8 +344,7 @@ public class TestSplitTransactionOnCluster {
   @Ignore // TODO: revisit this test when the new AM and SSH is implement
   @Test (timeout=300000)
   public void testShutdownFixupWhenDaughterHasSplit()throws IOException, InterruptedException {
-    final TableName tableName =
-        TableName.valueOf("testShutdownFixupWhenDaughterHasSplit");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
 
     // Create table then get the single region for our new table.
     Table t = createTableAndWait(tableName, HConstants.CATALOG_FAMILY);
@@ -419,8 +421,7 @@ public class TestSplitTransactionOnCluster {
 
   @Test(timeout = 180000)
   public void testSplitShouldNotThrowNPEEvenARegionHasEmptySplitFiles() throws Exception {
-    TableName userTableName =
-        TableName.valueOf("testSplitShouldNotThrowNPEEvenARegionHasEmptySplitFiles");
+    TableName userTableName = TableName.valueOf(name.getMethodName());
     HTableDescriptor htd = new HTableDescriptor(userTableName);
     HColumnDescriptor hcd = new HColumnDescriptor("col");
     htd.addFamily(hcd);
@@ -491,8 +492,7 @@ public class TestSplitTransactionOnCluster {
   public void testMasterRestartAtRegionSplitPendingCatalogJanitor()
       throws IOException, InterruptedException, NodeExistsException,
       KeeperException, ServiceException {
-    final TableName tableName = TableName
-        .valueOf("testMasterRestartAtRegionSplitPendingCatalogJanitor");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
 
     // Create table then get the single region for our new table.
     Table t = createTableAndWait(tableName, HConstants.CATALOG_FAMILY);
@@ -537,9 +537,8 @@ public class TestSplitTransactionOnCluster {
 
   @Test
   public void testSplitWithRegionReplicas() throws Exception {
-    final TableName tableName =
-        TableName.valueOf("foobar");
-    HTableDescriptor htd = TESTING_UTIL.createTableDescriptor("foobar");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
+    HTableDescriptor htd = TESTING_UTIL.createTableDescriptor(name.getMethodName());
     htd.setRegionReplication(2);
     htd.addCoprocessor(SlowMeCopro.class.getName());
     // Create table then get the single region for our new table.
@@ -633,8 +632,7 @@ public class TestSplitTransactionOnCluster {
   @Test(timeout = 60000)
   public void testSplitRegionWithNoStoreFiles()
       throws Exception {
-    final TableName tableName =
-        TableName.valueOf("testSplitRegionWithNoStoreFiles");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     // Create table then get the single region for our new table.
     createTableAndWait(tableName, HConstants.CATALOG_FAMILY);
     List<HRegion> regions = cluster.getRegions(tableName);
@@ -712,8 +710,7 @@ public class TestSplitTransactionOnCluster {
   @Test
   public void testStoreFileReferenceCreationWhenSplitPolicySaysToSkipRangeCheck()
       throws Exception {
-    final TableName tableName =
-        TableName.valueOf("testStoreFileReferenceCreationWhenSplitPolicySaysToSkipRangeCheck");
+    final TableName tableName = TableName.valueOf(name.getMethodName());
     try {
       HTableDescriptor htd = new HTableDescriptor(tableName);
       htd.addFamily(new HColumnDescriptor("f"));

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java
index 74b3df9..d96fd9f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileRefresherChore.java
@@ -52,8 +52,10 @@ import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.util.StoppableImplementation;
 import org.junit.Assert;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 @Category({RegionServerTests.class, SmallTests.class})
 public class TestStoreFileRefresherChore {
@@ -61,6 +63,9 @@ public class TestStoreFileRefresherChore {
   private HBaseTestingUtility TEST_UTIL;
   private Path testDir;
 
+  @Rule
+  public TestName name = new TestName();
+
   @Before
   public void setUp() throws IOException {
     TEST_UTIL = new HBaseTestingUtility();
@@ -169,7 +174,7 @@ public class TestStoreFileRefresherChore {
     when(regionServer.getOnlineRegionsLocalContext()).thenReturn(regions);
     when(regionServer.getConfiguration()).thenReturn(TEST_UTIL.getConfiguration());
 
-    HTableDescriptor htd = getTableDesc(TableName.valueOf("testIsStale"), families);
+    HTableDescriptor htd = getTableDesc(TableName.valueOf(name.getMethodName()), families);
     Region primary = initHRegion(htd, HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW, 0);
     Region replica1 = initHRegion(htd, HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW, 1);
     regions.add(primary);

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java
index eef6c91..994779f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java
@@ -34,8 +34,10 @@ import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.wal.WAL;
 import org.apache.hadoop.hbase.wal.WALFactory;
 import org.junit.Assert;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -69,6 +71,9 @@ public class TestWALMonotonicallyIncreasingSeqId {
 
   private static final char[] KEY_SEED_CHARS = KEY_SEED.toCharArray();
 
+  @Rule
+  public TestName name = new TestName();
+
   private HTableDescriptor getTableDesc(TableName tableName, byte[]... families) {
     HTableDescriptor htd = new HTableDescriptor(tableName);
     for (byte[] family : families) {
@@ -157,7 +162,7 @@ public class TestWALMonotonicallyIncreasingSeqId {
   public void TestWALMonotonicallyIncreasingSeqId() throws Exception {
     byte[][] families = new byte[][] {Bytes.toBytes("cf")};
     byte[] qf = Bytes.toBytes("cq");
-    HTableDescriptor htd = getTableDesc(TableName.valueOf("TestWALMonotonicallyIncreasingSeqId"), families);
+    HTableDescriptor htd = getTableDesc(TableName.valueOf(name.getMethodName()), families);
     HRegion region = (HRegion)initHRegion(htd, HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW, 0);
     List<Thread> putThreads = new ArrayList<>();
     for(int i = 0; i < 1; i++) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/55c2e2d4/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestFSHLog.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestFSHLog.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestFSHLog.java
index f1a3627..9e546e6 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestFSHLog.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestFSHLog.java
@@ -46,8 +46,10 @@ import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.util.Threads;
 import org.apache.hadoop.hbase.wal.WALKey;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 import static org.junit.Assert.assertEquals;
 
@@ -56,6 +58,8 @@ import static org.junit.Assert.assertEquals;
  */
 @Category({ RegionServerTests.class, MediumTests.class })
 public class TestFSHLog extends AbstractTestFSWAL {
+  @Rule
+  public TestName name = new TestName();
 
   @Override
   protected AbstractFSWAL<?> newWAL(FileSystem fs, Path rootDir, String walDir, String archiveDir,
@@ -84,7 +88,7 @@ public class TestFSHLog extends AbstractTestFSWAL {
   @Test
   public void testSyncRunnerIndexOverflow() throws IOException, NoSuchFieldException,
       SecurityException, IllegalArgumentException, IllegalAccessException {
-    final String name = "testSyncRunnerIndexOverflow";
+    final String name = this.name.getMethodName();
     FSHLog log = new FSHLog(FS, FSUtils.getRootDir(CONF), name, HConstants.HREGION_OLDLOGDIR_NAME,
         CONF, null, true, null, null);
     try {
@@ -97,7 +101,7 @@ public class TestFSHLog extends AbstractTestFSWAL {
       syncRunnerIndexField.setAccessible(true);
       syncRunnerIndexField.set(ringBufferEventHandler, Integer.MAX_VALUE - 1);
       HTableDescriptor htd =
-          new HTableDescriptor(TableName.valueOf("t1")).addFamily(new HColumnDescriptor("row"));
+          new HTableDescriptor(TableName.valueOf(this.name.getMethodName())).addFamily(new HColumnDescriptor("row"));
       NavigableMap<byte[], Integer> scopes = new TreeMap<byte[], Integer>(Bytes.BYTES_COMPARATOR);
       for (byte[] fam : htd.getFamiliesKeys()) {
         scopes.put(fam, 0);
@@ -118,7 +122,7 @@ public class TestFSHLog extends AbstractTestFSWAL {
    */
   @Test (timeout = 30000)
   public void testUnflushedSeqIdTracking() throws IOException, InterruptedException {
-    final String name = "testSyncRunnerIndexOverflow";
+    final String name = this.name.getMethodName();
     final byte[] b = Bytes.toBytes("b");
 
     final AtomicBoolean startHoldingForAppend = new AtomicBoolean(false);
@@ -146,7 +150,7 @@ public class TestFSHLog extends AbstractTestFSWAL {
 
       // open a new region which uses this WAL
       HTableDescriptor htd =
-          new HTableDescriptor(TableName.valueOf("t1")).addFamily(new HColumnDescriptor(b));
+          new HTableDescriptor(TableName.valueOf(this.name.getMethodName())).addFamily(new HColumnDescriptor(b));
       HRegionInfo hri =
           new HRegionInfo(htd.getTableName(), HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW);
 


Mime
View raw message