Revision: d25ec3877885
Author: [email protected] <[email protected]>
Date: Mon May 13 01:33:31 2013
Log: Update testsuite
http://code.google.com/p/commscale/source/detail?r=d25ec3877885&repo=load-balancer
Modified:
/jar/src/main/java/org/mobicents/tools/sip/balancer/UDPPacketForwarder.java
/jar/src/test/java/org/mobicents/tools/sip/balancer/NodeRegisterTest.java
/jar/src/test/java/org/mobicents/tools/sip/balancer/algorithms/PureConsistentHashNodeDeathTest.java
/jar/src/test/java/org/mobicents/tools/sip/balancer/operation/InviteTransactionFailover.java
/jar/src/test/java/org/mobicents/tools/sip/balancer/scalability/SprayingLoadBalancersWithIPLBAddressInViaHeader.java
/jar/src/test/java/org/mobicents/tools/sip/balancer/scalability/SprayingTwoLoadBalancersTest.java
=======================================
---
/jar/src/main/java/org/mobicents/tools/sip/balancer/UDPPacketForwarder.java
Mon Apr 22 05:50:26 2013
+++
/jar/src/main/java/org/mobicents/tools/sip/balancer/UDPPacketForwarder.java
Mon May 13 01:33:31 2013
@@ -108,8 +108,10 @@
running = false;
try {
worker.interrupt();
- fromSocket.disconnect();
- fromSocket.close();
+ if(fromSocket.isConnected())
+ fromSocket.disconnect();
+ if(!fromSocket.isClosed())
+ fromSocket.close();
} catch (Exception e) {
//e.printStackTrace();
}
=======================================
---
/jar/src/test/java/org/mobicents/tools/sip/balancer/NodeRegisterTest.java
Thu Jun 28 08:51:49 2012
+++
/jar/src/test/java/org/mobicents/tools/sip/balancer/NodeRegisterTest.java
Mon May 13 01:33:31 2013
@@ -99,7 +99,7 @@
servers[q].start();
}
- Thread.sleep(5000);
+ Thread.sleep(8000);
String[] nodes = balancerRunner.getNodeList();
assertEquals(numNodes, nodes.length);
servers[0].sendHeartbeat = false;
=======================================
---
/jar/src/test/java/org/mobicents/tools/sip/balancer/algorithms/PureConsistentHashNodeDeathTest.java
Thu Jun 28 08:51:49 2012
+++
/jar/src/test/java/org/mobicents/tools/sip/balancer/algorithms/PureConsistentHashNodeDeathTest.java
Mon May 13 01:33:31 2013
@@ -188,7 +188,7 @@
shootist.callerSendsBye = true;
shootist.sendInitialInvite();
- Thread.sleep(5000);
+ Thread.sleep(7000);
assertEquals(500, shootist.responses.get(0).getStatusCode());
}
=======================================
---
/jar/src/test/java/org/mobicents/tools/sip/balancer/operation/InviteTransactionFailover.java
Thu Jun 28 08:51:49 2012
+++
/jar/src/test/java/org/mobicents/tools/sip/balancer/operation/InviteTransactionFailover.java
Mon May 13 01:33:31 2013
@@ -179,7 +179,7 @@
for(AppServer as:servers)
as.setEventListener(failureEventListener);
shootist.callerSendsBye = true;
shootist.sendInitialInvite();
- Thread.sleep(10000);
+ Thread.sleep(12000);
if(balancer.getNodes().size()!=1) fail("Expected one dead
node");
}
AppServer ringingAppServer;
=======================================
---
/jar/src/test/java/org/mobicents/tools/sip/balancer/scalability/SprayingLoadBalancersWithIPLBAddressInViaHeader.java
Fri Apr 20 10:50:14 2012
+++
/jar/src/test/java/org/mobicents/tools/sip/balancer/scalability/SprayingLoadBalancersWithIPLBAddressInViaHeader.java
Mon May 13 01:33:31 2013
@@ -30,6 +30,9 @@
import junit.framework.TestCase;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
import org.mobicents.tools.sip.balancer.AppServer;
import org.mobicents.tools.sip.balancer.BalancerRunner;
import org.mobicents.tools.sip.balancer.EventListener;
@@ -79,7 +82,7 @@
balancer.start(properties);
return balancer;
}
-
+ @Before
protected void setUp() throws Exception {
super.setUp();
shootist = new Shootist();
@@ -107,6 +110,7 @@
/* (non-Javadoc)
* @see junit.framework.TestCase#tearDown()
*/
+ @After
protected void tearDown() throws Exception {
super.tearDown();
externalIpLoadBalancer.stop();
@@ -121,7 +125,7 @@
}
AppServer inviteServer,ackServer,byeServer;
-
+ @Test
public void testSprayingRoundRobinSIPLBsUASCallConsistentHash() throws
Exception {
EventListener failureEventListener = new EventListener() {
@@ -160,13 +164,14 @@
//servers[0].sendHeartbeat = false;
Thread.sleep(12000);
shootist.sendBye();
- Thread.sleep(2000);
-
+ Thread.sleep(1200);
+
assertEquals(3,
externalIpLoadBalancer.sipMessageWithoutRetrans.size());
assertSame(inviteServer, byeServer);
assertSame(inviteServer, ackServer);
assertNotNull(byeServer);
- assertNotNull(ackServer);
+ assertNotNull(ackServer);
+
}
AppServer ringingAppServer;
AppServer okAppServer;
=======================================
---
/jar/src/test/java/org/mobicents/tools/sip/balancer/scalability/SprayingTwoLoadBalancersTest.java
Tue Apr 19 04:47:21 2011
+++
/jar/src/test/java/org/mobicents/tools/sip/balancer/scalability/SprayingTwoLoadBalancersTest.java
Mon May 13 01:33:31 2013
@@ -158,7 +158,7 @@
//servers[0].sendHeartbeat = false;
Thread.sleep(12000);
shootist.sendBye();
- Thread.sleep(2000);
+ Thread.sleep(4000);
assertEquals(3,
externalIpLoadBalancer.sipMessageWithoutRetrans.size());
assertSame(inviteServer, byeServer);
@@ -169,7 +169,7 @@
public void testSprayingMultipleIndialogMessages() throws Exception {
shootist.callerSendsBye=true;
shootist.sendInitialInvite();
- Thread.sleep(8000);
+ Thread.sleep(10000);
for(int q=0;q<10;q++){
shootist.sendMessage();Thread.sleep(600);
}
--
---
You received this message because you are subscribed to the Google Groups "mobicents-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.