本文整理汇总了Java中org.robolectric.internal.bytecode.ShadowMap类的典型用法代码示例。如果您正苦于以下问题:Java ShadowMap类的具体用法?Java ShadowMap怎么用?Java ShadowMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ShadowMap类属于org.robolectric.internal.bytecode包,在下文中一共展示了ShadowMap类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createClassLoaderConfig
import org.robolectric.internal.bytecode.ShadowMap; //导入依赖的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();
}
示例2: createShadowMap
import org.robolectric.internal.bytecode.ShadowMap; //导入依赖的package包/类
private ShadowMap createShadowMap() {
return ShadowMap.EMPTY;
}
示例3: createClassHandler
import org.robolectric.internal.bytecode.ShadowMap; //导入依赖的package包/类
private ClassHandler createClassHandler(ShadowMap shadowMap, SdkEnvironment sdkEnvironment) {
return new ShadowWrangler(shadowMap, sdkEnvironment.getSdkConfig().getApiLevel(), interceptors);
}
示例4: createShadowMap
import org.robolectric.internal.bytecode.ShadowMap; //导入依赖的package包/类
@Override
protected ShadowMap createShadowMap() {
return super.createShadowMap()
.newBuilder()
.build();
}
示例5: configureShadows
import org.robolectric.internal.bytecode.ShadowMap; //导入依赖的package包/类
private void configureShadows(SdkEnvironment sdkEnvironment) {
ShadowMap.Builder builder = createShadowMap().newBuilder();
// Configure shadows *BEFORE* setting the ClassLoader. This is necessary because
// creating the ShadowMap loads all ShadowProvider s via ServiceLoader and this is
// not available once we install the Robolectric class loader.
ShadowMap shadowMap = builder.build();
sdkEnvironment.replaceShadowMap(shadowMap);
sdkEnvironment.configure(createClassHandler(shadowMap, sdkEnvironment), getInterceptors());
}