本文整理汇总了Java中android.support.test.espresso.EspressoException类的典型用法代码示例。如果您正苦于以下问题:Java EspressoException类的具体用法?Java EspressoException怎么用?Java EspressoException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EspressoException类属于android.support.test.espresso包,在下文中一共展示了EspressoException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: randomNameNotDisplayed
import android.support.test.espresso.EspressoException; //导入依赖的package包/类
@Test
public void randomNameNotDisplayed() throws Exception {
try {
assertNameDisplayed(ExamplDb.class.getSimpleName());
fail();
} catch (Exception e) {
assertThat(e, instanceOf(EspressoException.class));
}
}
示例2: handle
import android.support.test.espresso.EspressoException; //导入依赖的package包/类
@Override
public void handle(Throwable error, Matcher<View> viewMatcher) {
if (error instanceof EspressoException || error instanceof AssertionFailedError
|| error instanceof AssertionError) {
Uri location = Uri.EMPTY;
if (activityRef.get() != null) {
location = screenShotManager.shoot(activityRef.get().getWindow().getDecorView());
}
throw Throwables.propagate(getUserFriendlyError(error, viewMatcher, location.toString()));
} else {
throw Throwables.propagate(error);
}
}