Skip to content

Commit

Permalink
A simple fix to make the test pass on Mysql
Browse files Browse the repository at this point in the history
Before it would fail because the job name in Quartz would be too long. there is some code at QuartzPollableTaskScheduler#getShortClassName() so could fix that, but for some reason it is not used/finished. To be investigated
  • Loading branch information
aurambaj committed Jul 26, 2023
1 parent a05fa52 commit ebce2e7
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,27 @@ public void testDeleteAllDynamicJobs() throws Exception {
String testJobName2 = testIdWatcher.getEntityName("2");

quartzPollableTaskScheduler.scheduleJob(
QuartzJobInfo.newBuilder(TestJob.class)
QuartzJobInfo.newBuilder(AJob.class)
.withTriggerStartDate(DateTime.now().plus(100000).toDate())
.withUniqueId(testJobName1)
.build());
quartzPollableTaskScheduler.scheduleJob(
QuartzJobInfo.newBuilder(TestJob.class)
QuartzJobInfo.newBuilder(AJob.class)
.withTriggerStartDate(DateTime.now().plus(100000).toDate())
.withUniqueId(testJobName2)
.build());

getL10nJCommander().run("quartz-jobs-view");
assertTrue("Should show 1 job", outputCapture.toString().contains("TestJob_" + testJobName1));
assertTrue("Should show 1 job", outputCapture.toString().contains("TestJob_" + testJobName2));
assertTrue("Should show 1 job", outputCapture.toString().contains("AJob_" + testJobName1));
assertTrue("Should show 1 job", outputCapture.toString().contains("AJob_" + testJobName2));
assertEquals(2L, quartzService.getDynamicJobs().size());

getL10nJCommander().run("quartz-jobs-delete");
getL10nJCommander().run("quartz-jobs-view");
assertEquals(0L, quartzService.getDynamicJobs().size());
}

public static class TestJob extends QuartzPollableJob<Void, Void> {
public static class AJob extends QuartzPollableJob<Void, Void> {

@Override
public Void call(Void input) throws Exception {
Expand Down

0 comments on commit ebce2e7

Please sign in to comment.