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


Java InstrumentationConfiguration类代码示例

本文整理汇总了Java中org.robolectric.internal.bytecode.InstrumentationConfiguration的典型用法代码示例。如果您正苦于以下问题:Java InstrumentationConfiguration类的具体用法?Java InstrumentationConfiguration怎么用?Java InstrumentationConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InstrumentationConfiguration类属于org.robolectric.internal.bytecode包,在下文中一共展示了InstrumentationConfiguration类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createClassLoaderConfig

import org.robolectric.internal.bytecode.InstrumentationConfiguration; //导入依赖的package包/类
/**
 * Create an {@link InstrumentationConfiguration} suitable for the provided {@link FrameworkMethod}.
 *
 * Custom TestRunner subclasses may wish to override this method to provide alternate configuration.
 *
 * @return an {@link InstrumentationConfiguration}
 */
private InstrumentationConfiguration createClassLoaderConfig(Config config) {
    InstrumentationConfiguration.Builder builder = InstrumentationConfiguration.newBuilder()
            .doNotAcquirePackage("java.")
            .doNotAcquirePackage("sun.")
            .doNotAcquirePackage("org.robolectric.annotation.")
            .doNotAcquirePackage("org.robolectric.internal.")
            .doNotAcquirePackage("org.robolectric.util.")
            .doNotAcquirePackage("org.junit.");

    for (Class<?> shadowClass : getExtraShadows()) {
        ShadowMap.ShadowInfo shadowInfo = ShadowMap.getShadowInfo(shadowClass);
        builder.addInstrumentedClass(shadowInfo.getShadowedClassName());
    }

    addInstrumentedPackages(builder);
    AndroidConfigurer.configure(builder, getInterceptors());
    AndroidConfigurer.withConfig(builder, config);
    return builder.build();
}
 
开发者ID:bangarharshit,项目名称:Oleaster,代码行数:27,代码来源:RoboOleaster.java

示例2: createClassLoaderConfig

import org.robolectric.internal.bytecode.InstrumentationConfiguration; //导入依赖的package包/类
@Override
public InstrumentationConfiguration createClassLoaderConfig() {
    InstrumentationConfiguration.Builder builder =
        InstrumentationConfiguration.newBuilder();

    if (notAcquiredPackages != null)
        for (String pkg : notAcquiredPackages) {
            try {
                builder = builder.doNotAquirePackage(pkg);
            } catch (Throwable t) {
                t.printStackTrace();
                System.exit(-1);
            }
        }

    return builder.build();
}
 
开发者ID:clojure-android,项目名称:droid-test,代码行数:18,代码来源:TestRunner.java

示例3: addInstrumentedPackages

import org.robolectric.internal.bytecode.InstrumentationConfiguration; //导入依赖的package包/类
private void addInstrumentedPackages(InstrumentationConfiguration.Builder builder) {
    SandboxConfig classConfig = getTestClass().getJavaClass().getAnnotation(SandboxConfig.class);
    if (classConfig != null) {
        for (String pkgName : classConfig.instrumentedPackages()) {
            builder.addInstrumentedPackage(pkgName);
        }
    }
}
 
开发者ID:bangarharshit,项目名称:Oleaster,代码行数:9,代码来源:RoboOleaster.java

示例4: createClassLoaderConfig

import org.robolectric.internal.bytecode.InstrumentationConfiguration; //导入依赖的package包/类
@Override
public InstrumentationConfiguration createClassLoaderConfig() {
    InstrumentationConfiguration.Builder builder = InstrumentationConfiguration.newBuilder();
    builder.addInstrumentedClass(Gson.class.getName());
    builder.addInstrumentedClass(GsonConverter.class.getName());
    return builder.build();
}
 
开发者ID:infinum,项目名称:Dagger-2-Example,代码行数:8,代码来源:CustomRobolectricGradleTestRunner.java

示例5: createClassLoaderConfig

import org.robolectric.internal.bytecode.InstrumentationConfiguration; //导入依赖的package包/类
@NonNull
@Override
public InstrumentationConfiguration createClassLoaderConfig(Config config) {
    InstrumentationConfiguration.Builder builder = InstrumentationConfiguration.newBuilder();
    for(Class c : CUSTOM_SHADOW_TARGETS)
        builder.addInstrumentedClass(c.getName());
    return builder.build();
}
 
开发者ID:STMicroelectronics-CentralLabs,项目名称:BlueSTSDK_Android,代码行数:9,代码来源:MyTestRunner.java

示例6: createClassLoaderConfig

import org.robolectric.internal.bytecode.InstrumentationConfiguration; //导入依赖的package包/类
@Override
public InstrumentationConfiguration createClassLoaderConfig(Config config) {
    InstrumentationConfiguration.Builder builder = InstrumentationConfiguration.newBuilder().withConfig(config);
    builder.addInstrumentedPackage("net.sqlcipher.database.SQLiteDatabase");
    builder.addInstrumentedPackage("org.commcare.models.encryption");
    return builder.build();
}
 
开发者ID:dimagi,项目名称:commcare-android,代码行数:8,代码来源:CommCareTestRunner.java

示例7: createClassLoaderConfig

import org.robolectric.internal.bytecode.InstrumentationConfiguration; //导入依赖的package包/类
@Override
public InstrumentationConfiguration createClassLoaderConfig() {
    InstrumentationConfiguration.Builder builder = InstrumentationConfiguration.newBuilder();
    return builder.build();
}
 
开发者ID:florent37,项目名称:RxAndroidOrm,代码行数:6,代码来源:CustomRobolectricTestRunner.java

示例8: createClassLoaderConfig

import org.robolectric.internal.bytecode.InstrumentationConfiguration; //导入依赖的package包/类
@Override
public InstrumentationConfiguration createClassLoaderConfig() {
    return InstrumentationConfiguration.newBuilder()
            .addInstrumentedPackage("roboguice.util.")
            .build();
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:7,代码来源:CustomRobolectricTestRunner.java


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