Examples of DemoBusinessParticipant


Examples of com.arjuna.mwtests.wst.common.DemoBusinessParticipant

  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      com.arjuna.wst.BAParticipantManager bpm = null;
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.EXIT, "1234");
     
      uba.begin();
     
      bpm = bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1234");

      bpm.exit();
     
      uba.close();

      passed = p.passed();
  }
  catch (Exception ex)
  {
      ex.printStackTrace();
  }
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoBusinessParticipant

 
  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CANCEL, "1234");
      FailureBusinessParticipant fp = new FailureBusinessParticipant(FailureBusinessParticipant.FAIL_IN_CANCEL, "5678");
     
      uba.begin();
     
      bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1234");
      bam.enlistForBusinessAgreementWithParticipantCompletion(fp, "5678");
     
      uba.close();

      passed = p.passed();
  }
  catch (Exception ex)
  {
      ex.printStackTrace();
  }
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoBusinessParticipant

 
  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CLOSE, "1234");
     
      uba.begin();
     
      bam.enlistForBusinessAgreementWithParticipantCompletion(p, null);
     
      uba.close();

      passed = p.passed();
  }
  catch (Exception ex)
  {
      ex.printStackTrace();
  }
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoBusinessParticipant

  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      String participantId = "1234";
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CANCEL, participantId);
     
      uba.begin();
     
      bam.enlistForBusinessAgreementWithParticipantCompletion(p, participantId);

      uba.cancel();

      passed = p.passed();
  }
  catch (Exception ex)
  {
      ex.printStackTrace();
  }
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoBusinessParticipant

  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      com.arjuna.wst.BAParticipantManager bpm1 = null;
      com.arjuna.wst.BAParticipantManager bpm2 = null;
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.COMPENSATE, "1234");
      FailureBusinessParticipant fp = new FailureBusinessParticipant(FailureBusinessParticipant.FAIL_IN_COMPENSATE, "5678");
     
      uba.begin();
     
      bpm1 = bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1234");
      bpm2 = bam.enlistForBusinessAgreementWithParticipantCompletion(fp, "5678");

      bpm1.completed();
      bpm2.completed();
     
      uba.cancel();

      passed = p.passed();
  }
  catch (Exception ex)
  {
      ex.printStackTrace();
  }
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoBusinessParticipant

  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      com.arjuna.wst.BAParticipantManager bpm = null;
      String participantId = "1234";
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.COMPENSATE, participantId);
     
      uba.begin();
     
      bpm = bam.enlistForBusinessAgreementWithParticipantCompletion(p, participantId);

      bpm.completed();
     
      uba.cancel();

      passed = p.passed();
  }
  catch (Exception ex)
  {
      ex.printStackTrace();
  }
View Full Code Here

Examples of com.arjuna.mwtests.wst.common.DemoBusinessParticipant

 
  try
  {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
      BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CLOSE, "1234");
      FailureBusinessParticipant fp = new FailureBusinessParticipant(FailureBusinessParticipant.FAIL_IN_CLOSE, "5678");
     
      uba.begin();
     
      bam.enlistForBusinessAgreementWithParticipantCompletion(p, null);
      bam.enlistForBusinessAgreementWithParticipantCompletion(fp, null);
     
      uba.close();

      passed = p.passed();
  }
  catch (Exception ex)
  {
      ex.printStackTrace();
  }
View Full Code Here

Examples of com.arjuna.wst.tests.common.DemoBusinessParticipant

            throws Exception
    {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
        BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      com.arjuna.wst.BAParticipantManager bpm = null;
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.EXIT, "1238");
      try {
      uba.begin();
     
      bpm = bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1238");

      bpm.exit();
        } catch (Exception eouter) {
            try {
                uba.cancel();
            } catch(Exception einner) {
            }
            throw eouter;
        }
     
      uba.close();

      assertTrue(p.passed());
    }
View Full Code Here

Examples of com.arjuna.wst.tests.common.DemoBusinessParticipant

    public static void testMultiCancel()
            throws Exception
    {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
        BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CANCEL, "1239");
      FailureBusinessParticipant fp = new FailureBusinessParticipant(FailureBusinessParticipant.FAIL_IN_CANCEL, "5678");
      try {
      uba.begin();
     
      bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1239");
      bam.enlistForBusinessAgreementWithParticipantCompletion(fp, "5678");
        } catch (Exception eouter) {
            try {
                uba.cancel();
            } catch(Exception einner) {
            }
            throw eouter;
        }
      try {
      uba.cancel();
        } catch (SystemException ex) {
            // failure will result in heuristic hazard warning message but wil not throw an exception
            throw ex;
        } catch (Exception eouter) {
            try {
                uba.cancel();
            } catch(Exception einner) {
            }
            throw eouter;
        }
        assertTrue(p.passed());
    }
View Full Code Here

Examples of com.arjuna.wst.tests.common.DemoBusinessParticipant

            throws Exception
    {
      UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
        BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
      com.arjuna.wst.BAParticipantManager bpm = null;
        DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CLOSE, "1235");
      try {
      uba.begin();
     
      bpm = bam.enlistForBusinessAgreementWithParticipantCompletion(p, p.identifier());
        bpm.completed();
        } catch (Exception eouter) {
            try {
                uba.cancel();
            } catch(Exception einner) {
            }
            throw eouter;
        }

      uba.close();

      assertTrue(p.passed());
    }
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.