GetLineageByBatch extends MetadataAPIBase { @Override public List<GetLineageByBatchInfo> execute(String[] params) { List<GetLineageByBatchInfo> lineageByBatchInfos; try { CommandLine commandLine = getCommandLine(params, PARAMS_STRUCTURE); String bid = commandLine.getOptionValue("batch-id"); LOGGER.debug("Batch id is " + bid); GetLineageByBatchInfo getLineageByBatchInfo = new GetLineageByBatchInfo(); getLineageByBatchInfo.setTargetBatchId(Long.parseLong(bid)); lineageByBatchInfos = lineageByBatchDAO.lineageByBatch(getLineageByBatchInfo); LOGGER.info("Details of batch is " + lineageByBatchInfos); return lineageByBatchInfos; } catch (Exception e) { LOGGER.error("Error occurred", e); throw new MetadataException(e); } } GetLineageByBatch(); @Override List<GetLineageByBatchInfo> execute(String[] params);  }
@Ignore @Test public void testExecute() throws Exception { GetLineageByBatch getLineageByBatch = new GetLineageByBatch(); String[] args = {"-bid", "2"}; List<GetLineageByBatchInfo> lineageByBatchInfos = getLineageByBatch.execute(args); System.out.println("lineageByBatchInfos = " + lineageByBatchInfos); }