/** * This test checks that adding a node with invalid topology will be failed * with an exception to show topology is invalid. */ @Test public void testAddNodeWithInvalidTopology() { // The last node is a node with invalid topology try { cluster.add(rackOnlyNode); fail("Exception should be thrown, so we should not have reached here."); } catch (Exception e) { if (!(e instanceof IllegalArgumentException)) { fail("Expecting IllegalArgumentException, but caught:" + e); } assertTrue(e.getMessage().contains("illegal network location")); } }
/** * This test checks that adding a node with invalid topology will be failed * with an exception to show topology is invalid. */ @Test public void testAddNodeWithInvalidTopology() { // The last node is a node with invalid topology try { cluster.add(rackOnlyNode); fail("Exception should be thrown, so we should not have reached here."); } catch (Exception e) { if (!(e instanceof IllegalArgumentException)) { fail("Expecting IllegalArgumentException, but caught:" + e); } assertTrue(e.getMessage().contains("illegal network location")); } }