Class HBaseTestCase

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.apache.hadoop.hbase.HBaseTestCase
All Implemented Interfaces:
junit.framework.Test

@Deprecated public abstract class HBaseTestCase extends junit.framework.TestCase
Deprecated.
since 2.0.0 and will be removed in 3.0.0. Write junit4 unit tests using HBaseTestingUtility.
Abstract HBase test class. Initializes a few things that can come in handly like an HBaseConfiguration and filesystem.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final byte[][]
    Deprecated.
     
    org.apache.hadoop.conf.Configuration
    Deprecated.
     
    protected static final byte[]
    Deprecated.
     
    protected static final byte[]
    Deprecated.
     
    protected static final byte[]
    Deprecated.
     
    protected static final char
    Deprecated.
     
    protected org.apache.hadoop.fs.FileSystem
    Deprecated.
     
    final org.apache.hadoop.hbase.util.FSTableDescriptors
    Deprecated.
     
    protected static final char
    Deprecated.
     
    private boolean
    Deprecated.
     
    private static final org.slf4j.Logger
    Deprecated.
     
    protected static final int
    Deprecated.
     
    protected org.apache.hadoop.hbase.regionserver.HRegion
    Deprecated.
     
    protected static final String
    Deprecated.
     
    protected String
    Deprecated.
     
    protected static final byte[]
    Deprecated.
     
    protected static org.apache.hadoop.fs.Path
    Deprecated.
     
    protected final HBaseTestingUtility
    Deprecated.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    constructor
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    addContent(org.apache.hadoop.hbase.client.Table updater, String columnFamily)
    Deprecated.
    Add content to region r on the passed column column.
    static long
    addContent(org.apache.hadoop.hbase.client.Table updater, String columnFamily, byte[] startKeyBytes, byte[] endKey)
    Deprecated.
    Add content to region r on the passed column column.
    static long
    addContent(org.apache.hadoop.hbase.client.Table updater, String family, String column)
    Deprecated.
     
    static long
    addContent(org.apache.hadoop.hbase.client.Table updater, String family, String column, byte[] startKeyBytes, byte[] endKey)
    Deprecated.
     
    static long
    addContent(org.apache.hadoop.hbase.client.Table updater, String columnFamily, String column, byte[] startKeyBytes, byte[] endKey, long ts)
    Deprecated.
    Add content to region r on the passed column column.
    static long
    addContent(org.apache.hadoop.hbase.regionserver.Region r, byte[] columnFamily)
    Deprecated.
     
    static long
    addContent(org.apache.hadoop.hbase.regionserver.Region r, byte[] columnFamily, byte[] column)
    Deprecated.
    Add content to region r on the passed column column.
    static void
    assertByteEquals(byte[] expected, byte[] actual)
    Deprecated.
     
    static void
    assertEquals(byte[] expected, byte[] actual)
    Deprecated.
     
    protected void
    assertResultEquals(org.apache.hadoop.hbase.regionserver.HRegion region, byte[] row, byte[] family, byte[] qualifier, long timestamp, byte[] value)
    Deprecated.
     
    protected void
    Deprecated.
     
    protected void
    Deprecated.
    You must call closeRootAndMeta() when done after calling this method.
    org.apache.hadoop.hbase.regionserver.HRegion
    createNewHRegion(org.apache.hadoop.hbase.HTableDescriptor desc, byte[] startKey, byte[] endKey)
    Deprecated.
    You must call close on the returned region and then close on the log file it created.
    org.apache.hadoop.hbase.regionserver.HRegion
    createNewHRegion(org.apache.hadoop.hbase.HTableDescriptor desc, byte[] startKey, byte[] endKey, org.apache.hadoop.conf.Configuration conf)
    Deprecated.
     
    protected org.apache.hadoop.hbase.HTableDescriptor
    Deprecated.
    Create a table of name name with COLUMNS for families.
    protected org.apache.hadoop.hbase.HTableDescriptor
    createTableDescriptor(String name, int versions)
    Deprecated.
    Create a table of name name with COLUMNS for families.
    protected org.apache.hadoop.hbase.HTableDescriptor
    createTableDescriptor(String name, int minVersions, int versions, int ttl, org.apache.hadoop.hbase.KeepDeletedCells keepDeleted)
    Deprecated.
    Create a table of name name with COLUMNS for families.
    protected org.apache.hadoop.fs.Path
    Deprecated.
     
    protected org.apache.hadoop.hbase.regionserver.HRegion
    openClosedRegion(org.apache.hadoop.hbase.regionserver.HRegion closedRegion)
    Deprecated.
     
    protected void
    Deprecated.
    Note that this method must be called after the mini hdfs cluster has started or we end up with a local file system.
    static void
    shutdownDfs(org.apache.hadoop.hdfs.MiniDFSCluster cluster)
    Deprecated.
    Common method to close down a MiniDFSCluster and the associated file system
    protected void
    Deprecated.
     

    Methods inherited from class junit.framework.TestCase

    assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString

    Methods inherited from class java.lang.Object

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

    • LOG

      private static final org.slf4j.Logger LOG
      Deprecated.
    • fam1

      protected static final byte[] fam1
      Deprecated.
    • fam2

      protected static final byte[] fam2
      Deprecated.
    • fam3

      protected static final byte[] fam3
      Deprecated.
    • COLUMNS

      protected static final byte[][] COLUMNS
      Deprecated.
    • localfs

      private boolean localfs
      Deprecated.
    • testDir

      protected static org.apache.hadoop.fs.Path testDir
      Deprecated.
    • fs

      protected org.apache.hadoop.fs.FileSystem fs
      Deprecated.
    • meta

      protected org.apache.hadoop.hbase.regionserver.HRegion meta
      Deprecated.
    • FIRST_CHAR

      protected static final char FIRST_CHAR
      Deprecated.
      See Also:
    • LAST_CHAR

      protected static final char LAST_CHAR
      Deprecated.
      See Also:
    • PUNCTUATION

      protected static final String PUNCTUATION
      Deprecated.
      See Also:
    • START_KEY_BYTES

      protected static final byte[] START_KEY_BYTES
      Deprecated.
    • START_KEY

      protected String START_KEY
      Deprecated.
    • MAXVERSIONS

      protected static final int MAXVERSIONS
      Deprecated.
      See Also:
    • testUtil

      protected final HBaseTestingUtility testUtil
      Deprecated.
    • conf

      public volatile org.apache.hadoop.conf.Configuration conf
      Deprecated.
    • fsTableDescriptors

      public final org.apache.hadoop.hbase.util.FSTableDescriptors fsTableDescriptors
      Deprecated.
  • Constructor Details

  • Method Details

    • setUp

      protected void setUp() throws Exception
      Deprecated.
      Note that this method must be called after the mini hdfs cluster has started or we end up with a local file system.
      Overrides:
      setUp in class junit.framework.TestCase
      Throws:
      Exception
    • tearDown

      protected void tearDown() throws Exception
      Deprecated.
      Overrides:
      tearDown in class junit.framework.TestCase
      Throws:
      Exception
    • getUnitTestdir

      protected org.apache.hadoop.fs.Path getUnitTestdir(String testName)
      Deprecated.
      Returns:
      directory to use for this test
      See Also:
    • createNewHRegion

      public org.apache.hadoop.hbase.regionserver.HRegion createNewHRegion(org.apache.hadoop.hbase.HTableDescriptor desc, byte[] startKey, byte[] endKey) throws IOException
      Deprecated.
      You must call close on the returned region and then close on the log file it created. Do HBaseTestingUtility.closeRegionAndWAL(HRegion) to close both the region and the WAL.
      Returns:
      An HRegion
      Throws:
      IOException
    • createNewHRegion

      public org.apache.hadoop.hbase.regionserver.HRegion createNewHRegion(org.apache.hadoop.hbase.HTableDescriptor desc, byte[] startKey, byte[] endKey, org.apache.hadoop.conf.Configuration conf) throws IOException
      Deprecated.
      Throws:
      IOException
    • openClosedRegion

      protected org.apache.hadoop.hbase.regionserver.HRegion openClosedRegion(org.apache.hadoop.hbase.regionserver.HRegion closedRegion) throws IOException
      Deprecated.
      Throws:
      IOException
    • createTableDescriptor

      protected org.apache.hadoop.hbase.HTableDescriptor createTableDescriptor(String name)
      Deprecated.
      Create a table of name name with COLUMNS for families.
      Parameters:
      name - Name to give table.
      Returns:
      Column descriptor.
    • createTableDescriptor

      protected org.apache.hadoop.hbase.HTableDescriptor createTableDescriptor(String name, int versions)
      Deprecated.
      Create a table of name name with COLUMNS for families.
      Parameters:
      name - Name to give table.
      versions - How many versions to allow per column.
      Returns:
      Column descriptor.
    • createTableDescriptor

      protected org.apache.hadoop.hbase.HTableDescriptor createTableDescriptor(String name, int minVersions, int versions, int ttl, org.apache.hadoop.hbase.KeepDeletedCells keepDeleted)
      Deprecated.
      Create a table of name name with COLUMNS for families.
      Parameters:
      name - Name to give table.
      versions - How many versions to allow per column.
      Returns:
      Column descriptor.
    • addContent

      public static long addContent(org.apache.hadoop.hbase.regionserver.Region r, byte[] columnFamily, byte[] column) throws IOException
      Deprecated.
      Add content to region r on the passed column column. Adds data of the from 'aaa', 'aab', etc where key and value are the same.
      Returns:
      count of what we added.
      Throws:
      IOException
    • addContent

      public static long addContent(org.apache.hadoop.hbase.regionserver.Region r, byte[] columnFamily) throws IOException
      Deprecated.
      Throws:
      IOException
    • addContent

      public static long addContent(org.apache.hadoop.hbase.client.Table updater, String columnFamily) throws IOException
      Deprecated.
      Add content to region r on the passed column column. Adds data of the from 'aaa', 'aab', etc where key and value are the same.
      Returns:
      count of what we added.
      Throws:
      IOException
    • addContent

      public static long addContent(org.apache.hadoop.hbase.client.Table updater, String family, String column) throws IOException
      Deprecated.
      Throws:
      IOException
    • addContent

      public static long addContent(org.apache.hadoop.hbase.client.Table updater, String columnFamily, byte[] startKeyBytes, byte[] endKey) throws IOException
      Deprecated.
      Add content to region r on the passed column column. Adds data of the from 'aaa', 'aab', etc where key and value are the same.
      Returns:
      count of what we added.
      Throws:
      IOException
    • addContent

      public static long addContent(org.apache.hadoop.hbase.client.Table updater, String family, String column, byte[] startKeyBytes, byte[] endKey) throws IOException
      Deprecated.
      Throws:
      IOException
    • addContent

      public static long addContent(org.apache.hadoop.hbase.client.Table updater, String columnFamily, String column, byte[] startKeyBytes, byte[] endKey, long ts) throws IOException
      Deprecated.
      Add content to region r on the passed column column. Adds data of the from 'aaa', 'aab', etc where key and value are the same.
      Returns:
      count of what we added.
      Throws:
      IOException
    • assertResultEquals

      protected void assertResultEquals(org.apache.hadoop.hbase.regionserver.HRegion region, byte[] row, byte[] family, byte[] qualifier, long timestamp, byte[] value) throws IOException
      Deprecated.
      Throws:
      IOException
    • shutdownDfs

      public static void shutdownDfs(org.apache.hadoop.hdfs.MiniDFSCluster cluster)
      Deprecated.
      Common method to close down a MiniDFSCluster and the associated file system
    • createMetaRegion

      protected void createMetaRegion() throws IOException
      Deprecated.
      You must call closeRootAndMeta() when done after calling this method. It does cleanup.
      Throws:
      IOException
    • closeRootAndMeta

      protected void closeRootAndMeta() throws IOException
      Deprecated.
      Throws:
      IOException
    • assertByteEquals

      public static void assertByteEquals(byte[] expected, byte[] actual)
      Deprecated.
    • assertEquals

      public static void assertEquals(byte[] expected, byte[] actual)
      Deprecated.