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);
}
}
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);
}
}
Aggregations