@SuppressWarnings({"UnusedDeclaration"}) public static Object methodInvoked(Class clazz, String methodName, Object instance, String[] paramTypes, Object[] params) throws Throwable { try { return classHandler.methodInvoked(clazz, methodName, instance, paramTypes, params); } catch(java.lang.LinkageError e) { throw new Exception(e); } }
@Override protected Statement methodBlock(final FrameworkMethod method) { setupI18nStrictState(method.getMethod(), robolectricConfig); if (classHandler != null) { classHandler.configure(robolectricConfig); classHandler.beforeTest(); } delegate.internalBeforeTest(method.getMethod()); final Statement statement = super.methodBlock(method); return new Statement() { @Override public void evaluate() throws Throwable { // todo: this try/finally probably isn't right -- should mimic RunAfters? [xw] try { statement.evaluate(); } finally { delegate.internalAfterTest(method.getMethod()); if (classHandler != null) { classHandler.afterTest(); } } } }; }
@Override public void evaluate() throws Throwable { // todo: this try/finally probably isn't right -- should mimic RunAfters? [xw] try { statement.evaluate(); } finally { delegate.internalAfterTest(method.getMethod()); if (classHandler != null) { classHandler.afterTest(); } } } };
classHandler.instrument(ctClass);
classHandler.configure(robolectricConfig); classHandler.beforeTest();
@Override public void evaluate() throws Throwable { HashMap<Field,Object> withConstantAnnos = getWithConstantAnnotations(method.getMethod()); // todo: this try/finally probably isn't right -- should mimic RunAfters? [xw] try { if (withConstantAnnos.isEmpty()) { statement.evaluate(); } else { synchronized(this) { setupConstants(withConstantAnnos); statement.evaluate(); setupConstants(withConstantAnnos); } } } finally { delegate.internalAfterTest(method.getMethod()); if (classHandler != null) { classHandler.afterTest(); } } } };