Class TableNameTestRule

java.lang.Object
org.junit.rules.TestWatcher
org.apache.hadoop.hbase.TableNameTestRule
All Implemented Interfaces:
org.junit.rules.TestRule

public class TableNameTestRule extends org.junit.rules.TestWatcher
Returns a TableName based on currently running test method name. Supports tests built on the Parameterized runner.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.apache.hadoop.hbase.TableName
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    cleanUpTestName(String methodName)
    Helper to handle parameterized method names.
    org.apache.hadoop.hbase.TableName
     
    protected void
    starting(org.junit.runner.Description description)
     

    Methods inherited from class org.junit.rules.TestWatcher

    apply, failed, finished, skipped, skipped, succeeded

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • tableName

      private org.apache.hadoop.hbase.TableName tableName
  • Constructor Details

  • Method Details

    • starting

      protected void starting(org.junit.runner.Description description)
      Overrides:
      starting in class org.junit.rules.TestWatcher
    • cleanUpTestName

      public static String cleanUpTestName(String methodName)
      Helper to handle parameterized method names. Unlike regular test methods, parameterized method names look like 'foo[x]'. This is problematic for tests that use this name for HBase tables. This helper strips out the parameter suffixes.
      Returns:
      current test method name with out parameterized suffixes.
    • getTableName

      public org.apache.hadoop.hbase.TableName getTableName()