Skip to content

Commit

Permalink
replaced Exceptions and RuntimeExceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
spyroukostas committed Apr 12, 2019
1 parent eb0f4cd commit 25a599d
Showing 1 changed file with 11 additions and 6 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -151,7 +152,7 @@ public static ThreadLocal<OAIPMHEndpoint> 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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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<DescriptionType> checker = CheckingIterable.over(identify.getDescription());
checker = checker.checkContainsOne(new Predicate<DescriptionType>() {
Expand Down Expand Up @@ -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<MetadataFormatType> 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");
Expand Down

0 comments on commit 25a599d

Please sign in to comment.