use of org.powermock.core.classloader.annotations.PowerMockIgnore in project powermock by powermock.
the class PowerMockIgnorePackagesExtractorImpl method addValueFromAnnotation.
private boolean addValueFromAnnotation(final AnnotatedElement element, final Set<String> ignoredPackages) {
PowerMockIgnore annotation = element.getAnnotation(PowerMockIgnore.class);
if (annotation != null) {
String[] ignores = annotation.value();
Collections.addAll(ignoredPackages, ignores);
return annotation.globalIgnore();
}
return true;
}
use of org.powermock.core.classloader.annotations.PowerMockIgnore in project powermock by powermock.
the class PowerMockIgnorePackagesExtractorImpl method getPackagesToIgnore.
@Override
public String[] getPackagesToIgnore(AnnotatedElement element) {
PowerMockIgnore annotation = element.getAnnotation(PowerMockIgnore.class);
boolean useGlobal = true;
if (annotation != null) {
useGlobal = annotation.globalIgnore();
}
Set<String> ignoredPackages = new HashSet<String>();
useGlobal &= extractPackageToIgnore(element, ignoredPackages);
final String[] packageToIgnore = ignoredPackages.toArray(new String[ignoredPackages.size()]);
if (useGlobal) {
return getPackageToIgnoreWithGlobal(packageToIgnore);
} else {
return packageToIgnore;
}
}
Aggregations