diff --git a/oaipmh-core/pom.xml b/oaipmh-core/pom.xml index 4f5230a70931608440778e14dc7c02b670895ad9..6b32b88ff7e3bb378f0b9cb533f0be88526838c2 100644 --- a/oaipmh-core/pom.xml +++ b/oaipmh-core/pom.xml @@ -153,28 +153,79 @@ </execution> </executions> </plugin> + <plugin> + <!-- We use this plugin to ensure that our usage of the maven-jaxb2-plugin + is JDK 8 compatible in absence of a fix for https://java.net/jira/browse/MAVEN_JAXB2_PLUGIN-80. --> + <groupId>org.codehaus.mojo</groupId> + <artifactId>properties-maven-plugin</artifactId> + <version>${properties-maven-plugin.version}</version> + <executions> + <execution> + <id>set-additional-system-properties</id> + <goals> + <goal>set-system-properties</goal> + </goals> + </execution> + </executions> + <configuration> + <properties> + <property> + <name>javax.xml.accessExternalSchema</name> + <value>file,http</value> + </property> + </properties> + </configuration> + </plugin> <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.14.0</version> <executions> <execution> + <id>generate-oaidc</id> <goals> <goal>generate</goal> </goals> + <configuration> + <schemaDirectory>./src/main/resources/xsd/oaidc</schemaDirectory> + <bindingDirectory>./src/main/resources/binding</bindingDirectory> + <generatePackage>info.textgrid.middleware.oaidc</generatePackage> + <generateDirectory>${project.build.directory}/generated-sources/oaidc</generateDirectory> + <args> + <arg>-extension</arg> + <arg>-Xnamespace-prefix</arg> + </args> + </configuration> + </execution> + <execution> + <id>generate-oaipmh</id> + <goals> + <goal>generate</goal> + </goals> + <configuration> + <!-- <schemas> --> + <!-- <schema> --> + <!-- <url>https://www.openarchives.org/OAI/2.0/OAI-PMH.xsd</url> --> + <!-- </schema> --> + <!-- </schemas> --> + <schemaDirectory>./src/main/resources/xsd/oaipmh</schemaDirectory> + <bindingDirectory>./src/main/resources/binding</bindingDirectory> + <generatePackage>info.textgrid.middleware.oaipmh</generatePackage> + <generateDirectory>${project.build.directory}/generated-sources/oaipmh</generateDirectory> + <args> + <arg>-extension</arg> + <arg>-Xnamespace-prefix</arg> + </args> + </configuration> </execution> </executions> - <configuration> - <generatePackage>info.textgrid.middleware.oaipmh</generatePackage> - <schemaDirectory>src/main/xsd</schemaDirectory> - <schemaIncludes> - <include>*.xsd</include> - </schemaIncludes> - <bindingDirectory>src/main/xsd</bindingDirectory> - <bindingIncludes> - <include>**/*.xjb</include> - </bindingIncludes> - </configuration> + <dependencies> + <dependency> + <groupId>org.jvnet.jaxb2_commons</groupId> + <artifactId>jaxb2-namespace-prefix</artifactId> + <version>1.3</version> + </dependency> + </dependencies> </plugin> </plugins> </build> diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/DublinCoreBuilder.java b/oaipmh-core/src/main/java/info/textgrid/middleware/DublinCoreBuilder.java index 93fc66d2f65a304afd5b502b37f5d34a0940c89f..932b478826529d9eaab5143a30496bd996285b85 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/DublinCoreBuilder.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/DublinCoreBuilder.java @@ -3,10 +3,10 @@ package info.textgrid.middleware; import java.util.List; import javax.xml.bind.JAXB; import javax.xml.bind.JAXBElement; -import info.textgrid.middleware.oaipmh.ElementType; +import info.textgrid.middleware.oaidc.ElementType; import info.textgrid.middleware.oaipmh.MetadataType; -import info.textgrid.middleware.oaipmh.OaiDcType; -import info.textgrid.middleware.oaipmh.ObjectFactory; +import info.textgrid.middleware.oaidc.OaiDcType; +import info.textgrid.middleware.oaidc.ObjectFactory; /** * <p> @@ -312,10 +312,6 @@ public final class DublinCoreBuilder { */ public MetadataType getDC() { this.metadata.setAny(this.oaiDcObj.createDc(this.tgMappedDC)); - - System.out.println(" ##"); - JAXB.marshal(this.metadata, System.out); - return this.metadata; } diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHImpl.java b/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHImpl.java index 7513c23be57a1322f9f06f67db2d7a98e00d187d..ef3a4ccbff61cc98d91067b9e5329afcaa247c9c 100644 --- a/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHImpl.java +++ b/oaipmh-core/src/main/java/info/textgrid/middleware/OAIPMHImpl.java @@ -1,8 +1,10 @@ package info.textgrid.middleware; +import java.io.File; import java.text.ParseException; import java.util.ArrayList; import java.util.List; +import javax.xml.bind.JAXB; import javax.xml.bind.JAXBElement; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.XMLGregorianCalendar; @@ -25,11 +27,28 @@ import info.textgrid.middleware.oaipmh.VerbType; * </p> * * @author Maximilian Brodhun, SUB Göttingen - * @version 2019-05-28 + * @author Stefan E. Funk, SUB Göttingen + * @version 2019-10-17 * @since 2014-01-29 */ public class OAIPMHImpl implements OAIPMHProducer { + // ** + // FINAL + // ** + private static final String OAIPMH_XML_TEMPLATE = + "../oaipmh-core/src/main/resources/templates/oaipmh-template.xml"; + + // ** + // STATIC + // ** + + private static ObjectFactory obf = new ObjectFactory(); + + // ** + // PRIVATE + // ** + private ErrorHandler error = new ErrorHandler(); private org.apache.commons.logging.Log log = LogFactory.getLog(OAIPMHImpl.class); private RepIdentification rep; @@ -46,6 +65,10 @@ public class OAIPMHImpl implements OAIPMHProducer { private MetadataFormatListDeliverer metadataFormatList; private SetDeliverer setList; + // ** + // PUBLIC + // ** + public boolean textgrid; public boolean dariah; @@ -81,23 +104,43 @@ public class OAIPMHImpl implements OAIPMHProducer { /* * (non-Javadoc) * - * @see info.textgrid.middleware.OAIPMHProducer#postRequest(String, String, String, String, - * String, String, String) + * @see info.textgrid.middleware.OAIPMHProducer#postRequest(java.lang.String, java.lang.String, + * java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ public JAXBElement<OAIPMHtype> postRequest(String verb, String identifier, String metadataPrefix, String set, String from, String until, String resumptionToken) { - return handleRequest(verb, identifier, metadataPrefix, set, from, until, resumptionToken); + + JAXBElement<OAIPMHtype> result = null; + + try { + result = handleRequest(verb, identifier, metadataPrefix, set, from, until, resumptionToken); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return result; } /* * (non-Javadoc) * - * @see info.textgrid.middleware.OAIPMHProducer#getRequest(String, String, String, String, String, - * String, String) + * @see info.textgrid.middleware.OAIPMHProducer#getRequest(java.lang.String, java.lang.String, + * java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ public JAXBElement<OAIPMHtype> getRequest(String verb, String identifier, String metadataPrefix, String set, String from, String until, String resumptionToken) { - return handleRequest(verb, identifier, metadataPrefix, set, from, until, resumptionToken); + + JAXBElement<OAIPMHtype> result = null; + + try { + result = handleRequest(verb, identifier, metadataPrefix, set, from, until, resumptionToken); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return result; } /** @@ -114,16 +157,13 @@ public class OAIPMHImpl implements OAIPMHProducer { * incorrect request. * </p> * - * @param obf - * @param oai + * @param oaipmhRoot * @param request * @return */ - public JAXBElement<OAIPMHtype> identifyRequest(ObjectFactory obf, OAIPMHtype oai, - RequestType request) { + public OAIPMHtype identifyRequest(OAIPMHtype oaipmhRoot, RequestType request) { List<String> errorValues = new ArrayList<String>(); - JAXBElement<OAIPMHtype> oaipmhRoot = getOAIPMHRoot(obf, oai); IdentifyType tgRepIdentificationRequest = new IdentifyType(); if (this.rep.requestChecker(request)) { @@ -135,7 +175,7 @@ public class OAIPMHImpl implements OAIPMHProducer { tgRepIdentificationRequest.setRepositoryName(this.rep.getRepositoryName()); tgRepIdentificationRequest.setProtocolVersion(this.rep.getProtocolVersion()); tgRepIdentificationRequest.getAdminEmail().add(this.rep.getAdminMaiAddresss()); - oai.setIdentify(tgRepIdentificationRequest); + oaipmhRoot.setIdentify(tgRepIdentificationRequest); } else { if (request.getIdentifier() != null) { @@ -159,35 +199,31 @@ public class OAIPMHImpl implements OAIPMHProducer { this.error.setError(TGConstants.OAI_BAD_ARGUMENT, "The request includes illegal arguments: " + errorValues); - oai.getError().add(this.error.getError()); + oaipmhRoot.getError().add(this.error.getError()); } return oaipmhRoot; } /** - * checks the GetRecord request of correctness and response including errors in case of an - * incorrect request + * <p> + * Checks the GetRecord request of correctness and response including errors in case of an + * incorrect request. + * </p> * - * @param obf - * @param oai + * @param oaipmhRoot * @param request * @return */ - public JAXBElement<OAIPMHtype> getRecordRequest(ObjectFactory obf, OAIPMHtype oai, - RequestType request) { + public OAIPMHtype getRecordRequest(OAIPMHtype oaipmhRoot, RequestType request) { - JAXBElement<OAIPMHtype> oaipmhRoot = getOAIPMHRoot(obf, oai); - - /** - * Check request. In GetRecord: allowed parameters: identifier, metadataPrefix, verb forbidden: - * resumptionToken, from, till, set optional: no one - */ + // Check request. In GetRecord: allowed parameters: identifier, metadataPrefix, verb forbidden: + // resumptionToken, from, till, set optional: no one. ErrorHandler requestErrors = RecordDelivererAbstract.requestChecker(request); if (requestErrors.getError().getCode() != null) { - oai.getError().add(requestErrors.getError()); + oaipmhRoot.getError().add(requestErrors.getError()); } // Get Record Request is done HERE! @@ -208,12 +244,12 @@ public class OAIPMHImpl implements OAIPMHProducer { getRecord = recDeliv.getRecordById(id); if (getRecord != null) { - oai.setGetRecord(getRecord); + oaipmhRoot.setGetRecord(getRecord); } else { ErrorHandler idError = new ErrorHandler(); idError.setError(TGConstants.OAI_NO_RECORD_MATCH, "The value of the identifier: " + request.getIdentifier() + " is unknown or illegal in this repository"); - oai.getError().add(idError.getError()); + oaipmhRoot.getError().add(idError.getError()); } } @@ -221,24 +257,23 @@ public class OAIPMHImpl implements OAIPMHProducer { } /** - * checks the ListIdentifiers request of correctness and response including errors in case of an - * incorrect request + * <p> + * Checks the ListIdentifiers request of correctness and response including errors in case of an + * incorrect request. + * </p> * - * @param obf * @param oai * @param request * @return * @throws ParseException */ - public JAXBElement<OAIPMHtype> listIdentifiersRequest(ObjectFactory obf, OAIPMHtype oai, - RequestType request) throws ParseException { - - JAXBElement<OAIPMHtype> oaipmhRoot = getOAIPMHRoot(obf, oai); + public OAIPMHtype listIdentifiersRequest(OAIPMHtype oaipmhRoot, RequestType request) + throws ParseException { ErrorHandler requestErrors = IdentifierListDelivererAbstract.requestChecker(request); if (requestErrors.getError().getValue() != null) { - oai.getError().add(requestErrors.getError()); + oaipmhRoot.getError().add(requestErrors.getError()); } else { // If metadataFormat IS SET, set recordListDeliverer accordingly. @@ -266,31 +301,16 @@ public class OAIPMHImpl implements OAIPMHProducer { } } - // // Default is DC. - // - // IdentifierListDelivererInterface listDeliv = this.identifierListDC; - // - // this.log.info("Actual Value of IDIOM MetsMods Boolean is: " - // + IdentifierListDelivererAbstract.isIdiomMets()); - // this.log.info("Actual Value of DublinCore Boolean is: " - // + IdentifierListDelivererAbstract.isDublinCore()); - // - // if (IdentifierListDelivererAbstract.isIdiomMets()) { - // listDeliv = this.identifierListIDIOM; - // } else if (IdentifierListDelivererAbstract.isDublinCore()) { - // listDeliv = this.identifierListDC; - // } - ListIdentifiersType listIdentifiers = idListDeliv.processIdentifierList(request.getFrom(), request.getUntil(), request.getSet(), request.getResumptionToken()); if (listIdentifiers != null) { - oai.setListIdentifiers(listIdentifiers); + oaipmhRoot.setListIdentifiers(listIdentifiers); } else { ErrorHandler idError = new ErrorHandler(); idError.setError(TGConstants.OAI_NO_RECORD_MATCH, "The value of the identifier: " + request.getIdentifier() + " is unknown or illegal in this repository"); - oai.getError().add(idError.getError()); + oaipmhRoot.getError().add(idError.getError()); } } @@ -298,36 +318,31 @@ public class OAIPMHImpl implements OAIPMHProducer { } /** - * checks the ListSets request of correctness and response including errors in case of an - * incorrect request + * <p> + * Checks the ListSets request of correctness and response including errors in case of an + * incorrect request. + * </p> * - * @param obf * @param oai * @param request * @return */ - public JAXBElement<OAIPMHtype> listSetsRequest(ObjectFactory obf, OAIPMHtype oai, - RequestType request) { - - JAXBElement<OAIPMHtype> oaipmhRoot = getOAIPMHRoot(obf, oai); + public OAIPMHtype listSetsRequest(OAIPMHtype oaipmhRoot, RequestType request) { ListSetsType sl = this.setList.setListBuilder(); - oai.setListSets(sl); + oaipmhRoot.setListSets(sl); return oaipmhRoot; } /** * @param id - * @param obf - * @param oai + * @param oaipmhRoot * @param request * @return */ - public JAXBElement<OAIPMHtype> listMetadataFormatsRequest(String id, ObjectFactory obf, - OAIPMHtype oai, RequestType request) { - - JAXBElement<OAIPMHtype> oaipmhRoot = getOAIPMHRoot(obf, oai); + public OAIPMHtype listMetadataFormatsRequest(String id, OAIPMHtype oaipmhRoot, + RequestType request) { List<String> errorValues = new ArrayList<String>(); ListMetadataFormatsType listMF = new ListMetadataFormatsType(); @@ -341,14 +356,16 @@ public class OAIPMHImpl implements OAIPMHProducer { } if (listMF != null) { - - oai.setListMetadataFormats(listMF); + oaipmhRoot.setListMetadataFormats(listMF); } else { this.error.setError(TGConstants.OAI_NO_RECORD_MATCH, "The value of the identifier: " + request.getIdentifier() + " is unknown or illegal in this repository"); - oai.getError().add(this.error.getError()); + oaipmhRoot.getError().add(this.error.getError()); } - } else { + } + + else { + if (request.getFrom() != null) { errorValues.add("from"); } @@ -367,29 +384,24 @@ public class OAIPMHImpl implements OAIPMHProducer { this.error.setError(TGConstants.OAI_BAD_ARGUMENT, "The request includes illegal " + "arguments or is missing required arguments: " + errorValues); - oai.getError().add(this.error.getError()); + oaipmhRoot.getError().add(this.error.getError()); } return oaipmhRoot; } /** - * @param obf * @param oai * @param request * @return */ - public JAXBElement<OAIPMHtype> listRecordsRequest(ObjectFactory obf, OAIPMHtype oai, - RequestType request) { - - // Create OAIPMH root object. - JAXBElement<OAIPMHtype> oaipmhRoot = getOAIPMHRoot(obf, oai); + public OAIPMHtype listRecordsRequest(OAIPMHtype oaipmhRoot, RequestType request) { // Check request's syntax. ErrorHandler requestErrors = RecordListDelivererAbstract.requestChecker(request); if (requestErrors.getError().getCode() != null) { - oai.getError().add(requestErrors.getError()); + oaipmhRoot.getError().add(requestErrors.getError()); } else { // If metadataFormat IS SET, set recordListDeliverer accordingly. @@ -420,7 +432,7 @@ public class OAIPMHImpl implements OAIPMHProducer { request.getSet(), request.getResumptionToken()); if (listRecords != null) { - oai.setListRecords(listRecords); + oaipmhRoot.setListRecords(listRecords); } } @@ -428,7 +440,9 @@ public class OAIPMHImpl implements OAIPMHProducer { } /** - * Taking the sting from the REST request and converting into an OAIPMH verb type + * <p> + * Taking the sting from the REST request and converting into an OAIPMH verb type. + * </p> * * @param verb : what is to within the repository * @return verbParam: the verbParam as an OAIPMH verb type @@ -454,7 +468,7 @@ public class OAIPMHImpl implements OAIPMHProducer { } else if (verb != null && verb.equals("GetRecord")) { verbParam = VerbType.GET_RECORD; } else { - // FIXME + // FIXME What must be fixed here? --fu this.error.setError("VerbError", "Illegal OAI verb"); } @@ -462,11 +476,12 @@ public class OAIPMHImpl implements OAIPMHProducer { } /** - * Setting the from value for the request + * <p> + * Setting the from value for the request. + * </p> * * @param from */ - public void setFromRequestValue(String from, RequestType request) { if (!from.isEmpty()) { request.setFrom(from); @@ -474,7 +489,9 @@ public class OAIPMHImpl implements OAIPMHProducer { } /** - * Setting the until value for the request + * <p> + * Setting the until value for the request. + * </p> * * @param until */ @@ -485,7 +502,9 @@ public class OAIPMHImpl implements OAIPMHProducer { } /** - * Setting the identifier value for the request + * <p> + * Setting the identifier value for the request. + * </p> * * @param identifier */ @@ -496,7 +515,9 @@ public class OAIPMHImpl implements OAIPMHProducer { } /** - * Setting the metadataPrefix value for the request + * <p> + * Setting the metadataPrefix value for the request. + * </p> * * @param metadataPrefix */ @@ -507,7 +528,9 @@ public class OAIPMHImpl implements OAIPMHProducer { } /** - * Setting the resumptionToken value for the request + * <p> + * Setting the resumptionToken value for the request. + * </p> * * @param resumptionToken */ @@ -558,15 +581,17 @@ public class OAIPMHImpl implements OAIPMHProducer { * @param until * @param resumptionToken * @return + * @throws ParseException */ private JAXBElement<OAIPMHtype> handleRequest(String verb, String identifier, - String metadataPrefix, String set, String from, String until, String resumptionToken) { + String metadataPrefix, String set, String from, String until, String resumptionToken) + throws ParseException { JAXBElement<OAIPMHtype> result; - ObjectFactory obf = new ObjectFactory(); - OAIPMHtype response = new OAIPMHtype(); - result = getOAIPMHRoot(obf, response); + // Create new OAIPMH XML document from template, set result. + // OAIPMHtype response = JAXB.unmarshal(new File(OAIPMH_XML_TEMPLATE), OAIPMHtype.class); + OAIPMHtype response = obf.createOAIPMHtype(); VerbType verbParam = setVerb(verb); RequestType request = new RequestType(); @@ -601,22 +626,17 @@ public class OAIPMHImpl implements OAIPMHProducer { if (verbParam != null) { if (verbParam.value().equals("Identify")) { - result = identifyRequest(obf, response, request); + response = identifyRequest(response, request); } else if (verbParam.value().equals("GetRecord")) { - result = getRecordRequest(obf, response, request); + response = getRecordRequest(response, request); } else if (verbParam.value().equals("ListIdentifiers")) { - try { - result = listIdentifiersRequest(obf, response, request); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + response = listIdentifiersRequest(response, request); } else if (verbParam.value().equals("ListSets")) { - result = listSetsRequest(obf, response, request); + response = listSetsRequest(response, request); } else if (verbParam.value().equals("ListMetadataFormats")) { - result = listMetadataFormatsRequest(identifier, obf, response, request); + response = listMetadataFormatsRequest(identifier, response, request); } else if (verbParam.value().equals("ListRecords")) { - result = listRecordsRequest(obf, response, request); + response = listRecordsRequest(response, request); } } else { this.error.setError("VerbError", "Illegal OAI verb"); @@ -624,21 +644,7 @@ public class OAIPMHImpl implements OAIPMHProducer { } response.setRequest(request); - result.setValue(response); - - return result; - } - - /** - * @param obf - * @param oai - * @return - */ - private static JAXBElement<OAIPMHtype> getOAIPMHRoot(ObjectFactory obf, OAIPMHtype oai) { - - JAXBElement<OAIPMHtype> result = obf.createOAIPMH(oai); - - // TODO Add DC XSD URL for xsi:schemaLocation. + result = obf.createOAIPMH(response); return result; } diff --git a/oaipmh-core/src/main/xsd/oai_dc.xsd b/oaipmh-core/src/main/resources/xsd/oaidc/oai_dc.xsd similarity index 100% rename from oaipmh-core/src/main/xsd/oai_dc.xsd rename to oaipmh-core/src/main/resources/xsd/oaidc/oai_dc.xsd diff --git a/oaipmh-core/src/main/xsd/oai_pmh.xsd b/oaipmh-core/src/main/resources/xsd/oaipmh/oai_pmh.xsd similarity index 100% rename from oaipmh-core/src/main/xsd/oai_pmh.xsd rename to oaipmh-core/src/main/resources/xsd/oaipmh/oai_pmh.xsd diff --git a/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTest.java b/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTest.java index 802660c4dc19d131c19fdb50c9ff8a8121bdd935..a7d1107389d9ac2f0a1a71ed6cb8a8629efc3f17 100644 --- a/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTest.java +++ b/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhTest.java @@ -15,10 +15,8 @@ import info.textgrid.middleware.oaipmh.OAIPMHtype; import info.textgrid.namespaces.middleware.tgcrud.common.TextGridMimetypes; /** - * * @author Maximilian Brodhun, SUB Göttingen * @author Stefan E. Funk, SUB Göttingen - * */ public class OaiPmhTest { @@ -215,7 +213,6 @@ public class OaiPmhTest { System.out.println("-----------------------------------\n"); } - /** * @throws ParseException */ @@ -228,7 +225,6 @@ public class OaiPmhTest { "", "", "", "", ""); JAXB.marshal(p, System.out); System.out.println("-----------------------------------\n"); - } /** @@ -251,6 +247,9 @@ public class OaiPmhTest { System.out.println("-----------------------------------\n"); } + /** + * @throws ParseException + */ @Test @Ignore public void testListIdentifierWithResumptionTokenDC() throws ParseException { @@ -266,7 +265,6 @@ public class OaiPmhTest { "", "", "", ""); JAXB.marshal(p, System.out); - String resToken = ""; for (Map.Entry<String, Integer> entry : IdentifierListDelivererDC.cursorCollector.entrySet()) { resToken = entry.getKey(); @@ -283,10 +281,12 @@ public class OaiPmhTest { System.out.println("-----------------------------------\n"); } + /** + * @throws ParseException + */ @Test @Ignore public void testListIdentifierIDIOMInvalidResumptionToken() throws ParseException { - System.out .println("Test for the verb \"ListIdentifiers\" in IDIOM with an invalid resumption token"); JAXBElement<OAIPMHtype> p = this.request.getRequest("ListIdentifiers", "", "", @@ -295,6 +295,9 @@ public class OaiPmhTest { System.out.println("-----------------------------------\n"); } + /** + * @throws ParseException + */ @Test @Ignore public void testListIdentifierIDIOMWithResumptionToken() throws ParseException { @@ -319,7 +322,6 @@ public class OaiPmhTest { System.out.println(IdentifierListDelivererIDIOM.cursorCollector); System.out.println("-----------------------------------\n"); - } /** @@ -369,11 +371,12 @@ public class OaiPmhTest { System.out.println("HASH MAP AFTER: "); System.out.println(RecordListDelivererDC.cursorCollector); - System.out.println("-----------------------------------\n"); - } + /** + * @throws ParseException + */ @Test @Ignore public void testListRecordWithResumptionTokenForIDIOM() throws ParseException { @@ -384,7 +387,6 @@ public class OaiPmhTest { ""); JAXB.marshal(p, System.out); - String resToken = ""; for (Map.Entry<String, Integer> entry : RecordListDelivererIDIOM.cursorCollector.entrySet()) { resToken = entry.getKey(); @@ -397,10 +399,8 @@ public class OaiPmhTest { System.out.println(RecordListDelivererIDIOM.cursorCollector); System.out.println("-----------------------------------\n"); - } - /** * @throws ParseException */ @@ -453,8 +453,6 @@ public class OaiPmhTest { System.out.println("-----------------------------------\n"); } - - /** * @throws ParseException */ @@ -496,7 +494,9 @@ public class OaiPmhTest { System.out.println("-----------------------------------\n"); } - + /** + * @throws ParseException + */ @Test @Ignore public void testEmptyRequest() throws ParseException {