Examples of chooseTarget()


Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

      testCount++;
      List<String> targets = Arrays.asList(TARGETS);
      FamilyClusterInfo fci = ClusteringTargetsRepository.initTarget(FAMILY_BASE + testCount, targets);
      LoadBalancePolicy lbp = getLoadBalancePolicy();
     
      String target = (String) lbp.chooseTarget(fci);
      int cursor = fci.getCursor();
      assertEquals(target, fci.getTargets().get(cursor));
     
      targets = Arrays.asList(new String[]{"W", "X", "Y", "Z"});
      fci.updateClusterInfo(targets, 1);
View Full Code Here

Examples of org.jboss.ha.client.loadbalance.LoadBalancePolicy.chooseTarget()

      targets = Arrays.asList(new String[]{"W", "X", "Y", "Z"});
      fci.updateClusterInfo(targets, 1);
     
      int expectedCursor = ++cursor % targets.size();
     
      target = (String) lbp.chooseTarget(fci);
      cursor = fci.getCursor();
      assertEquals(expectedCursor, cursor);
      assertEquals(target, targets.get(cursor));
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.