Java Code Examples for org.robolectric.annotation.Config#Implementation

The following examples show how to use org.robolectric.annotation.Config#Implementation . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GithubSampleTestRunner.java    From Moxy with MIT License 6 votes vote down vote up
@Override
public Config getConfig(@NonNull Method method) {
	final Config defaultConfig = super.getConfig(method);
	return new Config.Implementation(
			new int[]{SDK_EMULATE_LEVEL},
			defaultConfig.manifest(),
			defaultConfig.qualifiers(),
			defaultConfig.packageName(),
			defaultConfig.resourceDir(),
			defaultConfig.assetDir(),
			defaultConfig.shadows(),
			defaultConfig.instrumentedPackages(),
			defaultConfig.application(),
			defaultConfig.libraries(),
			defaultConfig.constants() == Void.class ? BuildConfig.class : defaultConfig.constants()
	);
}
 
Example 2
Source File: ForageRoboelectricUnitTestRunner.java    From Forage with Mozilla Public License 2.0 6 votes vote down vote up
@Override
public Config getConfig(@NonNull Method method) {
    final Config defaultConfig = super.getConfig(method);
    return new Config.Implementation(
            new int[]{SDK_EMULATE_LEVEL},
            defaultConfig.manifest(),
            defaultConfig.qualifiers(),
            defaultConfig.packageName(),
            defaultConfig.abiSplit(),
            defaultConfig.resourceDir(),
            defaultConfig.assetDir(),
            defaultConfig.buildDir(),
            defaultConfig.shadows(),
            defaultConfig.instrumentedPackages(),
            ForageUnitTestApplication.class,
            defaultConfig.libraries(),
            defaultConfig.constants() == Void.class ? BuildConfig.class : defaultConfig.constants()
    );
}
 
Example 3
Source File: ForageRoboelectricIntegrationTestRunner.java    From Forage with Mozilla Public License 2.0 6 votes vote down vote up
@Override
public Config getConfig(@NonNull Method method) {
    final Config defaultConfig = super.getConfig(method);
    return new Config.Implementation(
            new int[]{SDK_EMULATE_LEVEL},
            defaultConfig.manifest(),
            defaultConfig.qualifiers(),
            defaultConfig.packageName(),
            defaultConfig.abiSplit(),
            defaultConfig.resourceDir(),
            defaultConfig.assetDir(),
            defaultConfig.buildDir(),
            defaultConfig.shadows(),
            defaultConfig.instrumentedPackages(),
            ForageUnitTestApplication.class,
            defaultConfig.libraries(),
            defaultConfig.constants() == Void.class ? BuildConfig.class : defaultConfig.constants()
    );
}
 
Example 4
Source File: CustomRobolectricTestRunner.java    From RxAndroidOrm with Apache License 2.0 4 votes vote down vote up
protected Config.Implementation overwriteConfig(Config config, String key, String value) {
    Properties properties = new Properties();
    properties.setProperty(key, value);
    return new Config.Implementation(config, Config.Implementation.fromProperties(properties));
}
 
Example 5
Source File: AndroidUnitTestRunner.java    From AndroidUnitTest with Apache License 2.0 4 votes vote down vote up
protected Config.Implementation overwriteConfig(Config config, String key, String value) {
    Properties properties = new Properties();
    properties.setProperty(key, value);
    return new Config.Implementation(config, Config.Implementation.fromProperties(properties));
}
 
Example 6
Source File: CustomRobolectricTestRunner.java    From Freezer with Apache License 2.0 4 votes vote down vote up
protected Config.Implementation overwriteConfig(Config config, String key, String value) {
    Properties properties = new Properties();
    properties.setProperty(key, value);
    return new Config.Implementation(config, Config.Implementation.fromProperties(properties));
}