org.robolectric.annotation.Config.application()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中org.robolectric.annotation.Config.application()方法的一些代码示例,展示了Config.application()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.application()方法的具体详情如下:
包路径:org.robolectric.annotation.Config
类名称:Config
方法名:application

Config.application介绍

暂无

代码示例

代码示例来源:origin: robolectric/robolectric

this.instrumentedPackages = instrumentedPackages.toArray(new String[instrumentedPackages.size()]);
this.application = pick(this.application, overlayConfig.application(), DEFAULT_APPLICATION);

代码示例来源:origin: robolectric/robolectric

@VisibleForTesting
static Application createApplication(AndroidManifest appManifest, Config config) {
 Application application = null;
 if (config != null && !Config.Builder.isDefaultApplication(config.application())) {
  if (config.application().getCanonicalName() != null) {
   Class<? extends Application> applicationClass;
   try {
    applicationClass = ClassNameResolver.resolve(null, config.application().getName());
   } catch (ClassNotFoundException e) {
    throw new RuntimeException(e);

代码示例来源:origin: robolectric/robolectric

public Builder(Config config) {
 sdk = config.sdk();
 minSdk = config.minSdk();
 maxSdk = config.maxSdk();
 manifest = config.manifest();
 qualifiers = config.qualifiers();
 packageName = config.packageName();
 resourceDir = config.resourceDir();
 assetDir = config.assetDir();
 shadows = config.shadows();
 instrumentedPackages = config.instrumentedPackages();
 application = config.application();
 libraries = config.libraries();
}

代码示例来源:origin: robolectric/robolectric

private static void assertConfig(
  Config config,
  int[] sdk,
  String manifest,
  Class<? extends Application> application,
  String packageName,
  String qualifiers,
  String resourceDir,
  String assetsDir,
  Class<?>[] shadows,
  String[] instrumentedPackages,
  String[] libraries) {
 assertThat(config.sdk()).isEqualTo(sdk);
 assertThat(config.manifest()).isEqualTo(manifest);
 assertThat(config.application()).isEqualTo(application);
 assertThat(config.packageName()).isEqualTo(packageName);
 assertThat(config.qualifiers()).isEqualTo(qualifiers);
 assertThat(config.resourceDir()).isEqualTo(resourceDir);
 assertThat(config.assetDir()).isEqualTo(assetsDir);
 assertThat(config.shadows()).asList().containsAllIn(shadows).inOrder();
 assertThat(config.instrumentedPackages()).asList().containsAllIn(instrumentedPackages);
 assertThat(config.libraries()).asList().containsAllIn(libraries);
}

代码示例来源:origin: org.robolectric/robolectric

@VisibleForTesting
static Application createApplication(AndroidManifest appManifest, Config config) {
 Application application = null;
 if (config != null && !Config.Builder.isDefaultApplication(config.application())) {
  if (config.application().getCanonicalName() != null) {
   Class<? extends Application> applicationClass;
   try {
    applicationClass = ClassNameResolver.resolve(null, config.application().getName());
   } catch (ClassNotFoundException e) {
    throw new RuntimeException(e);

代码示例来源:origin: org.robolectric/annotations

this.instrumentedPackages = instrumentedPackages.toArray(new String[instrumentedPackages.size()]);
this.application = pick(this.application, overlayConfig.application(), DEFAULT_APPLICATION);

代码示例来源:origin: org.robolectric/annotations

public Builder(Config config) {
 sdk = config.sdk();
 minSdk = config.minSdk();
 maxSdk = config.maxSdk();
 manifest = config.manifest();
 qualifiers = config.qualifiers();
 packageName = config.packageName();
 resourceDir = config.resourceDir();
 assetDir = config.assetDir();
 shadows = config.shadows();
 instrumentedPackages = config.instrumentedPackages();
 application = config.application();
 libraries = config.libraries();
}

相关文章