success &= checkInt(EXPECTED_RESPONSE_CODE.value, response.getCode().value, "code");
success &= checkOption(MediaTypeRegistry.APPLICATION_LINK_FORMAT, response.getOptions().getContentFormat(), "Content-Format");
success &= checkDiscovery(RESOURCE_URI_2, response.getPayloadString());
// Client sends a GET request for /path to Server
request = new Request(Code.GET, Type.CON);
try {
uri = new URI(serverURI + RESOURCE_URI_2);
} catch (URISyntaxException use) {
throw new IllegalArgumentException("Invalid URI: "
+ use.getMessage());
}
request.setURI(uri);
request.send();
response = request.waitForResponse(6000);
// checking the response
if (response != null) {
// print response info
if (verbose) {
System.out.println("Response received");
System.out.println("Time elapsed (ms): "
+ response.getRTT());
Utils.prettyPrint(response);
}
success &= checkType(Type.ACK, response.getType());
success &= checkInt(EXPECTED_RESPONSE_CODE.value, response.getCode().value, "code");
success &= checkOption(MediaTypeRegistry.APPLICATION_LINK_FORMAT, response.getOptions().getContentFormat(), "Content-Format");
success &= checkDiscovery(RESOURCE_URI_3, response.getPayloadString());
// Client sends a GET request for /path/sub1
request = new Request(Code.GET, Type.CON);
try {
uri = new URI(serverURI + RESOURCE_URI_3);
} catch (URISyntaxException use) {
throw new IllegalArgumentException("Invalid URI: "
+ use.getMessage());