FileDocCategorySizeDatePackage
TestRemoteProcessException.javaAPI DocApache Tomcat 6.0.144918Fri Jul 20 04:20:34 BST 2007org.apache.catalina.tribes.test.channel

TestRemoteProcessException

public class TestRemoteProcessException extends TestCase

Title:

Description:

Company:

author
not attributable
version
1.0

Fields Summary
int
msgCount
org.apache.catalina.tribes.group.GroupChannel
channel1
org.apache.catalina.tribes.group.GroupChannel
channel2
Listener
listener1
Constructors Summary
Methods Summary
protected voidsetUp()

         
        super.setUp();
        channel1 = new GroupChannel();
        channel2 = new GroupChannel();
        listener1 = new Listener();
        channel2.addChannelListener(listener1);
        channel1.start(GroupChannel.DEFAULT);
        channel2.start(GroupChannel.DEFAULT);
    
protected voidtearDown()

        super.tearDown();
        channel1.stop(GroupChannel.DEFAULT);
        channel2.stop(GroupChannel.DEFAULT);
    
public voidtestDataSendSYNCACK()

        System.err.println("Starting SYNC_ACK");
        int errC=0, nerrC=0;
        for (int i=0; i<msgCount; i++) {
            boolean error = Data.r.nextBoolean();
            channel1.send(channel1.getMembers(),Data.createRandomData(error),GroupChannel.SEND_OPTIONS_SYNCHRONIZED_ACK|GroupChannel.SEND_OPTIONS_USE_ACK);
            if ( error ) errC++; else nerrC++;
        }
        System.err.println("Finished SYNC_ACK");
        assertEquals("Checking failure messages.",errC,listener1.errCnt);
        assertEquals("Checking success messages.",nerrC,listener1.noErrCnt);
        assertEquals("Checking all messages.",msgCount,listener1.noErrCnt+listener1.errCnt);
        System.out.println("Listener 1 stats:");
        listener1.printStats(System.out);