use of io.scalecube.services.sut.QuoteService in project scalecube by scalecube.
the class StreamingServiceTest method test_local_quotes_service.
@Test
public void test_local_quotes_service() {
QuoteService service = node.call().api(QuoteService.class);
int expected = 3;
List<String> list = service.quotes().take(Duration.ofMillis(3500)).collectList().block();
assertEquals(expected, list.size());
}
use of io.scalecube.services.sut.QuoteService in project scalecube by scalecube.
the class StreamingServiceTest method test_quotes_batch.
@Test
public void test_quotes_batch() throws InterruptedException {
int streamBound = 1000;
QuoteService service = gateway.call().api(QuoteService.class);
CountDownLatch latch1 = new CountDownLatch(streamBound);
final Disposable sub1 = service.snapshot(streamBound).subscribe(onNext -> latch1.countDown());
latch1.await(15, TimeUnit.SECONDS);
System.out.println("Curr value received: " + latch1.getCount());
assertEquals(0, latch1.getCount());
sub1.dispose();
}
use of io.scalecube.services.sut.QuoteService in project scalecube by scalecube.
the class StreamingServiceTest method test_just_once.
@Test
public void test_just_once() {
QuoteService service = gateway.call().api(QuoteService.class);
assertEquals("1", service.justOne().block(Duration.ofSeconds(2)));
}
use of io.scalecube.services.sut.QuoteService in project scalecube by scalecube.
the class StreamingServiceTest method test_remote_quotes_service.
@Test
public void test_remote_quotes_service() throws InterruptedException {
CountDownLatch latch1 = new CountDownLatch(3);
CountDownLatch latch2 = new CountDownLatch(3);
QuoteService service = gateway.call().api(QuoteService.class);
service.snapshot(3).subscribe(onNext -> latch1.countDown());
service.snapshot(3).subscribe(onNext -> latch2.countDown());
latch1.await(5, TimeUnit.SECONDS);
latch2.await(5, TimeUnit.SECONDS);
assertEquals(0, latch1.getCount());
assertEquals(0, latch2.getCount());
}
Aggregations