@Test
public void testByteCapacityBufferEmptyingAfterRollback() {

  Context context = new Context();
  Map<String, String> parms = new HashMap<String, String>();
  parms.put("byteCapacity", "2000");
  parms.put("byteCapacityBufferPercentage", "20");
  context.putAll(parms);
  Configurables.configure(channel,  context);
  byte[] eventBody = new byte[405];
  Transaction tx = channel.getTransaction();
  tx.begin();
  channel.put(EventBuilder.withBody(eventBody));
  channel.put(EventBuilder.withBody(eventBody));
  channel.put(EventBuilder.withBody(eventBody));
  tx.rollback();
  tx.close();
  tx = channel.getTransaction();
  tx.begin();
  channel.put(EventBuilder.withBody(eventBody));
  channel.put(EventBuilder.withBody(eventBody));
  channel.put(EventBuilder.withBody(eventBody));
  tx.commit();
  tx.close();
}