Skip to content

Commit

Permalink
chore: add illegal expression test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
arjenzhou committed Jul 23, 2023
1 parent 6d7af7e commit 9cc87be
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public void execute(JobExecutionContext context) {
}
scheduledJob.start();
LOG.info("Job " + scheduledJob.getClass().getTypeName() + " triggered by instanceId: " + context.getFireInstanceId() + " has completed");
} catch (ParseException ignored) {
} catch (ParseException e) {
LOG.error("Job " + scheduledJob.getClass().getTypeName() + " parse expression failed", e);
}
});
}
Expand Down
3 changes: 2 additions & 1 deletion scheduler/src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import com.arjenzhou.kit.scheduler.job.ScheduledJob;
import test.com.arjenzhou.kit.scheduler.CalculationJob;
import test.com.arjenzhou.kit.scheduler.LogTimeJob;
import test.com.arjenzhou.kit.scheduler.ParseFailedJob;

/**
* @author [email protected]
Expand All @@ -13,5 +14,5 @@
requires org.slf4j;
requires org.junit.jupiter.api;

provides ScheduledJob with LogTimeJob, CalculationJob;
provides ScheduledJob with LogTimeJob, CalculationJob, ParseFailedJob;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package test.com.arjenzhou.kit.scheduler;

import com.arjenzhou.kit.scheduler.job.MemorySchedulerJob;
import com.arjenzhou.kit.scheduler.job.Scheduled;

/**
* @author [email protected]
* @since 2023/7/24
*/
@Scheduled(cronExpression = "1113 * * * * ?")
public class ParseFailedJob extends MemorySchedulerJob {
@Override
public void execute() {
// do nothing
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
test.com.arjenzhou.kit.scheduler.LogTimeJob
test.com.arjenzhou.kit.scheduler.CalculationJob
test.com.arjenzhou.kit.scheduler.CalculationJob
test.com.arjenzhou.kit.scheduler.ParseFailedJob

This file was deleted.

0 comments on commit 9cc87be

Please sign in to comment.