Examples of DummyNonDurableTransactionParticipant


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

    }

    @Test
    public void testCommitActive() throws Exception {
  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant()
  };
  for (TransactionParticipant participant : participants) {
View Full Code Here

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

    }

    @Test
    public void testCommitAborting() throws Exception {
  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyNonDurableTransactionParticipant() {
    public void abort(Transaction txn) {
        try {
      handle.commit();
      fail("Expected IllegalStateException");
        } catch (IllegalStateException e) {
      System.err.println(e);
      throw e;
        } catch (Exception e) {
      fail("Unexpected exception: " + e);
        }
    }
      },
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      }
  };
  for (TransactionParticipant participant : participants) {
      txn.join(participant);
View Full Code Here

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

    @Test
    public void testCommitPreparing() throws Exception {
  final Exception[] abortCause = { null };
  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyNonDurableTransactionParticipant() {
    public boolean prepare(Transaction txn) {
        try {
      handle.commit();
      fail("Expected IllegalStateException");
        } catch (IllegalStateException e) {
      System.err.println(e);
      abortCause[0] = e;
      throw e;
        } catch (Exception e) {
      fail("Unexpected exception: " + e);
        }
        throw new AssertionError();
    }
      },
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant()
  };
  for (TransactionParticipant participant : participants) {
View Full Code Here

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

    @Test
    public void testCommitPrepareAndCommitting() throws Exception {
  final Exception[] abortCause = { null };
  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant() {
    public void prepareAndCommit(Transaction txn) {
        try {
View Full Code Here

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

    }

    @Test
    public void testCommitCommitting() throws Exception {
  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyNonDurableTransactionParticipant() {
    public void commit(Transaction txn) {
        try {
      handle.commit();
      fail("Expected IllegalStateException");
        } catch (IllegalStateException e) {
      System.err.println(e);
      throw e;
        } catch (Exception e) {
      fail("Unexpected exception: " + e);
        }
    }
      },
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      }
  };
  for (TransactionParticipant participant : participants) {
      txn.join(participant);
View Full Code Here

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

    @Test
    public void testCommitPrepareFailsMiddle() throws Exception {
  final Exception abortCause = new IOException("Prepare failed");
  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyNonDurableTransactionParticipant() {
    public boolean prepare(Transaction txn) throws Exception {
        throw abortCause;
    }
      },
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant()
  };
  for (TransactionParticipant participant : participants) {
View Full Code Here

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

    @Test
    public void testCommitPrepareFailsLast() throws Exception {
  final Exception abortCause = new IOException("Prepare failed");
  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant() {
    public void prepareAndCommit(Transaction txn)
        throws Exception
View Full Code Here

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

    }

    @Test
    public void testCommitPrepareAbortsMiddle() throws Exception {
  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyNonDurableTransactionParticipant() {
    public boolean prepare(Transaction txn) {
        try {
      txn.abort(abortXcp);
        } catch (RuntimeException e) {
      fail("Unexpected exception: " + e);
        }
        return false;
    }
      },
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant()
  };
  for (TransactionParticipant participant : participants) {
View Full Code Here

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

    }

    @Test
    public void testCommitPrepareAbortsLast() throws Exception {
  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant() {
    public void prepareAndCommit(Transaction txn) {
        try {
View Full Code Here

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

    }

    @Test
    public void testCommitPrepareAbortsAndFailsMiddle() throws Exception {
  DummyTransactionParticipant[] participants = {
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyNonDurableTransactionParticipant(),
      new DummyNonDurableTransactionParticipant() {
    public boolean prepare(Transaction txn) throws Exception {
        try {
      txn.abort(abortXcp);
        } catch (RuntimeException e) {
      fail("Unexpected exception: " + e);
        }
        throw new IOException("Prepare failed");
    }
      },
      new DummyNonDurableTransactionParticipant() {
    protected boolean prepareResult() { return true; }
      },
      new DummyTransactionParticipant()
  };
  for (TransactionParticipant participant : participants) {
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.