use of it.unibo.arces.wot.sepa.Publisher in project SEPA by arces-wot.
the class StressUsingSPARQLProtocol method NotifyNx2NWithMalformedUpdates.
@RepeatedTest(ConfigurationProvider.REPEATED_TEST)
public // @Timeout(5)
void NotifyNx2NWithMalformedUpdates() throws IOException, IllegalArgumentException, SEPAProtocolException, InterruptedException, SEPAPropertiesException, SEPASecurityException {
int n = 4;
for (int i = 0; i < n; i++) {
subscribers.add(new Subscriber(provider, "RANDOM", sync));
publishers.add(new Publisher(provider, "RANDOM", n));
publishers.add(new Publisher(provider, "WRONG", n));
}
for (Subscriber sub : subscribers) sub.start();
sync.waitSubscribes(subscribers.size());
sync.waitEvents(subscribers.size());
for (Publisher pub : publishers) pub.start();
sync.waitEvents(subscribers.size() + subscribers.size() * (publishers.size() / 2) * (publishers.size() / 2));
assertFalse(sync.getSubscribes() != subscribers.size(), "Subscribes:" + sync.getSubscribes() + "(" + subscribers.size() + ")");
assertFalse(sync.getEvents() != subscribers.size() + subscribers.size() * (publishers.size() / 2) * (publishers.size() / 2), "Events:" + sync.getEvents() + "(" + subscribers.size() + subscribers.size() * (publishers.size() / 2) * (publishers.size() / 2) + ")");
}
use of it.unibo.arces.wot.sepa.Publisher in project SEPA by arces-wot.
the class StressUsingSPARQLProtocol method NotifyNxN.
@RepeatedTest(ConfigurationProvider.REPEATED_TEST)
public // @Timeout(60)
void NotifyNxN() throws IOException, IllegalArgumentException, SEPAProtocolException, InterruptedException, SEPAPropertiesException, SEPASecurityException {
int n = 10;
for (int i = 0; i < n; i++) {
subscribers.add(new Subscriber(provider, "RANDOM", sync));
publishers.add(new Publisher(provider, "RANDOM", n));
}
for (Subscriber sub : subscribers) sub.start();
sync.waitSubscribes(subscribers.size());
sync.waitEvents(subscribers.size());
for (Publisher pub : publishers) pub.start();
sync.waitEvents(subscribers.size() + subscribers.size() * publishers.size() * publishers.size());
assertFalse(sync.getSubscribes() != subscribers.size(), "Subscribes:" + sync.getSubscribes() + "(" + subscribers.size() + ")");
assertFalse(sync.getEvents() != subscribers.size() + subscribers.size() * publishers.size() * publishers.size(), "Events:" + sync.getEvents() + "(" + subscribers.size() + subscribers.size() * publishers.size() * publishers.size() + ")");
}
use of it.unibo.arces.wot.sepa.Publisher in project SEPA by arces-wot.
the class StressUsingSPARQLProtocol method Notify3Nx2N.
@RepeatedTest(ConfigurationProvider.REPEATED_TEST)
@Timeout(60)
public void Notify3Nx2N() throws IOException, IllegalArgumentException, SEPAProtocolException, InterruptedException, SEPAPropertiesException, SEPASecurityException {
int n = 10;
for (int i = 0; i < n; i++) {
subscribers.add(new Subscriber(provider, "ALL", sync));
subscribers.add(new Subscriber(provider, "RANDOM", sync));
subscribers.add(new Subscriber(provider, "RANDOM1", sync));
publishers.add(new Publisher(provider, "RANDOM", n));
publishers.add(new Publisher(provider, "RANDOM1", n));
}
int events = 4 * n * n * n + subscribers.size();
for (Subscriber sub : subscribers) sub.start();
sync.waitSubscribes(subscribers.size());
sync.waitEvents(subscribers.size());
for (Publisher pub : publishers) pub.start();
sync.waitEvents(events);
assertFalse(sync.getSubscribes() != subscribers.size(), "Subscribes:" + sync.getSubscribes() + "(" + subscribers.size() + ")");
assertFalse(sync.getEvents() != events, "Events:" + sync.getEvents() + "(" + events + ")");
}
use of it.unibo.arces.wot.sepa.Publisher in project SEPA by arces-wot.
the class StressUsingSPARQLProtocol method endTest.
@AfterEach
public void endTest() throws IOException, InterruptedException {
for (Subscriber sub : subscribers) sub.close();
for (Publisher pub : publishers) pub.close();
client.close();
provider.close();
}
use of it.unibo.arces.wot.sepa.Publisher in project SEPA by arces-wot.
the class StressUsingSPARQLProtocol method UpdateHeavyLoad.
@RepeatedTest(ConfigurationProvider.REPEATED_TEST)
@Timeout(30)
public void UpdateHeavyLoad() throws InterruptedException, SEPAPropertiesException, SEPASecurityException {
int n = 10;
for (int i = 0; i < n; i++) {
publishers.add(new Publisher(provider, "RANDOM", n));
publishers.add(new Publisher(provider, "RANDOM1", n));
publishers.add(new Publisher(provider, "VAIMEE", n));
}
for (Publisher pub : publishers) pub.start();
// Wait all publishers to complete
for (Publisher pub : publishers) pub.join();
}
Aggregations