@Test public void testCorruptedSnapshot() throws IOException, InterruptedException { SnapshotTestingUtils.corruptSnapshot(TEST_UTIL, Bytes.toString(snapshotName0)); TableName cloneName = TableName.valueOf(getValidMethodName() + "-" + System.currentTimeMillis()); try { admin.cloneSnapshot(snapshotName0, cloneName); fail("Expected CorruptedSnapshotException, got succeeded cloneSnapshot()"); } catch (CorruptedSnapshotException e) { // Got the expected corruption exception. // check for no references of the cloned table. assertFalse(admin.tableExists(cloneName)); } catch (Exception e) { fail("Expected CorruptedSnapshotException got: " + e); } } }
@Test public void testCorruptedSnapshot() throws IOException, InterruptedException { SnapshotTestingUtils.corruptSnapshot(TEST_UTIL, Bytes.toString(snapshotName0)); TableName cloneName = TableName.valueOf(getValidMethodName() + "-" + System.currentTimeMillis()); try { admin.cloneSnapshot(snapshotName0, cloneName); fail("Expected CorruptedSnapshotException, got succeeded cloneSnapshot()"); } catch (CorruptedSnapshotException e) { // Got the expected corruption exception. // check for no references of the cloned table. assertFalse(admin.tableExists(cloneName)); } catch (Exception e) { fail("Expected CorruptedSnapshotException got: " + e); } } }