-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make JUnit TestTimedOutExceptions actual timeouts
- Loading branch information
Showing
6 changed files
with
105 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"filename": "Sleepy.java", | ||
"natural_language": "en" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
import static org.junit.Assert.fail; | ||
|
||
public class SleepyTest { | ||
|
||
@Test(timeout = 1) | ||
public void test() throws Exception { | ||
new Sleepy().sleep(); | ||
fail(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
import org.junit.runners.Suite; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(Suite.class) | ||
@Suite.SuiteClasses({ | ||
SleepyTest.class, | ||
}) | ||
public class TestSuite {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"command": "start-judgement" | ||
} | ||
{ | ||
"command": "start-tab", | ||
"hidden": true, | ||
"title": "Compiler" | ||
} | ||
{ | ||
"command": "close-tab" | ||
} | ||
{ | ||
"command": "start-tab", | ||
"hidden": false, | ||
"permission": "student", | ||
"title": "Test" | ||
} | ||
{ | ||
"command": "start-context", | ||
"description": { | ||
"description": "test(SleepyTest)", | ||
"format": "code" | ||
} | ||
} | ||
{ | ||
"command": "start-testcase", | ||
"description": { | ||
"description": "org.junit.runners.model.TestTimedOutException: test timed out after 1 milliseconds", | ||
"format": "code" | ||
} | ||
} | ||
{ | ||
"command": "escalate-status", | ||
"status": { | ||
"enum": "time limit exceeded", | ||
"human": "Tijdslimiet overschreden" | ||
} | ||
} | ||
{ | ||
"command": "append-message", | ||
"message": { | ||
"description": "Caused by org.junit.runners.model.TestTimedOutException: test timed out after 1 milliseconds", | ||
"format": "code" | ||
} | ||
} | ||
{ | ||
"accepted": false, | ||
"command": "close-testcase" | ||
} | ||
{ | ||
"accepted": false, | ||
"command": "close-context" | ||
} | ||
{ | ||
"command": "close-tab" | ||
} | ||
{ | ||
"command": "close-judgement" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.stream.Stream; | ||
import java.util.stream.Collectors; | ||
|
||
public class Sleepy { | ||
|
||
public void sleep() throws InterruptedException { | ||
TimeUnit.DAYS.sleep(Long.MAX_VALUE); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters