use of org.mobicents.tools.smpp.balancer.core.BalancerDispatcher in project load-balancer by RestComm.
the class SpliterTwoNicTest method testTransfer.
@Test
public void testTransfer() {
int clientNumbers = 9;
clientHandlerArray = new DefaultSmppClientHandler[clientNumbers];
int sms = 99;
Locker locker = new Locker(clientNumbers);
ArrayList<Load> processors = new ArrayList<Load>(clientNumbers);
for (int i = 0; i < clientNumbers; i++) processors.add(new Load(i, sms, locker));
for (int i = 0; i < clientNumbers; i++) processors.get(i).start();
locker.waitForClients();
for (DefaultSmppServerHandler serverHandler : serverHandlerArray) assertEquals(sms, serverHandler.smsNumber);
for (DefaultSmppServer server : serverArray) assertEquals(clientNumbers / serverNumbers, server.getBindRequested());
for (DefaultSmppClientHandler clientHandler : clientHandlerArray) assertEquals(sms, clientHandler.getReponsesNumber().get());
assertTrue(((BalancerDispatcher) balancer.smppBalancerRunner.getBalancerDispatcher()).getClientSessions().isEmpty());
assertTrue(((BalancerDispatcher) balancer.smppBalancerRunner.getBalancerDispatcher()).getServerSessions().isEmpty());
}
use of org.mobicents.tools.smpp.balancer.core.BalancerDispatcher in project load-balancer by RestComm.
the class SpliterModeTest method testTransfer.
@Test
public void testTransfer() {
int clientNumbers = 9;
clientHandlerArray = new DefaultSmppClientHandler[clientNumbers];
int sms = 99;
Locker locker = new Locker(clientNumbers);
ArrayList<Load> processors = new ArrayList<Load>(clientNumbers);
for (int i = 0; i < clientNumbers; i++) processors.add(new Load(i, sms, locker));
for (int i = 0; i < clientNumbers; i++) processors.get(i).start();
locker.waitForClients();
for (DefaultSmppServerHandler serverHandler : serverHandlerArray) assertEquals(sms, serverHandler.smsNumber);
for (DefaultSmppServer server : serverArray) assertEquals(clientNumbers / serverNumbers, server.getBindRequested());
for (DefaultSmppClientHandler clientHandler : clientHandlerArray) assertEquals(sms, clientHandler.getReponsesNumber().get());
assertTrue(((BalancerDispatcher) balancer.smppBalancerRunner.getBalancerDispatcher()).getClientSessions().isEmpty());
assertTrue(((BalancerDispatcher) balancer.smppBalancerRunner.getBalancerDispatcher()).getServerSessions().isEmpty());
}
Aggregations