public void mockTasksRecursively(List<Task<?>> tasks) {
    for (int i = 0;i < tasks.size();i++) {
      Task<?> task = tasks.get(i);
      if (task instanceof DDLTask) {
        DDLTask ddltask = Mockito.spy(new DDLTask());
        Mockito.doThrow(new RuntimeException()).when(ddltask).execute();
        tasks.set(i, ddltask);
      }
      if (task.getNumChild() != 0) {
        mockTasksRecursively(task.getChildTasks());
      }
    }
  }
Test cleaner for TXN_TO_WRITE_ID table.
@throws Exception
ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands2.java