Package org.jboss.ha.client.loadbalance

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);
      assertTrue(targets.contains(target));
     
      targets = Arrays.asList(new String[]{"W", "X", "Y", "Z"});
      fci.updateClusterInfo(targets, 1);
     
View Full Code Here


      assertTrue(targets.contains(target));
     
      targets = Arrays.asList(new String[]{"W", "X", "Y", "Z"});
      fci.updateClusterInfo(targets, 1);
     
      target = (String) lbp.chooseTarget(fci);
      assertTrue(targets.contains(target));
   }

}
View Full Code Here

      Set<Object> selected = new HashSet<Object>();
     
      for (int i = 0; i < 10000; i++)
      {
         LoadBalancePolicy lbp = getLoadBalancePolicy();
         selected.add(lbp.chooseTarget(fci));
         if (selected.size() == TARGETS.length)
            break;
      }
     
      assertEquals(TARGETS.length, selected.size());
View Full Code Here

      testCount++;
      List<String> targets = Arrays.asList(TARGETS);
      FamilyClusterInfo fci = ClusteringTargetsRepository.initTarget(FAMILY_BASE + testCount, targets);
     
      LoadBalancePolicy lbp = getLoadBalancePolicy();
      Object target = lbp.chooseTarget(fci);
     
      assertTrue(targets.contains(target));
     
      for (int i = 0; i < 10; i++)
         assertEquals(target, lbp.chooseTarget(fci));
View Full Code Here

      Object target = lbp.chooseTarget(fci);
     
      assertTrue(targets.contains(target));
     
      for (int i = 0; i < 10; i++)
         assertEquals(target, lbp.chooseTarget(fci));
   }


   public void testStickinessAfterFailover()
   {
View Full Code Here

      List<String> targets = Arrays.asList(TARGETS);
      FamilyClusterInfo fci = ClusteringTargetsRepository.initTarget(FAMILY_BASE + testCount, targets);
     
      LoadBalancePolicy lbp = getLoadBalancePolicy();
      Object firstTarget;
      Object target = firstTarget = lbp.chooseTarget(fci);
     
      assertTrue(targets.contains(target));
     
      for (int i = 0; i < 5; i++)
         assertEquals(target, lbp.chooseTarget(fci));
View Full Code Here

      Object target = firstTarget = lbp.chooseTarget(fci);
     
      assertTrue(targets.contains(target));
     
      for (int i = 0; i < 5; i++)
         assertEquals(target, lbp.chooseTarget(fci));
     
      fci.removeDeadTarget(target);
      Object secondTarget;
      target = secondTarget = lbp.chooseTarget(fci);
     
View Full Code Here

      for (int i = 0; i < 5; i++)
         assertEquals(target, lbp.chooseTarget(fci));
     
      fci.removeDeadTarget(target);
      Object secondTarget;
      target = secondTarget = lbp.chooseTarget(fci);
     
      assertFalse(firstTarget.equals(secondTarget));
      assertTrue(targets.contains(target));
     
      for (int i = 0; i < 5; i++)
View Full Code Here

     
      assertFalse(firstTarget.equals(secondTarget));
      assertTrue(targets.contains(target));
     
      for (int i = 0; i < 5; i++)
         assertEquals(target, lbp.chooseTarget(fci));
     
      fci.removeDeadTarget(target);
      Object thirdTarget;
      target = thirdTarget = lbp.chooseTarget(fci);
     
View Full Code Here

      for (int i = 0; i < 5; i++)
         assertEquals(target, lbp.chooseTarget(fci));
     
      fci.removeDeadTarget(target);
      Object thirdTarget;
      target = thirdTarget = lbp.chooseTarget(fci);
     
      assertFalse(firstTarget.equals(thirdTarget));
      assertFalse(secondTarget.equals(thirdTarget));
      assertTrue(targets.contains(target));
     
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.