use of com.cloudhopper.smpp.impl.DefaultSmppServer in project load-balancer by RestComm.
the class SpliterModeStatisticTest method initialization.
@BeforeClass
public static void initialization() {
boolean enableSslLbPort = false;
boolean terminateTLSTraffic = true;
// start lb
balancer = new BalancerRunner();
balancer.start(ConfigInit.getLbSpliterProperties(enableSslLbPort, terminateTLSTraffic));
// start servers
serverArray = new DefaultSmppServer[serverNumbers];
serverHandlerArray = new DefaultSmppServerHandler[serverNumbers];
for (int i = 0; i < serverNumbers; i++) {
serverHandlerArray[i] = new DefaultSmppServerHandler();
serverArray[i] = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(i, false), serverHandlerArray[i], executor, monitorExecutor);
logger.info("Starting SMPP server...");
try {
serverArray[i].start();
} catch (SmppChannelException e) {
logger.info("SMPP server does not started");
e.printStackTrace();
}
logger.info("SMPP server started");
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of com.cloudhopper.smpp.impl.DefaultSmppServer in project load-balancer by RestComm.
the class SpliterTwoNicTest method initialization.
@BeforeClass
public static void initialization() {
boolean enableSslLbPort = false;
boolean terminateTLSTraffic = true;
// start lb
balancer = new BalancerRunner();
balancer.start(ConfigInit.getLbSpliterPropertiesTwoNic(enableSslLbPort, terminateTLSTraffic));
// start servers
serverArray = new DefaultSmppServer[serverNumbers];
serverHandlerArray = new DefaultSmppServerHandler[serverNumbers];
for (int i = 0; i < serverNumbers; i++) {
serverHandlerArray[i] = new DefaultSmppServerHandler();
serverArray[i] = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(i, false), serverHandlerArray[i], executor, monitorExecutor);
logger.info("Starting SMPP server...");
try {
serverArray[i].start();
} catch (SmppChannelException e) {
logger.info("SMPP server does not started");
e.printStackTrace();
}
logger.info("SMPP server started");
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of com.cloudhopper.smpp.impl.DefaultSmppServer 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 com.cloudhopper.smpp.impl.DefaultSmppServer in project load-balancer by RestComm.
the class SslBalancerNoSslServerTest method initialization.
@BeforeClass
public static void initialization() {
boolean enableSslLbPort = true;
boolean terminateTLSTraffic = true;
// start lb
balancer = new BalancerRunner();
balancer.start(ConfigInit.getLbProperties(enableSslLbPort, terminateTLSTraffic));
// start servers
serverArray = new DefaultSmppServer[serverNumbers];
for (int i = 0; i < serverNumbers; i++) {
serverHandlerArray[i] = new DefaultSmppServerHandler();
serverArray[i] = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(i, false), serverHandlerArray[i], executor, monitorExecutor);
logger.info("Starting SMPP server...");
try {
serverArray[i].start();
} catch (SmppChannelException e) {
logger.info("SMPP server does not started");
e.printStackTrace();
}
logger.info("SMPP server started");
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of com.cloudhopper.smpp.impl.DefaultSmppServer in project load-balancer by RestComm.
the class InvalidPasswordTest method initialization.
@BeforeClass
public static void initialization() {
// start lb
balancer = new BalancerRunner();
LoadBalancerConfiguration lbConfig = ConfigInit.getLbPropertiesWithOneServer();
balancer.start(lbConfig);
// start servers
serverHandler = new DefaultSmppServerHandler();
server = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(0, false), serverHandler, executor, monitorExecutor);
logger.info("Starting SMPP server...");
try {
server.start();
} catch (SmppChannelException e) {
logger.info("SMPP server does not started");
e.printStackTrace();
}
logger.info("SMPP server started");
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Aggregations