public void test_write_correctRejection_emptyRecord(){
  final IRawStore store=getStore();
  try {
    try {
      store.write(ByteBuffer.wrap(new byte[]{}));
      fail("Expecting: " + IllegalArgumentException.class);
    }
 catch (    IllegalArgumentException ex) {
      if (log.isInfoEnabled())       log.info("Ignoring expected exception: " + ex);
    }
    try {
      final ByteBuffer buf=ByteBuffer.wrap(new byte[2]);
      buf.position(buf.limit());
      store.write(buf);
      fail("Expecting: " + IllegalArgumentException.class);
    }
 catch (    IllegalArgumentException ex) {
      if (log.isInfoEnabled())       log.info("Ignoring expected exception: " + ex);
    }
  }
  finally {
    store.destroy();
  }
}

public void test_write_correctRejection_emptyRecord ( ) { final IRawStore store = getStore ( ) ; try { try { store . write ( ByteBuffer . wrap ( new byte [ ] { } ) ) ; fail ( "Expecting: " + IllegalArgumentException . class ) ; } catch ( IllegalArgumentException ex ) { if ( log . isInfoEnabled ( ) ) log . info ( "Ignoring expected exception: " + ex ) ; } try { final ByteBuffer buf = ByteBuffer . wrap ( new byte [ 2 ] ) ; buf . position ( buf . limit ( ) ) ; store . write ( buf ) ; fail ( "Expecting: " + IllegalArgumentException . class ) ; } catch ( IllegalArgumentException ex ) { if ( log . isInfoEnabled ( ) ) log . info ( "Ignoring expected exception: " + ex ) ; } } finally { store . destroy ( ) ; } }
test verifies correct rejection of a write operation when the caller supplies an empty buffer ( no bytes remaining ) .
