@Test
  public void testFullBackupSetExist() throws Exception {
    LOG.info("Test full backup, backup set exists");

    // Create set
    try (BackupSystemTable table = new BackupSystemTable(TEST_UTIL.getConnection())) {
      String name = "name";
      table.addToBackupSet(name, new String[] { table1.getNameAsString() });
      List<TableName> names = table.describeBackupSet(name);

      assertNotNull(names);
      assertTrue(names.size() == 1);
      assertTrue(names.get(0).equals(table1));

      String[] args = new String[] { "create", "full", BACKUP_ROOT_DIR, "-s", name };
      // Run backup
      int ret = ToolRunner.run(conf1, new BackupDriver(), args);
      assertTrue(ret == 0);
      List<BackupInfo> backups = table.getBackupHistory();
      assertTrue(backups.size() == 1);
      String backupId = backups.get(0).getBackupId();
      assertTrue(checkSucceeded(backupId));

      LOG.info("backup complete");

      // Restore from set into other table
      args = new String[] { BACKUP_ROOT_DIR, backupId, "-s", name, "-m",
        table1_restore.getNameAsString(), "-o" };
      // Run backup
      ret = ToolRunner.run(conf1, new RestoreDriver(), args);
      assertTrue(ret == 0);
      Admin hba = TEST_UTIL.getAdmin();
      assertTrue(hba.tableExists(table1_restore));
      // Verify number of rows in both tables
      assertEquals(TEST_UTIL.countRows(table1), TEST_UTIL.countRows(table1_restore));
      TEST_UTIL.deleteTable(table1_restore);
      LOG.info("restore into other table is complete");
      hba.close();
    }
  }
Verify that full backup is created on a single table with data correctly.
@throws Exception if doing the backup or an operation on the tables fails
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestFullBackupSet.java