Package net.kuujo.copycat.test

Examples of net.kuujo.copycat.test.TestNode.log()


    cluster.start();

    node3.stateMachine().data("Hello world!");

    AtomicBoolean compacted = new AtomicBoolean();
    node3.log().on().compacted(() -> compacted.set(true));

    node1.instance().submit("command", "Hello world!").thenRun(() -> {
      node1.instance().submit("command", "Hello world!").thenRun(() -> {
        node1.instance().submit("command", "Hello world!").thenRun(() -> {
          node1.instance().submit("command", "Hello world!").thenRun(() -> {
View Full Code Here


      });
    });

    Assert.assertTrue(compacted.get());

    Entry firstEntry = node3.log().firstEntry();
    Assert.assertTrue(firstEntry instanceof SnapshotEntry);
    Assert.assertEquals("Hello world!", new String(((SnapshotEntry) firstEntry).data()));

    cluster.stop();
  }
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.