(String name, TestBody body)
| 88 | } |
| 89 | |
| 90 | static void test(String name, TestBody body) { |
| 91 | System.out.printf(" %-45s ", name); |
| 92 | try { |
| 93 | String result = body.run(); |
| 94 | System.out.println("PASS " + result); |
| 95 | passed++; |
| 96 | } catch (Exception e) { |
| 97 | Throwable cause = e; |
| 98 | while (cause.getCause() != null) cause = cause.getCause(); |
| 99 | String msg = cause.getMessage() != null ? cause.getMessage() : cause.getClass().getSimpleName(); |
| 100 | System.out.println("FAIL " + (msg.length() > 100 ? msg.substring(0, 100) + "..." : msg)); |
| 101 | failed++; |
| 102 | } |
| 103 | } |
| 104 | } |
no test coverage detected