Package io.vertx.core.shareddata

Examples of io.vertx.core.shareddata.Counter.compareAndSet()


      assertNullPointerException(() -> counter.incrementAndGet(null));
      assertNullPointerException(() -> counter.getAndIncrement(null));
      assertNullPointerException(() -> counter.decrementAndGet(null));
      assertNullPointerException(() -> counter.addAndGet(1, null));
      assertNullPointerException(() -> counter.getAndAdd(1, null));
      assertNullPointerException(() -> counter.compareAndSet(1, 1, null));
      testComplete();
    });
    await();
  }
View Full Code Here


  @Test
  public void testCompareAndSet() {
    getVertx().sharedData().getCounter("foo", ar -> {
      assertTrue(ar.succeeded());
      Counter counter = ar.result();
      counter.compareAndSet(0l, 2l, onSuccess(result -> {
        getVertx().sharedData().getCounter("foo", ar3 -> {
          assertTrue(ar3.succeeded());
          Counter counter2 = ar3.result();
          counter2.compareAndSet(2l, 4l, ar4 -> {
            assertTrue(ar4.succeeded());
View Full Code Here

      Counter counter = ar.result();
      counter.compareAndSet(0l, 2l, onSuccess(result -> {
        getVertx().sharedData().getCounter("foo", ar3 -> {
          assertTrue(ar3.succeeded());
          Counter counter2 = ar3.result();
          counter2.compareAndSet(2l, 4l, ar4 -> {
            assertTrue(ar4.succeeded());
            assertTrue(ar4.result());
            counter2.compareAndSet(3l, 5l, ar5 -> {
              assertTrue(ar5.succeeded());
              assertFalse(ar5.result());
View Full Code Here

          assertTrue(ar3.succeeded());
          Counter counter2 = ar3.result();
          counter2.compareAndSet(2l, 4l, ar4 -> {
            assertTrue(ar4.succeeded());
            assertTrue(ar4.result());
            counter2.compareAndSet(3l, 5l, ar5 -> {
              assertTrue(ar5.succeeded());
              assertFalse(ar5.result());
              testComplete();
            });
          });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.