diff --git a/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhOnlineTests.java b/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhOnlineTests.java index 71b40034f259a633e084da74d5119d611d91b093..3906a80b4e69c6050de5fbb543a9fa8c9a10b5ea 100644 --- a/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhOnlineTests.java +++ b/oaipmh-core/src/test/java/info/textgrid/middleware/OaiPmhOnlineTests.java @@ -204,12 +204,12 @@ public class OaiPmhOnlineTests { TGHttpResponse httpResponse = getHttpResponse(url); int status = httpResponse.getStatusCode(); - String restok = showOAI(httpResponse, "oldtok"); + String restok = examineResumptionTokenTag(httpResponse); while (status == HttpStatus.SC_OK && !restok.equals("-1")) { url = host + "/oai?verb=" + verb + "&resumptionToken=" + restok; httpResponse = getHttpResponse(url); - restok = showOAI(httpResponse, restok); + restok = examineResumptionTokenTag(httpResponse); } if (status != HttpStatus.SC_OK) { @@ -239,12 +239,12 @@ public class OaiPmhOnlineTests { TGHttpResponse httpResponse = getHttpResponse(url); int status = httpResponse.getStatusCode(); - String restok = showOAI(httpResponse, "oldtok"); + String restok = examineResumptionTokenTag(httpResponse); while (status == HttpStatus.SC_OK && !restok.equals("-1")) { url = host + "/oai?verb=" + verb + "&resumptionToken=" + restok; httpResponse = getHttpResponse(url); - restok = showOAI(httpResponse, restok); + restok = examineResumptionTokenTag(httpResponse); } if (status != HttpStatus.SC_OK) { @@ -271,8 +271,7 @@ public class OaiPmhOnlineTests { try { Thread.sleep(TIME); } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + // Nothing interrupts here! } System.out.println("\trequest: " + theUrl); @@ -289,17 +288,11 @@ public class OaiPmhOnlineTests { * @param theResponse * @throws IOException */ - private static String showOAI(TGHttpResponse theResponse, String theOldtok) + private static String examineResumptionTokenTag(TGHttpResponse theResponse) throws IOException { String res = IOUtils.readStringFromStream(theResponse.getInputstream()); - // System.out.println("\tresponse: " + res); - - // String tguri = res.substring(res.indexOf("<ns2:relation>textgrid:", - // res.indexOf("</ns2:relation>"))); - // System.out.println("\ttguri: " + tguri); - try { String restokTmp = res.substring(res.indexOf("<resumptionToken"), res.indexOf("</resumptionToken>")); @@ -319,12 +312,6 @@ public class OaiPmhOnlineTests { cursorStr.indexOf("\""))); System.out.println("\tsize: " + size + " / " + cursor); - // if (restok.equals(theOldtok)) { - // System.out.println(" ## ERROR ## oldtok == restok: "); - // System.out.println(" ## restok: " + restok); - // System.out.println(" ## oldtok: " + theOldtok); - // } - System.out.println("\t------------"); if (cursor >= size && !restok.isEmpty()) {