LoadbalanceAlgorithm algo = endpoint.getAlgorithm();
String []firstTwoRoundsResults = new String[34];
for (int i = 0; i < 34; i++) {
Endpoint epr = algo.getNextEndpoint(messageContext, null);
if (epr instanceof AddressEndpoint) {
firstTwoRoundsResults[i] =
((AddressEndpoint)epr).getProperty(
WeightedRRLCAlgorithm.LB_WEIGHTED_RRLC_WEIGHT).getValue();
}
}
for (int i = 0; i < 34; i++) {
assertEquals(firstTwoRoundsExpected[i], firstTwoRoundsResults[i]);
}
String []secondTwoRoundsExpected = {
"6", "6", "6", "6", "5", "5", "5", "5", "5", "5", "5", "3", "3", "3", "3", "2", "2",
"2", "2", "1", "1", "6", "6", "6", "6", "5", "5", "5", "5", "5", "5", "5", "3", "3"};
String []secondTwoRoundsResults = new String[34];
for (int i = 0; i < 34; i++) {
Endpoint epr = algo.getNextEndpoint(messageContext, null);
if (epr instanceof AddressEndpoint) {
secondTwoRoundsResults[i] =
((AddressEndpoint)epr).getProperty(
WeightedRRLCAlgorithm.LB_WEIGHTED_RRLC_WEIGHT).getValue();
}