当前位置: 首页>>代码示例>>Java>>正文


Java OkHttp3IdlingResource类代码示例

本文整理汇总了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);
}
 
开发者ID:xmartlabs,项目名称:bigbang,代码行数:16,代码来源:TestRunner.java

示例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);
    }
  };
}
 
开发者ID:chiuki,项目名称:mockwebserver-demo,代码行数:16,代码来源:OkHttpIdlingResourceRule.java

示例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);
}
 
开发者ID:chiuki,项目名称:espresso-samples,代码行数:12,代码来源:MainActivityTest.java

示例4: registerOkHttp

import com.jakewharton.espresso.OkHttp3IdlingResource; //导入依赖的package包/类
public static void registerOkHttp(OkHttpClient client) {
    IdlingRegistry.getInstance().register(OkHttp3IdlingResource.create("okhttp", client));
}
 
开发者ID:iamBedant,项目名称:InstantAppStarter,代码行数:4,代码来源:IdlingResources.java

示例5: setup

import com.jakewharton.espresso.OkHttp3IdlingResource; //导入依赖的package包/类
@Before public void setup() {
  IdlingResource resource = OkHttp3IdlingResource.create("OkHttp", ApiUtils.getOkHttpClient());
  Espresso.registerIdlingResources(resource);
}
 
开发者ID:mutualmobile,项目名称:Barricade,代码行数:5,代码来源:MainActivityTest.java

示例6: setUp

import com.jakewharton.espresso.OkHttp3IdlingResource; //导入依赖的package包/类
@Before
public void setUp() {
    idlingResource =
            OkHttp3IdlingResource.create("OkHttp", InjectionFactory.okHttpClient);
    Espresso.registerIdlingResources(idlingResource);
}
 
开发者ID:handstandsam,项目名称:AndroidHttpMockingExamples,代码行数:7,代码来源:RealServerTest.java

示例7: registerOkHttp

import com.jakewharton.espresso.OkHttp3IdlingResource; //导入依赖的package包/类
public static void registerOkHttp(OkHttpClient client) {
  IdlingRegistry.getInstance().register(OkHttp3IdlingResource.create(
      "okhttp", client));
}
 
开发者ID:chiuki,项目名称:espresso-samples,代码行数:5,代码来源:IdlingResources.java


注:本文中的com.jakewharton.espresso.OkHttp3IdlingResource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。