Java 类android.support.test.espresso.base.DefaultFailureHandler 实例源码

项目:spotify-tv    文件:FailureScreenshotRule.java   
public void setupFailureHandler(Description description) {
    final String testClassName = description.getClassName();
    final String testMethodName = description.getMethodName();
    final Context context = InstrumentationRegistry.getTargetContext();
    Espresso.setFailureHandler(new FailureHandler() {
        @Override
        public void handle(Throwable throwable, Matcher<View> matcher) {
            SpoonScreenshotAction.perform("espresso_assertion_failed", testClassName, testMethodName);
            new DefaultFailureHandler(context).handle(throwable, matcher);
        }
    });
}
项目:SecretSauce    文件:SpoonTestRule.java   
@Override
public Statement apply(final Statement base, final Description description) {
    Espresso.setFailureHandler(new FailureHandler() {
        @Override
        public void handle(Throwable error, Matcher<View> viewMatcher) {
            Spoon.screenshot(SpoonTestRule.this.getActivity(), error.getClass().getSimpleName(), description.getClassName(), description.getMethodName());
            new DefaultFailureHandler(SpoonTestRule.this.getActivity()).handle(error, viewMatcher);
        }
    });
    return super.apply(base, description);
}
项目:espresso-macchiato    文件:EspScreenshotFailureHandler.java   
public EspScreenshotFailureHandler(Context targetContext) {
    delegate = new DefaultFailureHandler(targetContext);
}
项目:Ironhide    文件:BaseInstrumentTestCase.java   
public BaseFailureHandler(BaseInstrumentTestCase fixture) {
    this.fixture = fixture;
    this.delegate = new DefaultFailureHandler(fixture.getInstrumentation().getTargetContext());
}
项目:Equate    文件:MyActivityTestRule.java   
public CustomFailureHandle(Context targetContext) {
    delegate = new DefaultFailureHandler(targetContext);
}