Commit 82157441 authored by afreyssin's avatar afreyssin
Browse files

Enhances end of test and assertions.

parent 03102294
......@@ -52,7 +52,7 @@ public class ClientTest27 extends TestCase {
try {
System.out.println("servers start");
startAgentServer((short)0, new String[]{"-DTransaction.UseLockFile=false"});
Thread.sleep(2000);
Thread.sleep(1000);
ConnectionFactory cf = TcpConnectionFactory.create("localhost", 2560);
AdminModule.connect(cf, "root", "root");
......@@ -79,24 +79,19 @@ public class ClientTest27 extends TestCase {
// }
// };
// t.start();
//
// int subt = -1;
// do {
// Thread.sleep(pending);
// Subscription[] subs = user.getSubscriptions();
// int subu = (subs==null)?0:subs.length;
// subt = topic.getSubscriptions();
// System.out.println(new Date() + " - Sub: " + subt + ", " + subu);
// } while (subt != 0);
for (int i=0; i<10; i++)
test(nbmsgs);
int subt = -1;
int i = 0;
while ((topic.getSubscriptions() !=0 ) && (i++<50)) {
do {
Thread.sleep(pending);
System.out.println(new Date() + " - Sub: " + topic.getSubscriptions());
}
Subscription[] subs = user.getSubscriptions();
int subu = (subs==null)?0:subs.length;
subt = topic.getSubscriptions();
System.out.println(new Date() + " - Sub: " + subt + ", " + subu);
} while ((subt != 0) && (i++ < 5));
assertTrue(topic.getSubscriptions()==0);
AdminModule.disconnect();
......
......@@ -87,26 +87,20 @@ public class ClientTest28 extends TestCase {
System.out.println(new Date() + " - destroy process");
p.destroy();
// int subt = -1;
// do {
// Thread.sleep(pending);
// Subscription[] subs = user.getSubscriptions();
// int subu = (subs==null)?0:subs.length;
// subt = topic.getSubscriptions();
// System.out.println(new Date() + " - Sub: " + subt + ", " + subu);
// } while (subt != 0);
// Thread.sleep(5000L);
int subt = -1;
int i = 0;
while ((topic.getSubscriptions() !=0 ) && (i++<50)) {
do {
Thread.sleep(pending);
System.out.println(new Date() + " - Sub: " + topic.getSubscriptions());
}
Subscription[] subs = user.getSubscriptions();
int subu = (subs==null)?0:subs.length;
subt = topic.getSubscriptions();
System.out.println(new Date() + " - Sub: " + subt + ", " + subu);
} while ((subt != 0) && (i++ < 5));
assertTrue(topic.getSubscriptions()==0);
// Wait the end of sending.
Thread.sleep(4*pending);
Thread.sleep(30000L);
AdminModule.disconnect();
} catch (Throwable exc) {
exc.printStackTrace();
......
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