ServerManagement.start("all", 0); ServerManagement.start("all", 1); ServerManagement.start("all", 2);
ServerManagement.start(0, "all"); ServerManagement.start(1, "all"); ServerManagement.start(2, "all");
   public void testCleanLeave() throws Exception   {      try      {         // Start with a 3 node cluster         ServerManagement.start("all", 0);         ServerManagement.start("all", 1);         ServerManagement.start("all", 2);         Set view = ServerManagement.getServer(0).getNodeIDView();         assertEquals(3, view.size());         assertTrue(view.contains(new Integer(0)));         assertTrue(view.contains(new Integer(1)));         assertTrue(view.contains(new Integer(2)));         // Make node 0 to "cleanly" leave the cluster         ServerManagement.stop(0);         view = ServerManagement.getServer(1).getNodeIDView();         assertEquals(2, view.size());         assertTrue(view.contains(new Integer(1)));         assertTrue(view.contains(new Integer(2)));         // Make node 2 to "cleanly" leave the cluster         ServerManagement.stop(2);         view = ServerManagement.getServer(1).getNodeIDView();         assertEquals(1, view.size());         assertTrue(view.contains(new Integer(1)));         // Reuse the "hollow" RMI server 0 to start another cluster node         ServerManagement.start("all", 0);         view = ServerManagement.getServer(0).getNodeIDView();         assertEquals(2, view.size());         assertTrue(view.contains(new Integer(0)));         assertTrue(view.contains(new Integer(1)));         // Reuse the "hollow" RMI server 2 to start another cluster node         ServerManagement.start("all", 2);         view = ServerManagement.getServer(2).getNodeIDView();         assertEquals(3, view.size());         assertTrue(view.contains(new Integer(0)));         assertTrue(view.contains(new Integer(1)));         assertTrue(view.contains(new Integer(2)));      }      finally      {         ServerManagement.stop(2);         ServerManagement.stop(1);         ServerManagement.stop(0);      }   }