public void testFailoverTransitions() throws Exception {
  Set<String> downedHosts=new HashSet<String>();
  testFailoverTransition(HOST_1,HOST_2,null,null,HOST_1_OK,HOST_2_OK);
  downedHosts.clear();
  downedHosts.add(HOST_2);
  testFailoverTransition(HOST_1,HOST_3,downedHosts,null,HOST_1_OK,HOST_2_FAIL,HOST_3_OK);
  downedHosts.clear();
  downedHosts.add(HOST_1);
  testFailoverTransition(HOST_2,HOST_3,downedHosts,null,HOST_1_FAIL,HOST_2_OK,HOST_3_OK);
  downedHosts.clear();
  downedHosts.add(HOST_1);
  downedHosts.add(HOST_3);
  testFailoverTransition(HOST_2,HOST_1,downedHosts,HOST_1,HOST_1_FAIL,HOST_2_OK,HOST_3_FAIL,HOST_2_FAIL,HOST_3_FAIL,HOST_1_OK);
  downedHosts.clear();
  downedHosts.add(HOST_1);
  downedHosts.add(HOST_2);
  testFailoverTransition(HOST_3,HOST_1,downedHosts,HOST_1,HOST_1_FAIL,HOST_2_FAIL,HOST_3_OK,HOST_2_FAIL,HOST_3_FAIL,HOST_1_OK);
  downedHosts.clear();
  downedHosts.add(HOST_1);
  downedHosts.add(HOST_2);
  testFailoverTransition(HOST_3,HOST_2,downedHosts,HOST_2,HOST_1_FAIL,HOST_2_FAIL,HOST_3_OK,HOST_2_OK);
}

public void testFailoverTransitions ( ) throws Exception { Set < String > downedHosts = new HashSet < String > ( ) ; testFailoverTransition ( HOST_1 , HOST_2 , null , null , HOST_1_OK , HOST_2_OK ) ; downedHosts . clear ( ) ; downedHosts . add ( HOST_2 ) ; testFailoverTransition ( HOST_1 , HOST_3 , downedHosts , null , HOST_1_OK , HOST_2_FAIL , HOST_3_OK ) ; downedHosts . clear ( ) ; downedHosts . add ( HOST_1 ) ; testFailoverTransition ( HOST_2 , HOST_3 , downedHosts , null , HOST_1_FAIL , HOST_2_OK , HOST_3_OK ) ; downedHosts . clear ( ) ; downedHosts . add ( HOST_1 ) ; downedHosts . add ( HOST_3 ) ; testFailoverTransition ( HOST_2 , HOST_1 , downedHosts , HOST_1 , HOST_1_FAIL , HOST_2_OK , HOST_3_FAIL , HOST_2_FAIL , HOST_3_FAIL , HOST_1_OK ) ; downedHosts . clear ( ) ; downedHosts . add ( HOST_1 ) ; downedHosts . add ( HOST_2 ) ; testFailoverTransition ( HOST_3 , HOST_1 , downedHosts , HOST_1 , HOST_1_FAIL , HOST_2_FAIL , HOST_3_OK , HOST_2_FAIL , HOST_3_FAIL , HOST_1_OK ) ; downedHosts . clear ( ) ; downedHosts . add ( HOST_1 ) ; downedHosts . add ( HOST_2 ) ; testFailoverTransition ( HOST_3 , HOST_2 , downedHosts , HOST_2 , HOST_1_FAIL , HOST_2_FAIL , HOST_3_OK , HOST_2_OK ) ; }
tests failover transitions in a default failover connection using three hosts .
