Beispiel #1
0
  /** {@inheritDoc} */
  @Override
  public void testRemoteProjection() throws Exception {
    ClusterGroup remotePrj = projection().forRemotes();

    int size = remotePrj.nodes().size();

    String name = "oneMoreGrid";

    try {
      Ignite g = startGrid(name);

      UUID joinedId = g.cluster().localNode().id();

      assert remotePrj.nodes().size() == size + 1;

      assert F.nodeIds(remotePrj.nodes()).contains(joinedId);
    } finally {
      stopGrid(name);
    }
  }
Beispiel #2
0
  /** @throws Exception If failed. */
  public void testForOthers() throws Exception {
    ClusterNode node0 = grid(0).localNode();
    ClusterNode node1 = grid(1).localNode();
    ClusterNode node2 = grid(2).localNode();
    ClusterNode node3 = grid(3).localNode();

    ClusterGroup p1 = grid(0).cluster().forOthers(node0);

    assertEquals(3, p1.nodes().size());

    assertEquals(2, p1.forOthers(node1).nodes().size());

    assertEquals(1, p1.forOthers(node1, node2).nodes().size());

    assertEquals(1, grid(0).cluster().forOthers(node1, node2, node3).nodes().size());
  }