public void testMRMW() throws Exception {
  final IRawStore store=getStore();
  try {
    final long timeout=20;
    final int ntrials=2000;
    final int nclients=20;
    final double percentReaders=.70d;
    final double percentWriterWillFlush=.10d;
    final int reclen=128;
    final int nwrites=100;
    final int nreads=100;
    final AtomicInteger nerr=new AtomicInteger();
    doMRMWTest(store,timeout,ntrials,nclients,percentReaders,percentWriterWillFlush,reclen,nwrites,nreads,nerr);
    assertEquals("nerrors",0L,nerr.get());
  }
  finally {
    store.destroy();
  }
}

public void testMRMW ( ) throws Exception { final IRawStore store = getStore ( ) ; try { final long timeout = 20 ; final int ntrials = 2000 ; final int nclients = 20 ; final double percentReaders = .70d ; final double percentWriterWillFlush = .10d ; final int reclen = 128 ; final int nwrites = 100 ; final int nreads = 100 ; final AtomicInteger nerr = new AtomicInteger ( ) ; doMRMWTest ( store , timeout , ntrials , nclients , percentReaders , percentWriterWillFlush , reclen , nwrites , nreads , nerr ) ; assertEquals ( "nerrors" , 0L , nerr . get ( ) ) ; } finally { store . destroy ( ) ; } }
correctness / stress test verifies that the implementation supports multiple readers , multiple writers . < p > note : you may have to run this test several times to detect some rare problems . for example , there is a sun bug which can arise when a read operation runs concurrent with a change in the size of the file under windows . this bug is not demonstrated each time , so you may need to run the test more than once if you suspect this issue . the problem is being addressed by the introduction of a read - write lock to restrict readers when we need to extend the backing store ( unfortunately , that does not seem to do the trick ) .
