Package org.prevayler.cluster

Examples of org.prevayler.cluster.Node.shutdown()


  public void testFindNodes() throws Exception {
    assertEquals(1, node.getNumberOfNodesInCluster());
    Node node2 = createNodeAndWait();
    assertEquals(2, node.getNumberOfNodesInCluster());
    node2.shutdown();
    assertEquals(1, node.getNumberOfNodesInCluster());
  }

  public void testAssignMaster() throws Exception {
    assertEquals(node.getAddress(), node.getMasterAddress());
View Full Code Here


    Node node2 = createNodeAndWait();
    assertEquals(node.getAddress(), node2.getMasterAddress());
    assertFalse(node.getAddress().equals(node2.getAddress()));
    node.shutdown();
    assertEquals(node2.getAddress(), node2.getMasterAddress());
    node2.shutdown();
  }

  public void testMultipleNodes() throws Exception {
    Node node2 = createNodeAndWait();
    assertEquals(node.getAddress(), node.getMasterAddress());
View Full Code Here

  public void testMultipleNodes() throws Exception {
    Node node2 = createNodeAndWait();
    assertEquals(node.getAddress(), node.getMasterAddress());
    assertEquals(node.getAddress(), node2.getMasterAddress());
    node2.shutdown();
  }

  public void testBroadCast() throws Exception {
    Node node2 = createNodeAndWait();
    node2.setListener(createListAddListener());
View Full Code Here

    node2.setListener(createListAddListener());
    String message = "Hello World";
    node.broadcast(message);
    assertEquals(1, receivedMessages.size());
    assertEquals(message, receivedMessages.get(0));
    node2.shutdown();
  }

  public void testMultipleMessages() throws Exception {
    Node node2 = createNodeAndWait();
    node.setListener(createListAddListener());
View Full Code Here

        node.broadcast(new Integer(i));
      } else {
        node2.broadcast(new Integer(i));
      }
    }
    node2.shutdown();
    assertEquals(100, receivedMessages.size());
    for (int i = 0; i < numberOfMessages; i++) {
      assertEquals(new Integer(i), receivedMessages.get(i));
    }
  }
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.