Skip to content
Snippets Groups Projects
Commit 6e62abf8 authored by Stefan E. Funk's avatar Stefan E. Funk
Browse files

mc in online test class.

parent 46dfa53f
No related branches found
No related tags found
No related merge requests found
......@@ -234,7 +234,21 @@ public class OaiPmhOnlineTests {
String query = url.getPath() + "?" + url.getQuery();
TGHttpClient client = new TGHttpClient(host);
return client.get(query);
// Get response.
TGHttpResponse response = client.get(query);
// Check HTTP status.
int status = response.getStatusCode();
String reason = response.getReasonPhrase();
System.out.println("\tstatus: " + status + " " + reason);
if (status != HttpStatus.SC_OK) {
System.err.println("\tstatus: " + status);
System.err.println(ERROR);
assertTrue(false);
}
return response;
}
/**
......@@ -247,10 +261,6 @@ public class OaiPmhOnlineTests {
private static String examineResumptionTokenTag(TGHttpResponse theResponse,
String recordOrHeader, String oldtok) throws IOException {
int status = theResponse.getStatusCode();
String reason = theResponse.getReasonPhrase();
System.out.println("\tstatus: " + status + " " + reason);
String res = IOUtils.readStringFromStream(theResponse.getInputstream());
// System.out.println(res);
......@@ -355,13 +365,6 @@ public class OaiPmhOnlineTests {
TGHttpResponse httpResponse = getHttpResponse(url);
int status = httpResponse.getStatusCode();
// Check HTTP status.
if (status != HttpStatus.SC_OK) {
System.err.println("\tstatus: " + status);
System.err.println(ERROR);
assertTrue(false);
}
long timeRunning = System.currentTimeMillis() - startTime;
System.out.println("\ttime: " + getDurationInSecs(timeRunning));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment