Package com.sun.sgs.test.util

Examples of com.sun.sgs.test.util.DummyTransactionListener.assertCalled()


  /*
   * Don't know which listener's beforeCompletion method was called
   * first, so don't check if this one's was called.
   */
  listener.assertCalledAfter(CalledAfter.ABORT);
  failingListener.assertCalled(true, CalledAfter.ABORT);
    }

    @Test
    public void testRegisterListenerCommitAfterThrows() throws Exception {
  RuntimeException exception = new RuntimeException();
View Full Code Here


  DummyTransactionListener listener = new DummyTransactionListener();
  txn.registerListener(listener);
  /* Check that registering twice has no effect. */
  txn.registerListener(listener);
  txn.abort(abortXcp);
  listener.assertCalled(false, CalledAfter.ABORT);
    }

    @Test
    public void testRegisterListenerAbortAfterThrows() throws Exception {
  RuntimeException exception = new RuntimeException();
View Full Code Here

      handle.commit();
      fail("Expected TransactionAbortedException");
  } catch (TransactionAbortedException e) {
      System.err.println(e);
  }
  listener.assertCalled(true, CalledAfter.ABORT);
    }

    @Test
    public void testRegisterListenerAborting() {
  final DummyTransactionListener listener =
View Full Code Here

  if (exception[0] instanceof TransactionNotActiveException) {
      System.err.println(exception[0]);
  } else {
      fail("Expected TransactionNotActiveException: " + exception[0]);
  }
  listener.assertCalled(false, CalledAfter.NO);
    }

    @Test
    public void testRegisterListenerAborted() {
  DummyTransactionListener listener = new DummyTransactionListener();
View Full Code Here

      txn.registerListener(listener);
      fail("Expected TransactionNotActiveException");
  } catch (TransactionNotActiveException e) {
      System.err.println(e);
  }
  listener.assertCalled(false, CalledAfter.NO);
    }

    @Test
    public void testRegisterListenerPreparing() throws Exception {
  final DummyTransactionListener listener =
View Full Code Here

  if (exception[0] instanceof TransactionNotActiveException) {
      System.err.println(exception[0]);
  } else {
      fail("Expected TransactionNotActiveException: " + exception[0]);
  }
  listener.assertCalled(false, CalledAfter.NO);
    }

    @Test
    public void testRegisterListenerPrepareAndCommitting() throws Exception {
  final DummyTransactionListener listener =
View Full Code Here

  if (exception[0] instanceof TransactionNotActiveException) {
      System.err.println(exception[0]);
  } else {
      fail("Expected TransactionNotActiveException: " + exception[0]);
  }
  listener.assertCalled(false, CalledAfter.NO);
    }

    @Test
    public void testRegisterListenerCommitting() throws Exception {
  final DummyTransactionListener listener =
View Full Code Here

  if (exception[0] instanceof TransactionNotActiveException) {
      System.err.println(exception[0]);
  } else {
      fail("Expected TransactionNotActiveException: " + exception[0]);
  }
  listener.assertCalled(false, CalledAfter.NO);
    }

    @Test
    public void testRegisterListenerCommitted() throws Exception {
  DummyTransactionListener listener = new DummyTransactionListener();
View Full Code Here

      txn.registerListener(listener);
      fail("Expected TransactionNotActiveException");
  } catch (TransactionNotActiveException e) {
      System.err.println(e);
  }
  listener.assertCalled(false, CalledAfter.NO);
    }

    @Test
    public void testRegisterListenerBeforeCompletion() throws Exception {
  final DummyTransactionListener lateListener =
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.