// Path: src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java
// public static enum TableState {
//   ENABLED,
//   DISABLED,
//   DISABLING,
//   ENABLING
// };


import org.apache.zookeeper.data.Stat;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mockito.Mockito;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.*;
import org.apache.hadoop.hbase.zookeeper.ZKTable.TableState;
import org.apache.zookeeper.KeeperException;
    assertFalse(zkt.isDisabledTable(name));
    assertFalse(zkt.getDisabledTables().contains(name));
    assertTrue(zkt.isTablePresent(name));
    zkt.setEnabledTable(name);
    assertTrue(zkt.isEnabledTable(name));
    assertFalse(zkt.isEnablingTable(name));
    assertTrue(zkt.isTablePresent(name));
    zkt.setDeletedTable(name);
    assertFalse(zkt.isEnabledTable(name));
    assertFalse(zkt.isDisablingTable(name));
    assertFalse(zkt.isDisabledTable(name));
    assertFalse(zkt.isEnablingTable(name));
    assertFalse(zkt.isDisablingOrDisabledTable(name));
    assertFalse(zkt.isDisabledOrEnablingTable(name));
    assertFalse(zkt.isTablePresent(name));
  }

  /**
   * Test that ZK table writes table state in formats expected by 0.92 and 0.94 clients
   */
  @Test
  public void test9294Compatibility() throws Exception {
    final String tableName = "test9294Compatibility";

    ZooKeeperWatcher zkw = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(),
      tableName, abortable, true);
    ZKTable zkt = new ZKTable(zkw);
    zkt.setEnabledTable(tableName);
    // check that current/0.94 format table has proper ENABLED format
    assertTrue(
// Path: src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java
// public static enum TableState {
//   ENABLED,
//   DISABLED,
//   DISABLING,
//   ENABLING
// };


// Path: src/test/java/org/apache/hadoop/hbase/zookeeper/TestZKTable.java
import org.apache.zookeeper.data.Stat;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mockito.Mockito;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.*;
import org.apache.hadoop.hbase.zookeeper.ZKTable.TableState;
import org.apache.zookeeper.KeeperException;

    assertFalse(zkt.isDisabledTable(name));
    assertFalse(zkt.getDisabledTables().contains(name));
    assertTrue(zkt.isTablePresent(name));
    zkt.setEnabledTable(name);
    assertTrue(zkt.isEnabledTable(name));
    assertFalse(zkt.isEnablingTable(name));
    assertTrue(zkt.isTablePresent(name));
    zkt.setDeletedTable(name);
    assertFalse(zkt.isEnabledTable(name));
    assertFalse(zkt.isDisablingTable(name));
    assertFalse(zkt.isDisabledTable(name));
    assertFalse(zkt.isEnablingTable(name));
    assertFalse(zkt.isDisablingOrDisabledTable(name));
    assertFalse(zkt.isDisabledOrEnablingTable(name));
    assertFalse(zkt.isTablePresent(name));
  }

  /**
   * Test that ZK table writes table state in formats expected by 0.92 and 0.94 clients
   */
  @Test
  public void test9294Compatibility() throws Exception {
    final String tableName = "test9294Compatibility";

    ZooKeeperWatcher zkw = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(),
      tableName, abortable, true);
    ZKTable zkt = new ZKTable(zkw);
    zkt.setEnabledTable(tableName);
    // check that current/0.94 format table has proper ENABLED format
    assertTrue(
      ZKTableReadOnly.getTableState(zkw, zkw.masterTableZNode,  tableName) == TableState.ENABLED);