test/java/lang/invoke/MethodHandles/CatchExceptionTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java	Sat Nov 29 17:37:28 2014
--- new/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java	Sat Nov 29 17:37:28 2014

*** 22,40 **** --- 22,43 ---- */ package test.java.lang.invoke.MethodHandles; import com.oracle.testlibrary.jsr292.Helper; import jdk.testlibrary.Asserts; + import jdk.testlibrary.TimeLimitedRunner; + import jdk.testlibrary.Utils; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.lang.reflect.Array; import java.util.*; import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Supplier; + import java.util.concurrent.TimeUnit; /* @test * @library /lib/testlibrary/jsr292 /lib/testlibrary/ * @compile CatchExceptionTest.java * @run main/othervm -esa test.java.lang.invoke.MethodHandles.CatchExceptionTest
*** 91,108 **** --- 94,120 ---- catcher = testCase.getCatcher(getCatcherParams()); nargs = Math.max(2, this.argsCount); } public static void main(String[] args) throws Throwable { for (CatchExceptionTest test : TestFactory.MANDATORY_TEST_CASES) { + TestFactory factory = new TestFactory(); + long timeout = Helper.IS_THOROUGH ? 0L : Utils.adjustTimeout(Utils.DEFAULT_TEST_TIMEOUT); + // substract vm init time and reserve time for vm exit + timeout *= 0.9; + TimeLimitedRunner runner = new TimeLimitedRunner(timeout, + () -> { + CatchExceptionTest test = factory.nextTest(); + if (test != null) { test.runTest(); + return true; } ! TestFactory factory = new TestFactory(); ! CatchExceptionTest test; ! while ((test = factory.nextTest()) != null ) { ! return false; ! }); ! for (CatchExceptionTest test : TestFactory.MANDATORY_TEST_CASES) { test.runTest(); } + runner.call(); } private List<Class<?>> getThrowerParams(boolean isVararg, int argsCount) { return Helper.getParams(ARGS_CLASSES, isVararg, argsCount); }

test/java/lang/invoke/MethodHandles/CatchExceptionTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File