diff --git a/src/main/java/org/eurocris/openaire/cris/validator/CRISValidator.java b/src/main/java/org/eurocris/openaire/cris/validator/CRISValidator.java index d175361..bc86b67 100644 --- a/src/main/java/org/eurocris/openaire/cris/validator/CRISValidator.java +++ b/src/main/java/org/eurocris/openaire/cris/validator/CRISValidator.java @@ -17,6 +17,7 @@ import org.xml.sax.SAXParseException; import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -151,7 +152,7 @@ public static ThreadLocal getEndpoint() { * * @param methodName * @return - * @throws NoSuchMethodException + * @throws NoSuchMethodException when the given method name is wrong. */ public String invokeMethod(String methodName) throws NoSuchMethodException { Method method = CRISValidator.class.getMethod(methodName); @@ -232,7 +233,7 @@ protected static synchronized Schema getParserSchema() throws SAXException { * Create the schema for the second-phase validation. * * @return the compound schema - * @throws SAXException when problem reading the schema + * @throws IllegalStateException when problem reading the schema */ protected static synchronized Schema getValidatorSchema() { if (validatorSchema == null) { @@ -281,9 +282,11 @@ private static Source schema(final String path, final String externalUrl) { /** * Ask for ?verb=Identity and test it for consistence – checks (1). * - * @throws Exception on any unexpected circumstance + * @throws JAXBException + * @throws SAXException + * @throws IOException */ - public void check000_Identify() throws Exception { + public void check000_Identify() throws JAXBException, SAXException, IOException { final IdentifyType identify = endpoint.get().callIdentify(); CheckingIterable checker = CheckingIterable.over(identify.getDescription()); checker = checker.checkContainsOne(new Predicate() { @@ -338,9 +341,11 @@ public boolean test(final DescriptionType description) { /** * Ask for ?verb=ListMetadataFormats and test it for consistence – checks (2). * - * @throws Exception on any unexpected circumstance + * @throws JAXBException + * @throws SAXException + * @throws IOException */ - public void check010_MetadataFormats() throws Exception { + public void check010_MetadataFormats() throws JAXBException, SAXException, IOException { CheckingIterable checker = CheckingIterable.over(endpoint.get().callListMetadataFormats().getMetadataFormat()); checker = checker.checkUnique(MetadataFormatType::getMetadataPrefix, "Metadata prefix not unique"); checker = checker.checkUnique(MetadataFormatType::getMetadataNamespace, "Metadata namespace not unique");