@Test public void idleBeat(){ final int jobId = 0; final ReturnT<String> retval = executorBiz.idleBeat(jobId); Assert.assertNotNull(retval); Assert.assertNull(((ReturnT<String>) retval).getContent()); Assert.assertEquals(500, retval.getCode()); Assert.assertEquals("job thread is running or has trigger queue.", retval.getMsg()); }
@Override public ReturnT<String> idleBeat(int jobId) { boolean isRunningOrHasQueue = false; JobThread jobThread = XxlJobExecutor.loadJobThread(jobId); if (jobThread != null && jobThread.isRunningOrHasQueue()) { isRunningOrHasQueue = true; } if (isRunningOrHasQueue) { return new ReturnT<String>(ReturnT.FAIL_CODE, "job thread is running or has trigger queue."); } return ReturnT.SUCCESS; }
ExecutorBizImpl implements ExecutorBiz { @Override public ReturnT<String> idleBeat(int jobId) { boolean isRunningOrHasQueue = false; JobThread jobThread = XxlJobExecutor.loadJobThread(jobId); if (jobThread != null && jobThread.isRunningOrHasQueue()) { isRunningOrHasQueue = true; } if (isRunningOrHasQueue) { return new ReturnT<String>(ReturnT.FAIL_CODE, "job thread is running or has trigger queue."); } return ReturnT.SUCCESS; } }
ExecutorBizImpl implements ExecutorBiz { @Override public ReturnT<String> idleBeat(int jobId) { boolean isRunningOrHasQueue = false; JobThread jobThread = XxlJobExecutor.loadJobThread(jobId); if (jobThread != null && jobThread.isRunningOrHasQueue()) { isRunningOrHasQueue = true; } if (isRunningOrHasQueue) { return new ReturnT<String>(ReturnT.FAIL_CODE, "job thread is running or has trigger queue."); } return ReturnT.SUCCESS; }  }
ExecutorBizImpl implements ExecutorBiz { @Override public ReturnT<String> idleBeat(int jobId) { boolean isRunningOrHasQueue = false; JobThread jobThread = XxlJobExecutor.loadJobThread(jobId); if (jobThread != null && jobThread.isRunningOrHasQueue()) { isRunningOrHasQueue = true; } if (isRunningOrHasQueue) { return new ReturnT<String>(ReturnT.FAIL_CODE, "job thread is running or has trigger queue."); } return ReturnT.SUCCESS; }  @Override ReturnT<String> beat(); @Override ReturnT<String> idleBeat(int jobId); @Override ReturnT<String> kill(int jobId); @Override ReturnT<LogResult> log(long logDateTim, long logId, int fromLineNum); @Override ReturnT<String> run(TriggerParam triggerParam); }
ExecutorBizImpl implements ExecutorBiz { @Override public ReturnT<String> idleBeat(int jobId) { boolean isRunningOrHasQueue = false; JobThread jobThread = XxlJobExecutor.loadJobThread(jobId); if (jobThread != null && jobThread.isRunningOrHasQueue()) { isRunningOrHasQueue = true; } if (isRunningOrHasQueue) { return new ReturnT<String>(ReturnT.FAIL_CODE, "job thread is running or has trigger queue."); } return ReturnT.SUCCESS; }  @Override ReturnT<String> beat(); @Override ReturnT<String> idleBeat(int jobId); @Override ReturnT<String> kill(int jobId); @Override ReturnT<LogResult> log(long logDateTim, long logId, int fromLineNum); @Override ReturnT<String> run(TriggerParam triggerParam);  }