protected RepeatingFailedJobListener createRepeatingFailedJobListener(CommandExecutor commandExecutor) { return new RepeatingFailedJobListener(commandExecutor, getId()); }
protected RepeatingFailedJobListener createRepeatingFailedJobListener(CommandExecutor commandExecutor) { return new RepeatingFailedJobListener(commandExecutor, getId()); }
public String execute(CommandContext commandContext) { TimerEntity timer = createTweetTimer("i'm coding a test", new Date(SOME_TIME + (10 * SECOND))); commandContext.getJobManager().schedule(timer); return timer.getId(); } });
public Void execute(CommandContext commandContext) { JobManager jobManager = commandContext.getJobManager(); timerEntity = new TimerEntity(); timerEntity.setLockOwner(UUID.randomUUID().toString()); timerEntity.setDuedate(new Date()); timerEntity.setRetries(0); StringWriter stringWriter = new StringWriter(); NullPointerException exception = new NullPointerException(); exception.printStackTrace(new PrintWriter(stringWriter)); timerEntity.setExceptionStacktrace(stringWriter.toString()); jobManager.insert(timerEntity); assertNotNull(timerEntity.getId()); return null; } });
public Void execute(CommandContext commandContext) { JobManager jobManager = commandContext.getJobManager(); timerEntity = new TimerEntity(); timerEntity.setLockOwner(UUID.randomUUID().toString()); timerEntity.setDuedate(new Date()); timerEntity.setRetries(0); timerEntity.setExceptionMessage("I'm supposed to fail"); jobManager.insert(timerEntity); assertNotNull(timerEntity.getId()); return null; } });
@Test public void testJobQueryWithExceptions() throws Throwable { createJobWithoutExceptionMsg(); Job job = managementService.createJobQuery().jobId(timerEntity.getId()).singleResult(); assertNotNull(job); List<Job> list = managementService.createJobQuery().withException().list(); assertEquals(list.size(), 1); deleteJobInDatabase(); createJobWithoutExceptionStacktrace(); job = managementService.createJobQuery().jobId(timerEntity.getId()).singleResult(); assertNotNull(job); list = managementService.createJobQuery().withException().list(); assertEquals(list.size(), 1); deleteJobInDatabase(); }
public Void execute(CommandContext commandContext) { timerEntity.delete(); commandContext.getHistoricJobLogManager().deleteHistoricJobLogByJobId(timerEntity.getId()); List<HistoricIncident> historicIncidents = Context .getProcessEngineConfiguration() .getHistoryService() .createHistoricIncidentQuery() .list(); for (HistoricIncident historicIncident : historicIncidents) { commandContext .getDbEntityManager() .delete((DbEntity) historicIncident); } return null; } });
protected RepeatingFailedJobListener createRepeatingFailedJobListener(CommandExecutor commandExecutor) { return new RepeatingFailedJobListener(commandExecutor, getId()); }
public String execute(CommandContext commandContext) { TimerEntity timer = createTweetTimer("i'm coding a test", new Date(SOME_TIME + (10 * SECOND))); commandContext.getJobManager().schedule(timer); return timer.getId(); } });
public Void execute(CommandContext commandContext) { JobManager jobManager = commandContext.getJobManager(); timerEntity = new TimerEntity(); timerEntity.setLockOwner(UUID.randomUUID().toString()); timerEntity.setDuedate(new Date()); timerEntity.setRetries(0); StringWriter stringWriter = new StringWriter(); NullPointerException exception = new NullPointerException(); exception.printStackTrace(new PrintWriter(stringWriter)); timerEntity.setExceptionStacktrace(stringWriter.toString()); jobManager.insert(timerEntity); assertNotNull(timerEntity.getId()); return null; } });
public Void execute(CommandContext commandContext) { JobManager jobManager = commandContext.getJobManager(); timerEntity = new TimerEntity(); timerEntity.setLockOwner(UUID.randomUUID().toString()); timerEntity.setDuedate(new Date()); timerEntity.setRetries(0); timerEntity.setExceptionMessage("I'm supposed to fail"); jobManager.insert(timerEntity); assertNotNull(timerEntity.getId()); return null; } });
public void testJobQueryWithExceptions() throws Throwable { createJobWithoutExceptionMsg(); Job job = managementService.createJobQuery().jobId(timerEntity.getId()).singleResult(); assertNotNull(job); List<Job> list = managementService.createJobQuery().withException().list(); assertEquals(list.size(), 1); deleteJobInDatabase(); createJobWithoutExceptionStacktrace(); job = managementService.createJobQuery().jobId(timerEntity.getId()).singleResult(); assertNotNull(job); list = managementService.createJobQuery().withException().list(); assertEquals(list.size(), 1); deleteJobInDatabase(); }
public Void execute(CommandContext commandContext) { timerEntity.delete(); commandContext.getHistoricJobLogManager().deleteHistoricJobLogByJobId(timerEntity.getId()); List<HistoricIncident> historicIncidents = Context .getProcessEngineConfiguration() .getHistoryService() .createHistoricIncidentQuery() .list(); for (HistoricIncident historicIncident : historicIncidents) { commandContext .getDbEntityManager() .delete((DbEntity) historicIncident); } return null; } });