Methods Summary |
---|
public void | clear()
|
public void | sendMessages(long delay, long sleep)
Member local = channels[0].getLocalMember(true);
Member dest = channels[1].getLocalMember(true);
int n = 3;
System.out.println("Sending " + n + " messages from [" + local.getName() + "] to [" + dest.getName() + "]");
for (int i = 0; i < n; i++) {
channels[0].send(new Member[] {dest}, new TestMsg(), 0);
if ( delay > 0 ) Thread.sleep(delay);
}
System.out.println("Messages sent. Sleeping for "+(sleep/1000)+" seconds to inspect connections");
if ( sleep > 0 ) Thread.sleep(sleep);
|
protected void | setUp()
super.setUp();
for (int i = 0; i < channels.length; i++) {
channels[i] = new GroupChannel();
channels[i].getMembershipService().setPayload( ("Channel-" + (i + 1)).getBytes("ASCII"));
listeners[i] = new TestMsgListener( ("Listener-" + (i + 1)));
channels[i].addChannelListener(listeners[i]);
channels[i].start(Channel.SND_RX_SEQ|Channel.SND_TX_SEQ);
}
|
protected void | tearDown()
for (int i = 0; i < channels.length; i++) {
channels[i].stop(Channel.DEFAULT);
}
|
public void | testConnectionLinger()
sendMessages(0,15000);
|
public void | testKeepAliveCount()
System.out.println("Setting keep alive count to 0");
for (int i = 0; i < channels.length; i++) {
ReplicationTransmitter t = (ReplicationTransmitter)channels[0].getChannelSender();
t.getTransport().setKeepAliveCount(0);
}
sendMessages(1000,15000);
|
public void | testKeepAliveTime()
System.out.println("Setting keep alive count to 1 second");
for (int i = 0; i < channels.length; i++) {
ReplicationTransmitter t = (ReplicationTransmitter)channels[0].getChannelSender();
t.getTransport().setKeepAliveTime(1000);
}
sendMessages(2000,15000);
|