protected final void doCopyTableTest(Configuration conf, boolean bulkload) throws Exception {
    TableName tableName1 = TableName.valueOf(name.getMethodName() + "1");
    TableName tableName2 = TableName.valueOf(name.getMethodName() + "2");
    byte[] family = Bytes.toBytes("family");
    byte[] column = Bytes.toBytes("c1");
    TableDescriptor desc1 = TableDescriptorBuilder.newBuilder(tableName1)
      .setColumnFamily(ColumnFamilyDescriptorBuilder.of(family)).build();
    TableDescriptor desc2 = TableDescriptorBuilder.newBuilder(tableName2)
      .setColumnFamily(ColumnFamilyDescriptorBuilder.of(family)).build();

    try (Table t1 = createSourceTable(desc1); Table t2 = createTargetTable(desc2)) {
      // put rows into the first table
      loadData(t1, family, column);

      String[] peerClusterOptions = getPeerClusterOptions();
      if (bulkload) {
        assertTrue(runCopy(conf,
          ArrayUtils.addAll(peerClusterOptions, "--new.name=" + tableName2.getNameAsString(),
            "--bulkload", tableName1.getNameAsString())));
      } else {
        assertTrue(runCopy(conf, ArrayUtils.addAll(peerClusterOptions,
          "--new.name=" + tableName2.getNameAsString(), tableName1.getNameAsString())));
      }

      // verify the data was copied into table 2
      verifyRows(t2, family, column);
    } finally {
      dropSourceTable(tableName1);
      dropTargetTable(tableName2);
    }
  }
Base class for testing CopyTable MR tool.
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/CopyTableTestBase.java