Search in sources :

Example 1 with Implementation

use of org.robolectric.annotation.Config.Implementation in project robolectric by robolectric.

the class RobolectricTestRunnerTest method supportsOldGetConfigUntil4dot3.

@Test
public void supportsOldGetConfigUntil4dot3() throws Exception {
    Implementation overriddenConfig = Config.Builder.defaults().build();
    List<FrameworkMethod> children = new SingleSdkRobolectricTestRunner(TestWithTwoMethods.class) {

        @Override
        public Config getConfig(Method method) {
            return overriddenConfig;
        }
    }.getChildren();
    Config config = ((RobolectricFrameworkMethod) children.get(0)).getConfiguration().get(Config.class);
    assertThat(config).isSameInstanceAs(overriddenConfig);
}
Also used : Config(org.robolectric.annotation.Config) Method(java.lang.reflect.Method) RobolectricFrameworkMethod(org.robolectric.RobolectricTestRunner.RobolectricFrameworkMethod) FrameworkMethod(org.junit.runners.model.FrameworkMethod) Implementation(org.robolectric.annotation.Config.Implementation) RobolectricFrameworkMethod(org.robolectric.RobolectricTestRunner.RobolectricFrameworkMethod) FrameworkMethod(org.junit.runners.model.FrameworkMethod) Test(org.junit.Test)

Aggregations

Method (java.lang.reflect.Method)1 Test (org.junit.Test)1 FrameworkMethod (org.junit.runners.model.FrameworkMethod)1 RobolectricFrameworkMethod (org.robolectric.RobolectricTestRunner.RobolectricFrameworkMethod)1 Config (org.robolectric.annotation.Config)1 Implementation (org.robolectric.annotation.Config.Implementation)1