@Override public void interceptFeatureExecution(IMethodInvocation invocation) throws Throwable { currentFeature = invocation.getMethod().getFeature(); try { invocation.proceed(); } finally { currentFeature = null; } } }
startLatch.await(5, TimeUnit.SECONDS); } catch (InterruptedException ignored) { System.out.printf("[spock.lang.Timeout] Could not sync with Feature for method '%s'", invocation.getMethod().getName()); waitMillis *= 2; System.out.printf("[spock.lang.Timeout] Method '%s' has not yet returned - interrupting. Next try in %1.2f seconds.\n", invocation.getMethod().getName(), waitMillis / 1000.);
@Override public void interceptFeatureMethod(IMethodInvocation invocation) throws Throwable { Throwable throwable = null; listener.beforeTestMethod(invocation.getInstance(), invocation.getMethod().getReflection()); try { invocation.proceed(); } catch (Throwable t) { throwable = t; throw t; } finally { listener.afterTestMethod(invocation.getInstance(), invocation.getMethod().getReflection(), throwable); } }
final CountDownLatch startLatch = new CountDownLatch(2); new Thread(String.format("[spock.lang.Timeout] Watcher for method '%s'", invocation.getMethod().getName())) { @Override public void run() { startLatch.await(5, TimeUnit.SECONDS); } catch (InterruptedException ignored) { System.out.printf("[spock.lang.Timeout] Could not sync with Watcher for method '%s'", invocation.getMethod().getName());
@Override public final void intercept(IMethodInvocation invocation) throws Throwable { switch(invocation.getMethod().getKind()) { case INITIALIZER: interceptInitializerMethod(invocation);