Examples of DummyTransactionParticipant


Examples of com.sun.sgs.test.util.DummyTransactionParticipant

    }

    @Test
    public void testJoinCommitted() throws Exception {
  handle.commit();
  DummyTransactionParticipant participant =
      new DummyTransactionParticipant();
  try {
      txn.join(participant);
      fail("Expected IllegalStateException");
  } catch (IllegalStateException e) {
      System.err.println(e);
View Full Code Here

Examples of com.sun.sgs.test.util.DummyTransactionParticipant

  assertCommitted();
    }

    @Test
    public void testJoinAbortedWithRetryableCause() throws Exception {
  DummyTransactionParticipant participant =
      new DummyTransactionParticipant();
  Exception abortCause = new TransactionAbortedException("Aborted");
  txn.abort(abortCause);
  try {
      txn.join(participant);
      fail("Expected TransactionNotActiveException");
View Full Code Here

Examples of com.sun.sgs.test.util.DummyTransactionParticipant

  assertAborted(abortCause);
    }

    @Test
    public void testJoinAbortedWithNonRetryableCause() throws Exception {
  DummyTransactionParticipant participant =
      new DummyTransactionParticipant();
  Exception abortCause = new IllegalArgumentException();
  txn.abort(abortCause);
  try {
      txn.join(participant);
      fail("Expected TransactionNotActiveException");
View Full Code Here

Examples of com.sun.sgs.test.util.DummyTransactionParticipant

  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant()
  };
  for (TransactionParticipant participant : participants) {
      txn.join(participant);
  }
  assertNotAborted();
View Full Code Here

Examples of com.sun.sgs.test.util.DummyTransactionParticipant

  assertAborted(abortCause);
    }

    @Test
    public void testAbortAborted() throws Exception {
  txn.join(new DummyTransactionParticipant());
  Exception cause = new Exception("Abort cause");
  txn.abort(cause);
  try {
      txn.abort(new Exception("Another"));
      fail("Expected TransactionNotActiveException");
View Full Code Here

Examples of com.sun.sgs.test.util.DummyTransactionParticipant

    }
      },
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant()
  };
  for (TransactionParticipant participant : participants) {
      txn.join(participant);
  }
  try {
View Full Code Here

Examples of com.sun.sgs.test.util.DummyTransactionParticipant

  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant() {
    public void prepareAndCommit(Transaction txn) {
        assertNotAborted();
        try {
      txn.abort(abortXcp);
        } catch (RuntimeException e) {
View Full Code Here

Examples of com.sun.sgs.test.util.DummyTransactionParticipant

  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant() {
    public void prepareAndCommit(Transaction txn) {
        assertNotAborted();
        try {
      txn.abort(abortCause);
        } catch (RuntimeException e) {
View Full Code Here

Examples of com.sun.sgs.test.util.DummyTransactionParticipant

  assertCommitted();
    }

    @Test
    public void testAbortCommitted() throws Exception {
  txn.join(new DummyTransactionParticipant());
  handle.commit();
  assertCommitted();
  try {
      txn.abort(abortXcp);
      fail("Expected IllegalStateException");
View Full Code Here

Examples of com.sun.sgs.test.util.DummyTransactionParticipant

      new DummyNonDurableTransactionParticipant() {
    public void abort(Transaction txn) {
        throw new RuntimeException("Abort failed");
    }
      },
      new DummyTransactionParticipant() {
      }
  };
  for (TransactionParticipant participant : participants) {
      txn.join(participant);
  }
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.