@Test public void assertExecutionFailure() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); JobExecutionEvent failureEvent = startEvent.executionFailure("java.lang.RuntimeException: failure"); assertNotNull(failureEvent.getCompleteTime()); assertFalse(failureEvent.isSuccess()); assertThat(failureEvent.getFailureCause(), is("java.lang.RuntimeException: failure")); }
public JobExecutionEvent executionFailure(final String failureCause) { JobExecutionEvent result = new JobExecutionEvent(id, hostname, ip, taskId, jobName, source, shardingItem, startTime, completeTime, success, failureCause); result.setCompleteTime(new Date()); result.setSuccess(false); result.setFailureCause(failureCause); return result; }
JobExecutionEvent implements JobEvent { public JobExecutionEvent executionFailure(final String failureCause) { JobExecutionEvent result = new JobExecutionEvent(id, hostname, ip, taskId, jobName, source, shardingItem, startTime, completeTime, success, failureCause); result.setCompleteTime(new Date()); result.setSuccess(false); result.setFailureCause(failureCause); return result; } }
JobExecutionEvent implements JobEvent { public JobExecutionEvent executionFailure(final String failureCause) { JobExecutionEvent result = new JobExecutionEvent(id, hostname, ip, taskId, jobName, source, shardingItem, startTime, completeTime, success, failureCause); result.setCompleteTime(new Date()); result.setSuccess(false); result.setFailureCause(failureCause); return result; }  }
JobExecutionEvent implements JobEvent { public JobExecutionEvent executionFailure(final String failureCause) { JobExecutionEvent result = new JobExecutionEvent(id, hostname, ip, taskId, jobName, source, shardingItem, startTime, completeTime, success, failureCause); result.setCompleteTime(new Date()); result.setSuccess(false); result.setFailureCause(failureCause); return result; }  JobExecutionEvent executionSuccess(); JobExecutionEvent executionFailure(final String failureCause); }
JobExecutionEvent implements JobEvent { public JobExecutionEvent executionFailure(final String failureCause) { JobExecutionEvent result = new JobExecutionEvent(id, hostname, ip, taskId, jobName, source, shardingItem, startTime, completeTime, success, failureCause); result.setCompleteTime(new Date()); result.setSuccess(false); result.setFailureCause(failureCause); return result; }  JobExecutionEvent executionSuccess(); JobExecutionEvent executionFailure(final String failureCause);  }