public void test0() throws Exception {
Object mutex=new Object();
CheckNoGaps check=new CheckNoGaps(1, this, mutex);
ProtocolTester t=new ProtocolTester("pbcast.NAKACK", check);
Address my_addr=new IpAddress("localhost", 10000);
ViewId vid=new ViewId(my_addr, 322649);
Vector mbrs=new Vector();
View view;
mbrs.addElement(my_addr);
view=new View(vid, mbrs);
t.start();
t.getBottom().up(new Event(Event.SET_LOCAL_ADDRESS, my_addr));
check.down(new Event(Event.BECOME_SERVER));
check.down(new Event(Event.VIEW_CHANGE, view));
for(long i=1; i <= NUM_MSGS; i++) {
if(i % 1000 == 0)
System.out.println("sending msg #" + i);
check.down(new Event(Event.MSG, new Message(null, my_addr, new Long(i))));
num_msgs_sent++;
}
synchronized(mutex) {
while(!check.isDone())
mutex.wait(WAIT_TIME);
}
System.out.println("\nMessages sent: " + num_msgs_sent + ", messages received: " + num_msgs_received);
assertEquals(num_msgs_received, num_msgs_sent);
t.stop();
}