本文整理汇总了Java中com.jakewharton.espresso.OkHttp3IdlingResource类的典型用法代码示例。如果您正苦于以下问题:Java OkHttp3IdlingResource类的具体用法?Java OkHttp3IdlingResource怎么用?Java OkHttp3IdlingResource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OkHttp3IdlingResource类属于com.jakewharton.espresso包,在下文中一共展示了OkHttp3IdlingResource类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: callApplicationOnCreate
import com.jakewharton.espresso.OkHttp3IdlingResource; //导入依赖的package包/类
@Override
public void callApplicationOnCreate(Application app) {
super.callApplicationOnCreate(app);
TestApplication testApp = (TestApplication) app;
testApp.inject(this);
IdlingResource picassoIdlingResource = OkHttp3IdlingResource.create(
String.format(Locale.US, "%sOkHttp", OkHttpModule.CLIENT_PICASSO), picassoOkHttpClient);
Espresso.registerIdlingResources(picassoIdlingResource);
IdlingResource serviceIdlingResource = OkHttp3IdlingResource.create(
String.format(Locale.US, "%sOkHttp", OkHttpModule.CLIENT_SERVICE), serviceOkHttpClient);
Espresso.registerIdlingResources(serviceIdlingResource);
}
示例2: apply
import com.jakewharton.espresso.OkHttp3IdlingResource; //导入依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
IdlingResource idlingResource = OkHttp3IdlingResource.create(
"okhttp", OkHttp.getInstance());
Espresso.registerIdlingResources(idlingResource);
base.evaluate();
Espresso.unregisterIdlingResources(idlingResource);
}
};
}
示例3: name
import com.jakewharton.espresso.OkHttp3IdlingResource; //导入依赖的package包/类
@Test
public void name() {
IdlingResource idlingResource = OkHttp3IdlingResource.create(
"okhttp", OkHttpProvider.getOkHttpInstance());
IdlingRegistry.getInstance().register(idlingResource);
onView(withId(R.id.name))
.check(matches(withText("Chiu-Ki Chan")));
IdlingRegistry.getInstance().unregister(idlingResource);
}
示例4: registerOkHttp
import com.jakewharton.espresso.OkHttp3IdlingResource; //导入依赖的package包/类
public static void registerOkHttp(OkHttpClient client) {
IdlingRegistry.getInstance().register(OkHttp3IdlingResource.create("okhttp", client));
}
示例5: setup
import com.jakewharton.espresso.OkHttp3IdlingResource; //导入依赖的package包/类
@Before public void setup() {
IdlingResource resource = OkHttp3IdlingResource.create("OkHttp", ApiUtils.getOkHttpClient());
Espresso.registerIdlingResources(resource);
}
示例6: setUp
import com.jakewharton.espresso.OkHttp3IdlingResource; //导入依赖的package包/类
@Before
public void setUp() {
idlingResource =
OkHttp3IdlingResource.create("OkHttp", InjectionFactory.okHttpClient);
Espresso.registerIdlingResources(idlingResource);
}
示例7: registerOkHttp
import com.jakewharton.espresso.OkHttp3IdlingResource; //导入依赖的package包/类
public static void registerOkHttp(OkHttpClient client) {
IdlingRegistry.getInstance().register(OkHttp3IdlingResource.create(
"okhttp", client));
}