TermJob extends MetadataAPIBase { @Override public TermJobInfo execute(String[] params) { try { TermJobInfo termJobInfo = new TermJobInfo(); CommandLine commandLine = getCommandLine(params, PARAMS_STRUCTURE); String pid = commandLine.getOptionValue("process-id"); LOGGER.debug("processId is " + pid); termJobInfo.setProcessId(Integer.parseInt(pid)); jobDAO.termJob(termJobInfo.getProcessId()); processExecutionQueueDAO.updateStatusToFailed(termJobInfo.getProcessId()); ProcessInfo processInfo = new ProcessInfo(); com.wipro.ats.bdre.md.dao.jpa.Process process = new com.wipro.ats.bdre.md.dao.jpa.Process(); process.setProcessId(Integer.parseInt(pid)); process = processDAO.get(Integer.parseInt(pid)); processInfo.setProcessName(process.getProcessName()); DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); Date date = new Date(); String termMessage = " --processId=" + termJobInfo.getProcessId() + " --stage=parent" + " --status=fail" + " --processName=" + process.getProcessName() + " --endTs=" + (dateFormat.format(date)).toString(); try { BasicConfigurator.configure(); StatusNotification statusNotification = new StatusNotification(termMessage, MDConfig.getProperty("status-notification.term-queue")); LOGGER.info(statusNotification.toString()); } catch (Exception e) { LOGGER.error("Error occurred while notifying job status", e); } return termJobInfo; } catch (Exception e) { LOGGER.error("Error occurred", e); throw new MetadataException(e); } } TermJob(); @Override TermJobInfo execute(String[] params);  }
@Ignore @Test public void testExecute() throws Exception { String[] args = {"--process-id", "74"}; TermJob bs = new TermJob(); bs.execute(args); LOGGER.debug("executed!"); }