use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.
the class ActiveStandbyHttpTest method initialization.
@BeforeClass
public static void initialization() {
balancerRunner = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setAlgorithmClass(ActiveStandbyAlgorithm.class.getName());
balancerRunner.start(lbConfig);
serverArray = new HttpServer[numberNodes];
for (int i = 0; i < numberNodes; i++) {
serverArray[i] = new HttpServer(7080 + i, 4444 + i, 2222 + i);
serverArray[i].start();
Helper.sleep(1000);
}
Helper.sleep(5000);
}
use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.
the class ChunkedRequestTest method initialization.
@BeforeClass
public static void initialization() {
executor = Executors.newCachedThreadPool();
server = new HttpServer(8080, 4444, 2222);
server.start();
balancerRunner = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
balancerRunner.start(lbConfig);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.
the class HttpBadResponseNodeRemovalTest method initialization.
@BeforeClass
public static void initialization() {
serverArray = new HttpServer[numberNodes];
for (int i = 0; i < numberNodes; i++) {
String id = null;
if (i == 0)
id = "ID1f2a2222772f4195948d040a2ccc648c";
else
id = "ID1f2a2222772f4195948d040a2ccc648" + i;
serverArray[i] = new HttpServer(7080 + i, 4444 + i, id, 2222 + i);
if (i == 0)
serverArray[i].setBadSever(true);
serverArray[i].start();
}
balancerRunner = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
lbConfig.getHttpConfiguration().setRequestCheckPattern("(/Accounts/)");
balancerRunner.start(lbConfig);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.
the class HttpBalancerWithHttpServerTest method initialization.
@BeforeClass
public static void initialization() {
balancerRunner = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
balancerRunner.start(lbConfig);
serverArray = new HttpServer[numberNodes];
for (int i = 0; i < numberNodes; i++) {
serverArray[i] = new HttpServer(7080 + i, 4444 + i, 2222 + i);
serverArray[i].start();
Helper.sleep(1000);
}
Helper.sleep(5000);
}
use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.
the class HttpNodeRemovalTest method initialization.
@BeforeClass
public static void initialization() {
serverArray = new HttpServer[numberNodes];
balancerRunner = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
balancerRunner.start(lbConfig);
for (int i = 0; i < numberNodes; i++) {
serverArray[i] = new HttpServer(7080 + i, 4444 + i, 2222 + i);
serverArray[i].start();
Helper.sleep(1000);
}
Helper.sleep(5000);
}
Aggregations