use of it.unibo.arces.wot.sepa.ConfigurationProvider in project SEPA by arces-wot.
the class ITSPARQL11SEProtocol method beginTest.
@BeforeEach
public void beginTest() throws IOException, SEPAProtocolException, SEPAPropertiesException, SEPASecurityException, URISyntaxException, InterruptedException {
provider = new ConfigurationProvider();
handler = new Sync();
protocol = new WebsocketSubscriptionProtocol(provider.getJsap().getSubscribeHost(), provider.getJsap().getSubscribePort(), provider.getJsap().getSubscribePath(), handler, provider.getClientSecurityManager());
client = new SPARQL11SEProtocol(protocol, provider.getClientSecurityManager());
Response ret = client.update(provider.buildUpdateRequest("DELETE_ALL"));
assertFalse(ret.isError(), String.valueOf(ret));
}
use of it.unibo.arces.wot.sepa.ConfigurationProvider in project SEPA by arces-wot.
the class ITWebsocketClientEndpoint method init.
@BeforeAll
public static void init() throws SEPAPropertiesException, SEPASecurityException, InterruptedException, SEPAProtocolException {
provider = new ConfigurationProvider();
// Connect
String scheme = "ws://";
if (provider.getClientSecurityManager() != null)
scheme = "wss://";
if (provider.getJsap().getSubscribePort() == -1)
try {
url = new URI(scheme + provider.getJsap().getSubscribeHost() + provider.getJsap().getSubscribePath());
} catch (URISyntaxException e) {
logger.error(e.getMessage());
throw new SEPAProtocolException(e);
}
else
try {
url = new URI(scheme + provider.getJsap().getSubscribeHost() + ":" + provider.getJsap().getSubscribePort() + provider.getJsap().getSubscribePath());
} catch (URISyntaxException e) {
logger.error(e.getMessage());
throw new SEPAProtocolException(e);
}
}
use of it.unibo.arces.wot.sepa.ConfigurationProvider in project SEPA by arces-wot.
the class StressUsingSPARQLProtocol method beginTest.
@BeforeEach
public void beginTest() throws IOException, SEPAProtocolException, SEPAPropertiesException, SEPASecurityException, URISyntaxException, InterruptedException {
provider = new ConfigurationProvider();
sync = new Sync();
client = new SPARQL11Protocol(provider.getClientSecurityManager());
Response ret = client.update(provider.buildUpdateRequest("DELETE_ALL"));
logger.debug(ret);
assertFalse(ret.isError(), String.valueOf(ret));
subscribers.clear();
publishers.clear();
sync.reset();
}
Aggregations