@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}); }
@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); }
@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); } }
@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); }
@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); }
@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); }
@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); }
@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); }