org.apache.catalina.tribes.TesterUtil的实例源码

项目:tomcat7    文件TestTcpFailureDetector.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel2 = new GroupChannel();
    channel1.getMembershipService().setPayload("Channel-1".getBytes("ASCII"));
    channel2.getMembershipService().setPayload("Channel-2".getBytes("ASCII"));
    mbrlist1 = new TestMbrListener("Channel-1");
    mbrlist2 = new TestMbrListener("Channel-2");
    tcpFailureDetector1 = new TcpFailureDetector();
    tcpFailureDetector2 = new TcpFailureDetector();
    channel1.addInterceptor(tcpFailureDetector1);
    channel2.addInterceptor(tcpFailureDetector2);
    channel1.addMembershipListener(mbrlist1);
    channel2.addMembershipListener(mbrlist2);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
}
项目:tomcat7    文件TestMulticastPackages.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    ThroughputInterceptor tint = new ThroughputInterceptor();
    tint.setInterval(500);
    ThroughputInterceptor tint2 = new ThroughputInterceptor();
    tint2.setInterval(500);
    //channel1.addInterceptor(tint);
    channel2.addInterceptor(tint2);
    listener1 = new Listener();
    ReceiverBase rb1 = (ReceiverBase)channel1.getChannelReceiver();
    ReceiverBase rb2 = (ReceiverBase)channel2.getChannelReceiver();
    rb1.setUdpPort(50000);
    rb2.setUdpPort(50000);
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:tomcat7    文件TestUdpPackages.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    ThroughputInterceptor tint = new ThroughputInterceptor();
    tint.setInterval(500);
    ThroughputInterceptor tint2 = new ThroughputInterceptor();
    tint2.setInterval(500);
    //channel1.addInterceptor(tint);
    channel2.addInterceptor(tint2);
    listener1 = new Listener();
    ReceiverBase rb1 = (ReceiverBase)channel1.getChannelReceiver();
    ReceiverBase rb2 = (ReceiverBase)channel2.getChannelReceiver();
    rb1.setUdpPort(50000);
    rb2.setUdpPort(50000);
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:apache-tomcat-7.0.73-with-comment    文件TestTcpFailureDetector.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel2 = new GroupChannel();
    channel1.getMembershipService().setPayload("Channel-1".getBytes("ASCII"));
    channel2.getMembershipService().setPayload("Channel-2".getBytes("ASCII"));
    mbrlist1 = new TestMbrListener("Channel-1");
    mbrlist2 = new TestMbrListener("Channel-2");
    tcpFailureDetector1 = new TcpFailureDetector();
    tcpFailureDetector2 = new TcpFailureDetector();
    channel1.addInterceptor(tcpFailureDetector1);
    channel2.addInterceptor(tcpFailureDetector2);
    channel1.addMembershipListener(mbrlist1);
    channel2.addMembershipListener(mbrlist2);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
}
项目:apache-tomcat-7.0.73-with-comment    文件TestMulticastPackages.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    ThroughputInterceptor tint = new ThroughputInterceptor();
    tint.setInterval(500);
    ThroughputInterceptor tint2 = new ThroughputInterceptor();
    tint2.setInterval(500);
    //channel1.addInterceptor(tint);
    channel2.addInterceptor(tint2);
    listener1 = new Listener();
    ReceiverBase rb1 = (ReceiverBase)channel1.getChannelReceiver();
    ReceiverBase rb2 = (ReceiverBase)channel2.getChannelReceiver();
    rb1.setUdpPort(50000);
    rb2.setUdpPort(50000);
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:apache-tomcat-7.0.73-with-comment    文件TestUdpPackages.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    ThroughputInterceptor tint = new ThroughputInterceptor();
    tint.setInterval(500);
    ThroughputInterceptor tint2 = new ThroughputInterceptor();
    tint2.setInterval(500);
    //channel1.addInterceptor(tint);
    channel2.addInterceptor(tint2);
    listener1 = new Listener();
    ReceiverBase rb1 = (ReceiverBase)channel1.getChannelReceiver();
    ReceiverBase rb2 = (ReceiverBase)channel2.getChannelReceiver();
    rb1.setUdpPort(50000);
    rb2.setUdpPort(50000);
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:class-guard    文件TestTcpFailureDetector.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel2 = new GroupChannel();
    channel1.getMembershipService().setPayload("Channel-1".getBytes("ASCII"));
    channel2.getMembershipService().setPayload("Channel-2".getBytes("ASCII"));
    mbrlist1 = new TestMbrListener("Channel-1");
    mbrlist2 = new TestMbrListener("Channel-2");
    tcpFailureDetector1 = new TcpFailureDetector();
    tcpFailureDetector2 = new TcpFailureDetector();
    channel1.addInterceptor(tcpFailureDetector1);
    channel2.addInterceptor(tcpFailureDetector2);
    channel1.addMembershipListener(mbrlist1);
    channel2.addMembershipListener(mbrlist2);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
}
项目:class-guard    文件TestMulticastPackages.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    ThroughputInterceptor tint = new ThroughputInterceptor();
    tint.setInterval(500);
    ThroughputInterceptor tint2 = new ThroughputInterceptor();
    tint2.setInterval(500);
    //channel1.addInterceptor(tint);
    channel2.addInterceptor(tint2);
    listener1 = new Listener();
    ReceiverBase rb1 = (ReceiverBase)channel1.getChannelReceiver();
    ReceiverBase rb2 = (ReceiverBase)channel2.getChannelReceiver();
    rb1.setUdpPort(50000);
    rb2.setUdpPort(50000);
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:class-guard    文件TestUdpPackages.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    ThroughputInterceptor tint = new ThroughputInterceptor();
    tint.setInterval(500);
    ThroughputInterceptor tint2 = new ThroughputInterceptor();
    tint2.setInterval(500);
    //channel1.addInterceptor(tint);
    channel2.addInterceptor(tint2);
    listener1 = new Listener();
    ReceiverBase rb1 = (ReceiverBase)channel1.getChannelReceiver();
    ReceiverBase rb2 = (ReceiverBase)channel2.getChannelReceiver();
    rb1.setUdpPort(50000);
    rb2.setUdpPort(50000);
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:apache-tomcat-7.0.57    文件TestTcpFailureDetector.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel2 = new GroupChannel();
    channel1.getMembershipService().setPayload("Channel-1".getBytes("ASCII"));
    channel2.getMembershipService().setPayload("Channel-2".getBytes("ASCII"));
    mbrlist1 = new TestMbrListener("Channel-1");
    mbrlist2 = new TestMbrListener("Channel-2");
    tcpFailureDetector1 = new TcpFailureDetector();
    tcpFailureDetector2 = new TcpFailureDetector();
    channel1.addInterceptor(tcpFailureDetector1);
    channel2.addInterceptor(tcpFailureDetector2);
    channel1.addMembershipListener(mbrlist1);
    channel2.addMembershipListener(mbrlist2);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
}
项目:apache-tomcat-7.0.57    文件TestMulticastPackages.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    ThroughputInterceptor tint = new ThroughputInterceptor();
    tint.setInterval(500);
    ThroughputInterceptor tint2 = new ThroughputInterceptor();
    tint2.setInterval(500);
    //channel1.addInterceptor(tint);
    channel2.addInterceptor(tint2);
    listener1 = new Listener();
    ReceiverBase rb1 = (ReceiverBase)channel1.getChannelReceiver();
    ReceiverBase rb2 = (ReceiverBase)channel2.getChannelReceiver();
    rb1.setUdpPort(50000);
    rb2.setUdpPort(50000);
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:apache-tomcat-7.0.57    文件TestUdpPackages.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    ThroughputInterceptor tint = new ThroughputInterceptor();
    tint.setInterval(500);
    ThroughputInterceptor tint2 = new ThroughputInterceptor();
    tint2.setInterval(500);
    //channel1.addInterceptor(tint);
    channel2.addInterceptor(tint2);
    listener1 = new Listener();
    ReceiverBase rb1 = (ReceiverBase)channel1.getChannelReceiver();
    ReceiverBase rb2 = (ReceiverBase)channel2.getChannelReceiver();
    rb1.setUdpPort(50000);
    rb2.setUdpPort(50000);
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:tomcat7    文件TestGroupChannelSenderConnections.java   
@Before
@Override
public void setUp() throws Exception {
    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]);
    }
    TesterUtil.addRandomDomain(channels);
    for (int i = 0; i < channels.length; i++) {
        channels[i].start(Channel.SND_RX_SEQ|Channel.SND_TX_SEQ);
    }
}
项目:tomcat7    文件TestGroupChannelMemberArrival.java   
@Before
public void setUp() throws Exception {
    for (int i = 0; i < channels.length; i++) {
        channels[i] = new GroupChannel();
        channels[i].getMembershipService().setPayload( ("Channel-" + (i + 1)).getBytes("ASCII"));
        listeners[i] = new TestMbrListener( ("Listener-" + (i + 1)));
        channels[i].addMembershipListener(listeners[i]);
    }
    TesterUtil.addRandomDomain(channels);
}
项目:tomcat7    文件TestOrderInterceptor.java   
@Before
public void setUp() throws Exception {
    System.out.println("Setup");
    channels = new GroupChannel[channelCount];
    orderitcs = new OrderInterceptor[channelCount];
    mangleitcs = new MangleOrderInterceptor[channelCount];
    test = new TestListener[channelCount];
    threads = new Thread[channelCount];
    for ( int i=0; i<channelCount; i++ ) {
        channels[i] = new GroupChannel();

        orderitcs[i] = new OrderInterceptor();
        mangleitcs[i] = new MangleOrderInterceptor();
        orderitcs[i].setExpire(Long.MAX_VALUE);
        channels[i].addInterceptor(orderitcs[i]);
        channels[i].addInterceptor(mangleitcs[i]);
        test[i] = new TestListener(i);
        channels[i].addChannelListener(test[i]);
        final int j = i;
        threads[i] = new Thread() {
            @Override
            public void run() {
                try {
                    channels[j].start(Channel.DEFAULT);
                    Thread.sleep(50);
                } catch (Exception x) {
                    x.printstacktrace();
                }
            }
        };
    }
    TesterUtil.addRandomDomain(channels);
    for ( int i=0; i<channelCount; i++ ) threads[i].start();
    for ( int i=0; i<channelCount; i++ ) threads[i].join();
    Thread.sleep(1000);
}
项目:tomcat7    文件TestNonBlockingCoordinator.java   
@Before
public void setUp() throws Exception {
    System.out.println("Setup");
    channels = new GroupChannel[CHANNEL_COUNT];
    coordinators = new NonBlockingCoordinator[CHANNEL_COUNT];
    Thread[] threads = new Thread[CHANNEL_COUNT];
    for ( int i=0; i<CHANNEL_COUNT; i++ ) {
        channels[i] = new GroupChannel();
        coordinators[i] = new NonBlockingCoordinator();
        channels[i].addInterceptor(coordinators[i]);
        channels[i].addInterceptor(new TcpFailureDetector());
        final int j = i;
        threads[i] = new Thread() {
            @Override
            public void run() {
                try {
                    channels[j].start(Channel.DEFAULT);
                    Thread.sleep(50);
                } catch (Exception x) {
                    x.printstacktrace();
                }
            }
        };
    }
    TesterUtil.addRandomDomain(channels);
    for (int i = 0; i < CHANNEL_COUNT; i++) {
        threads[i].start();
    }
    for (int i = 0; i < CHANNEL_COUNT; i++) {
        threads[i].join();
    }
    Thread.sleep(1000);
}
项目:tomcat7    文件TestDataIntegrity.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    listener1 = new Listener();
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:tomcat7    文件TestRemoteProcessException.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel2 = new GroupChannel();
    listener1 = new Listener();
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:apache-tomcat-7.0.73-with-comment    文件TestGroupChannelSenderConnections.java   
@Before
@Override
public void setUp() throws Exception {
    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]);
    }
    TesterUtil.addRandomDomain(channels);
    for (int i = 0; i < channels.length; i++) {
        channels[i].start(Channel.SND_RX_SEQ|Channel.SND_TX_SEQ);
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件TestGroupChannelMemberArrival.java   
@Before
public void setUp() throws Exception {
    for (int i = 0; i < channels.length; i++) {
        channels[i] = new GroupChannel();
        channels[i].getMembershipService().setPayload( ("Channel-" + (i + 1)).getBytes("ASCII"));
        listeners[i] = new TestMbrListener( ("Listener-" + (i + 1)));
        channels[i].addMembershipListener(listeners[i]);
    }
    TesterUtil.addRandomDomain(channels);
}
项目:apache-tomcat-7.0.73-with-comment    文件TestOrderInterceptor.java   
@Before
public void setUp() throws Exception {
    System.out.println("Setup");
    channels = new GroupChannel[channelCount];
    orderitcs = new OrderInterceptor[channelCount];
    mangleitcs = new MangleOrderInterceptor[channelCount];
    test = new TestListener[channelCount];
    threads = new Thread[channelCount];
    for ( int i=0; i<channelCount; i++ ) {
        channels[i] = new GroupChannel();

        orderitcs[i] = new OrderInterceptor();
        mangleitcs[i] = new MangleOrderInterceptor();
        orderitcs[i].setExpire(Long.MAX_VALUE);
        channels[i].addInterceptor(orderitcs[i]);
        channels[i].addInterceptor(mangleitcs[i]);
        test[i] = new TestListener(i);
        channels[i].addChannelListener(test[i]);
        final int j = i;
        threads[i] = new Thread() {
            @Override
            public void run() {
                try {
                    channels[j].start(Channel.DEFAULT);
                    Thread.sleep(50);
                } catch (Exception x) {
                    x.printstacktrace();
                }
            }
        };
    }
    TesterUtil.addRandomDomain(channels);
    for ( int i=0; i<channelCount; i++ ) threads[i].start();
    for ( int i=0; i<channelCount; i++ ) threads[i].join();
    Thread.sleep(1000);
}
项目:apache-tomcat-7.0.73-with-comment    文件TestNonBlockingCoordinator.java   
@Before
public void setUp() throws Exception {
    System.out.println("Setup");
    channels = new GroupChannel[CHANNEL_COUNT];
    coordinators = new NonBlockingCoordinator[CHANNEL_COUNT];
    Thread[] threads = new Thread[CHANNEL_COUNT];
    for ( int i=0; i<CHANNEL_COUNT; i++ ) {
        channels[i] = new GroupChannel();
        coordinators[i] = new NonBlockingCoordinator();
        channels[i].addInterceptor(coordinators[i]);
        channels[i].addInterceptor(new TcpFailureDetector());
        final int j = i;
        threads[i] = new Thread() {
            @Override
            public void run() {
                try {
                    channels[j].start(Channel.DEFAULT);
                    Thread.sleep(50);
                } catch (Exception x) {
                    x.printstacktrace();
                }
            }
        };
    }
    TesterUtil.addRandomDomain(channels);
    for (int i = 0; i < CHANNEL_COUNT; i++) {
        threads[i].start();
    }
    for (int i = 0; i < CHANNEL_COUNT; i++) {
        threads[i].join();
    }
    Thread.sleep(1000);
}
项目:apache-tomcat-7.0.73-with-comment    文件TestDataIntegrity.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    listener1 = new Listener();
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:apache-tomcat-7.0.73-with-comment    文件TestRemoteProcessException.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel2 = new GroupChannel();
    listener1 = new Listener();
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:class-guard    文件TestGroupChannelSenderConnections.java   
@Before
@Override
public void setUp() throws Exception {
    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]);
    }
    TesterUtil.addRandomDomain(channels);
    for (int i = 0; i < channels.length; i++) {
        channels[i].start(Channel.SND_RX_SEQ|Channel.SND_TX_SEQ);
    }
}
项目:class-guard    文件TestGroupChannelMemberArrival.java   
@Before
public void setUp() throws Exception {
    for (int i = 0; i < channels.length; i++) {
        channels[i] = new GroupChannel();
        channels[i].getMembershipService().setPayload( ("Channel-" + (i + 1)).getBytes("ASCII"));
        listeners[i] = new TestMbrListener( ("Listener-" + (i + 1)));
        channels[i].addMembershipListener(listeners[i]);
    }
    TesterUtil.addRandomDomain(channels);
}
项目:class-guard    文件TestOrderInterceptor.java   
@Before
public void setUp() throws Exception {
    System.out.println("Setup");
    channels = new GroupChannel[channelCount];
    orderitcs = new OrderInterceptor[channelCount];
    mangleitcs = new MangleOrderInterceptor[channelCount];
    test = new TestListener[channelCount];
    threads = new Thread[channelCount];
    for ( int i=0; i<channelCount; i++ ) {
        channels[i] = new GroupChannel();

        orderitcs[i] = new OrderInterceptor();
        mangleitcs[i] = new MangleOrderInterceptor();
        orderitcs[i].setExpire(Long.MAX_VALUE);
        channels[i].addInterceptor(orderitcs[i]);
        channels[i].addInterceptor(mangleitcs[i]);
        test[i] = new TestListener(i);
        channels[i].addChannelListener(test[i]);
        final int j = i;
        threads[i] = new Thread() {
            @Override
            public void run() {
                try {
                    channels[j].start(Channel.DEFAULT);
                    Thread.sleep(50);
                } catch (Exception x) {
                    x.printstacktrace();
                }
            }
        };
    }
    TesterUtil.addRandomDomain(channels);
    for ( int i=0; i<channelCount; i++ ) threads[i].start();
    for ( int i=0; i<channelCount; i++ ) threads[i].join();
    Thread.sleep(1000);
}
项目:class-guard    文件TestNonBlockingCoordinator.java   
@Before
public void setUp() throws Exception {
    System.out.println("Setup");
    channels = new GroupChannel[CHANNEL_COUNT];
    coordinators = new NonBlockingCoordinator[CHANNEL_COUNT];
    Thread[] threads = new Thread[CHANNEL_COUNT];
    for ( int i=0; i<CHANNEL_COUNT; i++ ) {
        channels[i] = new GroupChannel();
        coordinators[i] = new NonBlockingCoordinator();
        channels[i].addInterceptor(coordinators[i]);
        channels[i].addInterceptor(new TcpFailureDetector());
        final int j = i;
        threads[i] = new Thread() {
            @Override
            public void run() {
                try {
                    channels[j].start(Channel.DEFAULT);
                    Thread.sleep(50);
                } catch (Exception x) {
                    x.printstacktrace();
                }
            }
        };
    }
    TesterUtil.addRandomDomain(channels);
    for (int i = 0; i < CHANNEL_COUNT; i++) {
        threads[i].start();
    }
    for (int i = 0; i < CHANNEL_COUNT; i++) {
        threads[i].join();
    }
    Thread.sleep(1000);
}
项目:class-guard    文件TestDataIntegrity.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    listener1 = new Listener();
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:class-guard    文件TestRemoteProcessException.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel2 = new GroupChannel();
    listener1 = new Listener();
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:apache-tomcat-7.0.57    文件TestGroupChannelSenderConnections.java   
@Before
@Override
public void setUp() throws Exception {
    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]);
    }
    TesterUtil.addRandomDomain(channels);
    for (int i = 0; i < channels.length; i++) {
        channels[i].start(Channel.SND_RX_SEQ|Channel.SND_TX_SEQ);
    }
}
项目:apache-tomcat-7.0.57    文件TestGroupChannelMemberArrival.java   
@Before
public void setUp() throws Exception {
    for (int i = 0; i < channels.length; i++) {
        channels[i] = new GroupChannel();
        channels[i].getMembershipService().setPayload( ("Channel-" + (i + 1)).getBytes("ASCII"));
        listeners[i] = new TestMbrListener( ("Listener-" + (i + 1)));
        channels[i].addMembershipListener(listeners[i]);
    }
    TesterUtil.addRandomDomain(channels);
}
项目:apache-tomcat-7.0.57    文件TestOrderInterceptor.java   
@Before
public void setUp() throws Exception {
    System.out.println("Setup");
    channels = new GroupChannel[channelCount];
    orderitcs = new OrderInterceptor[channelCount];
    mangleitcs = new MangleOrderInterceptor[channelCount];
    test = new TestListener[channelCount];
    threads = new Thread[channelCount];
    for ( int i=0; i<channelCount; i++ ) {
        channels[i] = new GroupChannel();

        orderitcs[i] = new OrderInterceptor();
        mangleitcs[i] = new MangleOrderInterceptor();
        orderitcs[i].setExpire(Long.MAX_VALUE);
        channels[i].addInterceptor(orderitcs[i]);
        channels[i].addInterceptor(mangleitcs[i]);
        test[i] = new TestListener(i);
        channels[i].addChannelListener(test[i]);
        final int j = i;
        threads[i] = new Thread() {
            @Override
            public void run() {
                try {
                    channels[j].start(Channel.DEFAULT);
                    Thread.sleep(50);
                } catch (Exception x) {
                    x.printstacktrace();
                }
            }
        };
    }
    TesterUtil.addRandomDomain(channels);
    for ( int i=0; i<channelCount; i++ ) threads[i].start();
    for ( int i=0; i<channelCount; i++ ) threads[i].join();
    Thread.sleep(1000);
}
项目:apache-tomcat-7.0.57    文件TestNonBlockingCoordinator.java   
@Before
public void setUp() throws Exception {
    System.out.println("Setup");
    channels = new GroupChannel[CHANNEL_COUNT];
    coordinators = new NonBlockingCoordinator[CHANNEL_COUNT];
    Thread[] threads = new Thread[CHANNEL_COUNT];
    for ( int i=0; i<CHANNEL_COUNT; i++ ) {
        channels[i] = new GroupChannel();
        coordinators[i] = new NonBlockingCoordinator();
        channels[i].addInterceptor(coordinators[i]);
        channels[i].addInterceptor(new TcpFailureDetector());
        final int j = i;
        threads[i] = new Thread() {
            @Override
            public void run() {
                try {
                    channels[j].start(Channel.DEFAULT);
                    Thread.sleep(50);
                } catch (Exception x) {
                    x.printstacktrace();
                }
            }
        };
    }
    TesterUtil.addRandomDomain(channels);
    for (int i = 0; i < CHANNEL_COUNT; i++) {
        threads[i].start();
    }
    for (int i = 0; i < CHANNEL_COUNT; i++) {
        threads[i].join();
    }
    Thread.sleep(1000);
}
项目:apache-tomcat-7.0.57    文件TestDataIntegrity.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel1.addInterceptor(new Messagedispatch15Interceptor());
    channel2 = new GroupChannel();
    channel2.addInterceptor(new Messagedispatch15Interceptor());
    listener1 = new Listener();
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}
项目:apache-tomcat-7.0.57    文件TestRemoteProcessException.java   
@Before
public void setUp() throws Exception {
    channel1 = new GroupChannel();
    channel2 = new GroupChannel();
    listener1 = new Listener();
    channel2.addChannelListener(listener1);
    TesterUtil.addRandomDomain(new ManagedChannel[] {channel1,channel2});
    channel1.start(Channel.DEFAULT);
    channel2.start(Channel.DEFAULT);
}

相关文章

买水果
比较全面的redis工具类
gson 反序列化到多态子类
java 版本的 mb_strwidth
JAVA 反转字符串的最快方法,大概比StringBuffer.reverse()性...
com.google.gson.internal.bind.ArrayTypeAdapter的实例源码...