@Override public void execute(final Object[] args) throws Throwable { Utils.invoke(body, method, timeoutMillis, args); }
@Override public Object invoke(Object target, Method method, Object[] args) throws Throwable { for (Object plugin : getPlugins()) { if (type.isInstance(plugin)) { try { Utils.invoke(plugin, method, 0, args); } catch (Throwable t) { if (!method.getName().equals("startOfScenarioLifeCycle") && !method.getName().equals("endOfScenarioLifeCycle")) { // IntelliJ has its own formatter which doesn't yet implement these methods. throw t; } } } } return null; } });
/** * {@inheritDoc} */ @Override public Object invoke(Object target, Method method, Object[] args) throws Throwable { synchronized(ZucchiniInvocationHandler.lock) { Utils.invoke(this.baseProxy, method, 0, args); } return null; } }
@Override public void execute(final Object[] args) throws Throwable { Utils.invoke(body, method, timeoutMillis, args); }
public void execute(final I18n i18n, final Object[] args) throws Throwable { Utils.invoke(instance, method, timeout, args); }
private Pattern pattern(final Annotation annotation) throws Throwable { final Method regexpMethod = annotation.getClass().getMethod("value"); final String regexpString = (String) Utils.invoke(annotation, regexpMethod, 0); return Pattern.compile(regexpString); }
private long timeout(final Annotation annotation) throws Throwable { final Method regexpMethod = annotation.getClass().getMethod("timeout"); return (Long) Utils.invoke(annotation, regexpMethod, 0); }
@Override public void execute(final Scenario scenario) throws Throwable { Object[] args; switch (method.getParameterTypes().length) { case 0: args = new Object[0]; break; case 1: if (!Scenario.class.equals(method.getParameterTypes()[0])) { throw new CucumberException("When a hook declares an argument it must be of type " + Scenario.class.getName() + ". " + method.toString()); } args = new Object[]{scenario}; break; default: throw new CucumberException("Hooks must declare 0 or 1 arguments. " + method.toString()); } Utils.invoke(instance, method, timeout, args); }