}
// override by getter method, if present
List<FrameworkMethod> getters = getTestClass().getAnnotatedMethods(ArchivePathGetter.class);
if (getters.size() > 1) {
throw new InitializationError("Only one method should be annotated with @ArchivePathGetter. "
+ "The test case \"" + getTestClass().getName() + "\" has " + getters.size() + " annotated methods.");
}
if (classAnnotation == null && getters.size() == 0) {
throw new InitializationError("No archive path annotations found. The test case \""
+ getTestClass().getName() + "\" should be annotated with @ArchivePath or @ArchivePathGetter");
}
if (getters.size() == 1) {
path = invokeGetter(getters.get(0).getMethod());
}
// validate the path
if (path == null) {
throw new InitializationError("Archive path is null.");
}
return path;
}