-
Notifications
You must be signed in to change notification settings - Fork 0
/
ApeTest.java
51 lines (45 loc) · 1.38 KB
/
ApeTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import java.awt.Desktop;
import java.net.URL;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
public class ApeTests {
private static int failures= 0;
private static int succeded = 0;
public static final int TIMEOUT = 200;
@Rule
public TestWatcher watchman = new TestWatcher() {
@Override
protected void failed(Throwable e, Description description) {
failures++;
}
@Override
protected void succeeded(Description description) {
succeded++;
}
};
//@Test(timeout =TIMEOUT)
//tests go here
//
//@Test(expected = NullPointerException.class)
@AfterClass
public static void testCompleted() throws Exception {
if (failures <= 0 && succeded >= 69 /*test count*/) {
try {
Desktop.getDesktop().browse(
new URL("https://ape-unit.github.io/"
+ "ape-invasion/").toURI());
} catch (Exception e) { }
} else {
System.out.println("Ape game not unlocked."
+ "Please continue to work on your tests.");
}
}
}