forked from actframework/actframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestBase.java
More file actions
56 lines (41 loc) · 1.22 KB
/
TestBase.java
File metadata and controls
56 lines (41 loc) · 1.22 KB
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
52
53
54
55
56
package testapp;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.runner.JUnitCore;
import org.osgl.util.S;
@Ignore
public class TestBase extends Assert {
protected void same(Object a, Object b) {
assertSame(a, b);
}
protected void eq(Object[] a1, Object[] a2) {
assertArrayEquals(a1, a2);
}
protected void eq(Object o1, Object o2) {
assertEquals(o1, o2);
}
protected void ceq(Object o1, Object o2) {
assertEquals(S.string(o1), S.string(o2));
}
protected void yes(Boolean expr, String msg, Object... args) {
assertTrue(S.fmt(msg, args), expr);
}
protected void yes(Boolean expr) {
assertTrue(expr);
}
protected void no(Boolean expr, String msg, Object... args) {
assertFalse(S.fmt(msg, args), expr);
}
protected void no(Boolean expr) {
assertFalse(expr);
}
protected void fail(String msg, Object... args) {
assertFalse(S.fmt(msg, args), true);
}
protected static void run(Class<? extends TestBase> cls) {
new JUnitCore().run(cls);
}
protected static void println(String tmpl, Object... args) {
System.out.println(String.format(tmpl, args));
}
}