Search in sources :

Example 6 with Implements

use of org.robolectric.annotation.Implements in project robolectric by robolectric.

the class AndroidConfigurer method withConfig.

public static void withConfig(InstrumentationConfiguration.Builder builder, Config config) {
    for (Class<?> clazz : config.shadows()) {
        Implements annotation = clazz.getAnnotation(Implements.class);
        if (annotation == null) {
            throw new IllegalArgumentException(clazz + " is not annotated with @Implements");
        }
        String className = annotation.className();
        if (className.isEmpty()) {
            className = annotation.value().getName();
        }
        if (!className.isEmpty()) {
            builder.addInstrumentedClass(className);
        }
    }
    for (String packageName : config.instrumentedPackages()) {
        builder.addInstrumentedPackage(packageName);
    }
}
Also used : Implements(org.robolectric.annotation.Implements)

Example 7 with Implements

use of org.robolectric.annotation.Implements in project robolectric by robolectric.

the class AndroidConfigurer method withConfig.

public void withConfig(InstrumentationConfiguration.Builder builder, Config config) {
    for (Class<?> clazz : config.shadows()) {
        Implements annotation = clazz.getAnnotation(Implements.class);
        if (annotation == null) {
            throw new IllegalArgumentException(clazz + " is not annotated with @Implements");
        }
        String className = annotation.className();
        if (className.isEmpty()) {
            className = annotation.value().getName();
        }
        if (!className.isEmpty()) {
            builder.addInstrumentedClass(className);
        }
    }
    for (String packageName : config.instrumentedPackages()) {
        builder.addInstrumentedPackage(packageName);
    }
}
Also used : Implements(org.robolectric.annotation.Implements)

Aggregations

Implements (org.robolectric.annotation.Implements)7 TypeElement (javax.lang.model.element.TypeElement)2 Map (java.util.Map)1 ExecutableElement (javax.lang.model.element.ExecutableElement)1 TypeParameterElement (javax.lang.model.element.TypeParameterElement)1 TypeMirror (javax.lang.model.type.TypeMirror)1 RealObject (org.robolectric.annotation.RealObject)1 RobolectricProcessor (org.robolectric.annotation.processing.RobolectricProcessor)1