mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-03 20:27:58 +08:00
add test
This commit is contained in:
parent
60efa224e5
commit
d93f1d2cb4
@ -5,6 +5,7 @@ import cn.hutool.core.io.watch.WatchMonitor;
|
||||
import cn.hutool.core.io.watch.Watcher;
|
||||
import cn.hutool.core.io.watch.watchers.DelayWatcher;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@ -67,4 +68,19 @@ public class WatchMonitorTest {
|
||||
monitor.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testDelay() {
|
||||
monitor = WatchMonitor.createAll("d:/test", new DelayWatcher(new SimpleWatcher(){
|
||||
@Override
|
||||
public void onModify(final WatchEvent<?> event, final Path currentPath) {
|
||||
final Object obj = event.context();
|
||||
Console.log("修改:{}-> {}", currentPath, obj);
|
||||
ThreadUtil.sleep(5000);
|
||||
Console.log("sleep end");
|
||||
}
|
||||
|
||||
}, 500));
|
||||
monitor.run();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user