public void testStress() throws TimeoutException, InterruptedException, ExecutionException, ImmediateDownstreamReplicationException {
  final long timeout=5000;
  for (int i=0; i < 100; i++) {
    final int sze=10000 + r.nextInt(300000);
    final ByteBuffer tst=getRandomData(sze);
    final HAMessageWrapper msg=newHAWriteMessage(sze,tst);
    final ByteBuffer rcv=ByteBuffer.allocate(sze + r.nextInt(1024));
    final Future<Void> futRec=receiveService.receiveData(msg,rcv);
    final Future<Void> futSnd=sendService.send(tst,msg.getMarker());
    futSnd.get(timeout,TimeUnit.MILLISECONDS);
    futRec.get(timeout,TimeUnit.MILLISECONDS);
    assertEquals(tst,rcv);
  }
}

public void testStress ( ) throws TimeoutException , InterruptedException , ExecutionException , ImmediateDownstreamReplicationException { final long timeout = 5000 ; for ( int i = 0 ; i < 100 ; i ++ ) { final int sze = 10000 + r . nextInt ( 300000 ) ; final ByteBuffer tst = getRandomData ( sze ) ; final HAMessageWrapper msg = newHAWriteMessage ( sze , tst ) ; final ByteBuffer rcv = ByteBuffer . allocate ( sze + r . nextInt ( 1024 ) ) ; final Future < Void > futRec = receiveService . receiveData ( msg , rcv ) ; final Future < Void > futSnd = sendService . send ( tst , msg . getMarker ( ) ) ; futSnd . get ( timeout , TimeUnit . MILLISECONDS ) ; futRec . get ( timeout , TimeUnit . MILLISECONDS ) ; assertEquals ( tst , rcv ) ; } }
sends a large number of random buffers , confirming successful transmission .
