Java 类org.robolectric.internal.bytecode.InstrumentationConfiguration 实例源码

项目:Oleaster    文件:RoboOleaster.java   
/**
 * 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();
}
项目:droid-test    文件:TestRunner.java   
@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();
}
项目:Oleaster    文件:RoboOleaster.java   
private void addInstrumentedPackages(InstrumentationConfiguration.Builder builder) {
    SandboxConfig classConfig = getTestClass().getJavaClass().getAnnotation(SandboxConfig.class);
    if (classConfig != null) {
        for (String pkgName : classConfig.instrumentedPackages()) {
            builder.addInstrumentedPackage(pkgName);
        }
    }
}
项目:Dagger-2-Example    文件:CustomRobolectricGradleTestRunner.java   
@Override
public InstrumentationConfiguration createClassLoaderConfig() {
    InstrumentationConfiguration.Builder builder = InstrumentationConfiguration.newBuilder();
    builder.addInstrumentedClass(Gson.class.getName());
    builder.addInstrumentedClass(GsonConverter.class.getName());
    return builder.build();
}
项目:BlueSTSDK_Android    文件:MyTestRunner.java   
@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();
}
项目:commcare-android    文件:CommCareTestRunner.java   
@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();
}
项目:RxAndroidOrm    文件:CustomRobolectricTestRunner.java   
@Override
public InstrumentationConfiguration createClassLoaderConfig() {
    InstrumentationConfiguration.Builder builder = InstrumentationConfiguration.newBuilder();
    return builder.build();
}
项目:AndroidUnitTest    文件:AndroidUnitTestRunner.java   
@Override
public InstrumentationConfiguration createClassLoaderConfig() {
    InstrumentationConfiguration.Builder builder = InstrumentationConfiguration.newBuilder();
    return builder.build();
}
项目:Freezer    文件:CustomRobolectricTestRunner.java   
@Override
public InstrumentationConfiguration createClassLoaderConfig() {
    InstrumentationConfiguration.Builder builder = InstrumentationConfiguration.newBuilder();
    return builder.build();
}
项目:edx-app-android    文件:CustomRobolectricTestRunner.java   
@Override
public InstrumentationConfiguration createClassLoaderConfig() {
    return InstrumentationConfiguration.newBuilder()
            .addInstrumentedPackage("roboguice.util.")
            .build();
}