warn("Class "
+ elementAsString(parent)
+ "\n\t contains more than one @Parameters method\n\tOnly one @Parameters method is allowed for a test class");
}
exists.add(parent);
ExecutableElement ee = (ExecutableElement) element;
if (!ee.getModifiers().contains(Modifier.STATIC)) {
warn("Method "
+ elementAsString(element)
+ "\n\tis prefixed with @Parameters and is not static\n\tThe parameters method must be static");
}
if (!ee.getModifiers().contains(Modifier.PUBLIC)) {
warn("Method "
+ elementAsString(element)
+ "\n\tis prefixed with @Parameters and is not public\n\tThe parameters method must be public");
}
TypeMirror rt = ee.getReturnType();
if (rt.getKind() != TypeKind.DECLARED) {
warn("Method " + elementAsString(element)
+ "\n\tis prefixed with @Parameters and return " + rt
+ "\n\tThe parameters method must return " + stream);
} else {
DeclaredType dt = (DeclaredType) rt;
if (!processingEnv.getTypeUtils().isSubtype(
dt.asElement().asType(), stream.asType())) {
warn("Method " + elementAsString(element)
+ "\n\tis prefixed with @Parameters and return "
+ dt.asElement().asType()
+ "\n\tThe parameters method must return " + stream);
}
}
if (ee.getParameters().size() != 0) {
warn("Method "
+ elementAsString(element)
+ "\n\tis prefixed with @Parameters and is not 0-args\n\tThe parameters method must be 0-args");
}
}