use of it.unibo.arces.wot.sepa.api.protocols.websocket.WebsocketSubscriptionProtocol in project SEPA by arces-wot.
the class ITWebSocketSubscriptionProtocol method SubscribeAndResults.
@RepeatedTest(ConfigurationProvider.REPEATED_TEST)
@Timeout(10)
public void SubscribeAndResults() throws SEPASecurityException, SEPAPropertiesException, SEPAProtocolException, IOException, InterruptedException {
WebsocketSubscriptionProtocol client = new WebsocketSubscriptionProtocol(provider.getJsap().getSubscribeHost(), provider.getJsap().getSubscribePort(), provider.getJsap().getSubscribePath(), this, provider.getClientSecurityManager());
client.subscribe(provider.buildSubscribeRequest("ALL"));
synchronized (mutex) {
while (ITWebSocketSubscriptionProtocol.spuid == null) mutex.wait();
}
synchronized (mutex) {
while (!ITWebSocketSubscriptionProtocol.results) mutex.wait();
}
client.close();
}
use of it.unibo.arces.wot.sepa.api.protocols.websocket.WebsocketSubscriptionProtocol in project SEPA by arces-wot.
the class ITWebSocketSubscriptionProtocol method WrongSubscribe.
@RepeatedTest(ConfigurationProvider.REPEATED_TEST)
@Timeout(10)
public void WrongSubscribe() throws SEPASecurityException, SEPAPropertiesException, SEPAProtocolException, IOException, InterruptedException {
WebsocketSubscriptionProtocol client = new WebsocketSubscriptionProtocol(provider.getJsap().getSubscribeHost(), provider.getJsap().getSubscribePort(), provider.getJsap().getSubscribePath(), this, provider.getClientSecurityManager());
client.subscribe(provider.buildSubscribeRequest("WRONG"));
synchronized (mutex) {
while (!ITWebSocketSubscriptionProtocol.error) mutex.wait();
}
client.close();
}
Aggregations