Commit 2f0cc28b authored by afreyssin's avatar afreyssin
Browse files

Adds a pause il needed.

parent e568adea
......@@ -146,9 +146,12 @@ public class AliasInQueueTest1 extends TestCase {
cnx0.close();
Thread.sleep(2000L);
assertEquals(list1.count + list2.count, nbmsg);
assertEquals(list1.count, (weight1 * nbmsg)/(weight1 + weigth2));
assertEquals(list2.count, (weigth2 * nbmsg)/(weight1 + weigth2));
if ((list1.count + list2.count) != nbmsg)
Thread.sleep(2000L);
assertEquals(nbmsg, list1.count + list2.count);
assertEquals((weight1 * nbmsg)/(weight1 + weigth2), list1.count);
assertEquals((weigth2 * nbmsg)/(weight1 + weigth2), list2.count);
System.out.println("queue1: " + list1.count + ", queue2: " + list2.count);
cnx1.close();
......@@ -175,6 +178,7 @@ public class AliasInQueueTest1 extends TestCase {
public void onMessage(Message msg) {
try {
if ((count%1000)== 999) System.out.println(name + ':' + (count+1));
// System.out.println(name + ':' + ((TextMessage) msg).getText());
count += 1;
} catch (Exception exc) {
......
......@@ -169,6 +169,8 @@ public class AliasInQueueTest2 extends TestCase {
int wait = nbmsg * (((weight1 * weight2 *100)/(weight1 + weight2)) - (weight0 *100)) /100;
System.out.println(wait);
Thread.sleep(wait +5000L);
if ((list1.count + list2.count) != nbmsg)
Thread.sleep(5000L);
assertEquals(nbmsg, list1.count + list2.count);
System.out.println(((weight2 * nbmsg *95)/(weight1 + weight2))/100);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment