use of it.unibo.arces.wot.sepa.commons.response.Response in project SEPA by arces-wot.
the class StatusMonitor method switchStatus.
private void switchStatus(String thing, boolean status) {
// Update
Bindings bindings = new Bindings();
if (status)
bindings.addBinding("value", new RDFTermLiteral("true"));
else
bindings.addBinding("value", new RDFTermLiteral("false"));
bindings.addBinding("thing", new RDFTermURI(thing));
Response ret = update(bindings);
if (ret.isUpdateResponse()) {
discoverables.put(thing, status);
if (status)
logger.warn("Web Thing: " + thing + " turned ON");
else
logger.warn("Web Thing: " + thing + " turned OFF");
}
}
use of it.unibo.arces.wot.sepa.commons.response.Response in project SEPA by arces-wot.
the class ITProtocolTest method Subscribe.
@Test(timeout = 5000)
public void Subscribe() {
final Response response = submitSubscribe(TestQueries.SIMPLE_QUERY, client);
assertFalse(String.valueOf(response.getAsJsonObject()), response.isError());
}
use of it.unibo.arces.wot.sepa.commons.response.Response in project SEPA by arces-wot.
the class ITProtocolTest method Update.
@Test(timeout = 5000)
public void Update() {
final Response update = SubmitUpdate(client, TestQueries.SIMPLE_UPDATE);
assertFalse(String.valueOf(update.getAsJsonObject()), update.isError());
}
use of it.unibo.arces.wot.sepa.commons.response.Response in project SEPA by arces-wot.
the class ITSecureProtocolTest method Register.
@Test
public void Register() {
Response response;
response = client.register(NOT_VALID_ID);
assertTrue("Accepted not valid ID", response.isError());
response = client.register(VALID_ID);
assertTrue("Not accepted valid ID", response.isError());
}
use of it.unibo.arces.wot.sepa.commons.response.Response in project SEPA by arces-wot.
the class ITSecureProtocolTest method RequestToken.
@Test
@Ignore
public void RequestToken() throws SEPASecurityException {
Response response;
response = client.requestToken();
assertFalse(String.valueOf(response.getAsJsonObject()), response.isError());
assertFalse("SEPA returned an expired token", properties.isTokenExpired());
}
Aggregations