mirror of
https://gitee.com/dromara/hutool.git
synced 2025-06-28 13:34:09 +08:00
fix test
This commit is contained in:
parent
27141c2667
commit
cf7aa225aa
@ -16,13 +16,7 @@ public class CronTest {
|
|||||||
@Test
|
@Test
|
||||||
@Ignore
|
@Ignore
|
||||||
public void customCronTest() {
|
public void customCronTest() {
|
||||||
CronUtil.schedule("*/2 * * * * *", new Task() {
|
CronUtil.schedule("*/2 * * * * *", (Task) () -> Console.log("Task excuted."));
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute() {
|
|
||||||
Console.log("Task excuted.");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 支持秒级别定时任务
|
// 支持秒级别定时任务
|
||||||
CronUtil.setMatchSecond(true);
|
CronUtil.setMatchSecond(true);
|
||||||
@ -54,13 +48,7 @@ public class CronTest {
|
|||||||
@Test
|
@Test
|
||||||
// @Ignore
|
// @Ignore
|
||||||
public void addAndRemoveTest() {
|
public void addAndRemoveTest() {
|
||||||
String id = CronUtil.schedule("*/2 * * * * *", new Runnable() {
|
String id = CronUtil.schedule("*/2 * * * * *", (Runnable) () -> Console.log("task running : 2s"));
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Console.log("task running : 2s");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Console.log(id);
|
Console.log(id);
|
||||||
CronUtil.remove(id);
|
CronUtil.remove(id);
|
||||||
|
Loading…
Reference in New Issue
Block a user