@Test
  public void testClusterInitialization() {
    try {
      Cluster cluster = defaultFactory.getCluster("Cluster Un");
      assertNotNull("Test cluster should not be null", cluster);

      // now check that it has the data we expect from the database
      assertEquals("Wrong ID Found", 1000L, cluster.getId());
      assertEquals("Wrong name found", "Cluster Un", cluster.getName());

      // Now check for the master node
      Node master = cluster.getMaster();
      assertNotNull("Master node for cluster should not be null", master);
      assertEquals(
          "Unexpected name for master found", "Cluster 0 - Primary master", master.getName());
      assertEquals("Unexpected ID for master found", 1L, master.getId());
      assertTrue("Master should be available", master.isAvailable());

      // Now check for the slave nodes
      Set<Node> slaves = cluster.getSlaves();
      assertNotNull("Slave node set should not be null", slaves);
      assertEquals("Unexpected length for slave node set", 2, slaves.size());
    } catch (Exception e) {
      e.printStackTrace();
      fail("Exception caught: " + e.getLocalizedMessage());
    }
  }
 @Test
 public void testDefaultCluster() {
   // Test that we get what we expect whit the default cluster
   Cluster cluster = defaultFactory.getCluster(ClusterFactory.DEFAULT_CLUSTER_NAME);
   assertNotNull("Cluster should not be null", cluster);
   assertEquals(
       "Unexpected default Cluster instance",
       ClusterFactory.DEFAULT_CLUSTER_NAME,
       cluster.getName());
 }