WaitCommand extends AbstractCommand { private WaitCommand(String id, boolean triggerHooks, String cmd, ExecutionContext ctx) { super(cmd, ctx); this.id = id; this.triggerHooks = triggerHooks; } private  WaitCommand(String id, boolean triggerHooks, String cmd, ExecutionContext ctx); static void printUsage(PrintStream stream); static WaitCommand parse(String cmd, ExecutionContext ctx); static Options getOptions(); @Override void run(); static final String[] HELP_TAGS; }
@Test public void testWaitCommand() throws ODPSConsoleException, OdpsException { ExecutionContext context = ExecutionContext.init(); Odps odps = OdpsConnectionFactory.createOdps(context); Instance instance = SQLTask.run(odps, "select count(*) from " + TEST_TABLE_NAME + ";"); String cmd = "Wait " + instance.getId(); WaitCommand command = WaitCommand.parse(cmd, context); assertNotNull(command); command.run(); }