equal
deleted
inserted
replaced
68 "Unexpeced nested or concurrent Test.run() call"); |
68 "Unexpeced nested or concurrent Test.run() call"); |
69 } |
69 } |
70 |
70 |
71 TestInstance test = new TestInstance(testBody); |
71 TestInstance test = new TestInstance(testBody); |
72 ThrowingRunnable.toRunnable(() -> runTests(List.of(test))).run(); |
72 ThrowingRunnable.toRunnable(() -> runTests(List.of(test))).run(); |
|
73 test.rethrowIfSkipped(); |
73 if (!test.passed()) { |
74 if (!test.passed()) { |
74 throw new RuntimeException(); |
75 throw new RuntimeException(); |
75 } |
76 } |
76 } |
77 } |
77 |
78 |
362 if (isWindows() || isLinux() || isOSX()) { |
363 if (isWindows() || isLinux() || isOSX()) { |
363 throw new IllegalStateException( |
364 throw new IllegalStateException( |
364 "Platform is known. throwUnknownPlatformError() called by mistake"); |
365 "Platform is known. throwUnknownPlatformError() called by mistake"); |
365 } |
366 } |
366 throw new IllegalStateException("Unknown platform"); |
367 throw new IllegalStateException("Unknown platform"); |
|
368 } |
|
369 |
|
370 public static RuntimeException throwSkippedException(String reason) { |
|
371 trace("Skip the test: " + reason); |
|
372 RuntimeException ex = ThrowingSupplier.toSupplier( |
|
373 () -> (RuntimeException) Class.forName("jtreg.SkippedException").getConstructor( |
|
374 String.class).newInstance(reason)).get(); |
|
375 |
|
376 currentTest.notifySkipped(ex); |
|
377 throw ex; |
367 } |
378 } |
368 |
379 |
369 static void waitForFileCreated(Path fileToWaitFor, |
380 static void waitForFileCreated(Path fileToWaitFor, |
370 long timeoutSeconds) throws IOException { |
381 long timeoutSeconds) throws IOException { |
371 |
382 |