@Test
public void testCommit1() throws Exception {

  final Transaction transaction = channel.getTransaction();
  testIllegalState(new Runnable() {
      @Override
      public void run() {
        transaction.commit();
      }
    });
  transaction.begin();
  testExceptions(new Runnable() {
      @Override
      public void run() {
        transaction.commit();
      }
    });
  transaction.commit();
  testIllegalState(new Runnable() {
      @Override
      public void run() {
        transaction.commit();
      }
    });
  transaction.close();
  testIllegalState(new Runnable() {
      @Override
      public void run() {
        transaction.commit();
      }
    });
}