TunnelCommand extends AbstractCommand { public static TunnelCommand parse(List<String> optionList, ExecutionContext sessionContext) { return null; } TunnelCommand(String commandText, ExecutionContext context);  TunnelCommand(String tableName, String filename, boolean isUp, String commandText,
      ExecutionContext context); static void printUsage(PrintStream out); void run(); static TunnelCommand parse(List<String> optionList, ExecutionContext sessionContext); static DShipCommand parse(String commandString, ExecutionContext sessionContext);  }
@Test public void test() throws Exception { ExecutionContext ctx = ExecutionContext.init(); File temp = File.createTempFile("test", null); temp.deleteOnExit(); DShipCommand cmd = TunnelCommand .parse( "upload pt_test2 partition(ds='q',pt='q') from " + temp.getAbsolutePath(), ctx); assertNotNull(cmd); String expectedCommandText = "tunnel upload -c \'utf8\' -dfp \'yyyy-MM-dd HH:mm:ss\' -fd \',\'" + " -rd \'\n\' -ni \'NULL\' -dbr 'false' " + temp.getAbsolutePath() + " pt_test2/ds='q',pt='q'"; String commandText = cmd.getCommandText(); assertEquals(expectedCommandText, commandText); cmd = TunnelCommand .parse( "download pt_test2 partition(ds='q',pt='q') to " + temp.getAbsolutePath(), ctx); assertNotNull(cmd); expectedCommandText = "tunnel download -c \'utf8\' -dfp \'yyyy-MM-dd HH:mm:ss\' -fd \',\'" + " -rd \'\n\' -ni \'NULL\' " + "pt_test2/ds='q',pt='q' " + temp.getAbsolutePath(); commandText = cmd.getCommandText(); assertEquals(expectedCommandText, commandText); }