use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class EarlyDialogWorstCaseAffinityTest method setUp.
@Before
public void setUp() throws Exception {
shootist = new Shootist();
balancer = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getInternalLegConfiguration().setUdpPort(5065);
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setAlgorithmClass(WorstCaseUdpTestAffinityAlgorithm.class.getName());
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setEarlyDialogWorstCase(true);
balancer.start(lbConfig);
for (int q = 0; q < servers.length; q++) {
servers[q] = new AppServer("node" + q, 4060 + q, "127.0.0.1", 2000, 5060, 5065, "0", ListeningPoint.UDP, 2222 + q);
servers[q].start();
}
Thread.sleep(5000);
}
use of org.mobicents.tools.sip.balancer.BalancerRunner 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();
}
}
use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class RebindTest method initialization.
@BeforeClass
public static void initialization() {
boolean enableSslLbPort = false;
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 org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class ResponseTimerTest method initialization.
@BeforeClass
public static void initialization() {
// start lb
boolean enableSslLbPort = false;
boolean terminateTLSTraffic = true;
balancer = new BalancerRunner();
balancer.start(ConfigInit.getLbProperties(enableSslLbPort, terminateTLSTraffic, true));
// start servers
serverArray = new DefaultSmppServer[serverNumbers];
for (int i = 0; i < serverNumbers; i++) {
serverArray[i] = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(i, false), new ServerHandlerForResponseTimer(), 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 org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class SmppStatisticTest method initialization.
@BeforeClass
public static void initialization() {
boolean enableSslLbPort = false;
boolean terminateTLSTraffic = true;
// start lb
balancer = new BalancerRunner();
balancer.start(ConfigInit.getLbProperties(enableSslLbPort, terminateTLSTraffic, true));
// 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();
}
}
Aggregations