mirror of
https://github.com/rasilon/ujetl.git
synced 2026-04-11 10:29:29 +00:00
Add TimeLimiter test.
This commit is contained in:
parent
4fe30a196c
commit
ff157e6a59
1 changed files with 25 additions and 0 deletions
25
src/test/java/com/rasilon/ujetl/TestTimeLimiter.java
Normal file
25
src/test/java/com/rasilon/ujetl/TestTimeLimiter.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.rasilon.ujetl;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.AfterAll;
|
||||||
|
import org.junit.jupiter.api.MethodOrderer.Alphanumeric;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
|
|
||||||
|
public class TestTimeLimiter {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test001Limiter() {
|
||||||
|
try {
|
||||||
|
TimeLimiter hardLimit = new TimeLimiter(1,false);
|
||||||
|
hardLimit.start();
|
||||||
|
|
||||||
|
Thread.sleep(10000);
|
||||||
|
|
||||||
|
fail("Sleep wasn't interrupted by the limiter!");
|
||||||
|
} catch(Exception e) {
|
||||||
|
// Pass
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue