(String testClass, String method, int port)
| 414 | } |
| 415 | |
| 416 | private static Throwable runTestCaseTest(String testClass, String method, int port) throws Exception { |
| 417 | TestCase test = (TestCase)Class.forName(testClass).getConstructor().newInstance(); |
| 418 | test.setName(method); |
| 419 | TestResult result = new TestResult(); |
| 420 | test.run(result); |
| 421 | if (result.failureCount() != 0) { |
| 422 | Enumeration<TestFailure> e = result.failures(); |
| 423 | return e.nextElement().thrownException(); |
| 424 | } else if (result.errorCount() != 0) { |
| 425 | Enumeration<TestFailure> e = result.errors(); |
| 426 | return e.nextElement().thrownException(); |
| 427 | } |
| 428 | return null; |
| 429 | } |
| 430 | |
| 431 | private static void showMessage(String msg) { |
| 432 | showMessage(msg, 60000); |
no test coverage detected