Package com.arjuna.mw.wscf.model.twophase.api

Examples of com.arjuna.mw.wscf.model.twophase.api.UserCoordinator


    public void testBeginConfirm()
            throws Exception
    {
        System.out.println("Running test : " + this.getClass().getName());

        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();

  try
  {
      ua.begin();

      System.out.println("Started: "+ua.identifier()+"\n");

      ua.confirm();
  }
  catch (Exception ex)
  {
      WSCFTestUtils.cleanup(ua);
        throw ex;
View Full Code Here


    public void testSuspendResume()
            throws Exception
    {
        System.out.println("Running test : " + this.getClass().getName());

        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();

  try
  {
      ua.begin();

      System.out.println("Started: "+ua.identifier()+"\n");

      ActivityHierarchy hier = ua.suspend();
     
      System.out.println("Suspended: "+hier+"\n");
     
      if (ua.currentActivity() != null)
      {
            WSCFTestUtils.cleanup(ua);
            fail("Hierarchy still active");
        }
      else
      {
            ua.resume(hier);

            System.out.println("Resumed: "+hier+"\n");

            ua.cancel();
           
            System.out.println("Cancelled");
      }
  }
  catch (Exception ex)
View Full Code Here

    public void testCancelOnlyCancel()
            throws Exception
    {
        System.out.println("Running test : " + this.getClass().getName());

        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();

  try
  {
      ua.begin();

      System.out.println("Started: "+ua.identifier()+"\n");

      ua.setCancelOnly();

      ua.cancel();
  }
  catch (CoordinatorCancelledException ex)
  {
        // why is it ok to get here?
        WSCF11TestUtils.cleanup(ua);
View Full Code Here

    public void testCancelOnlyConfirm()
            throws Exception
    {
        System.out.println("Running test : " + this.getClass().getName());

        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();

  try
  {
      ua.begin();

      System.out.println("Started: "+ua.identifier()+"\n");

      ua.setCancelOnly();

      ua.confirm();

        fail("Confirm succeeded after setCancelOnly");
    }
  catch (CoordinatorCancelledException ex)
  {
View Full Code Here

    public void testWscTranslateContext()
            throws Exception
    {
        System.out.println("Running test : " + this.getClass().getName());

        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();

  try
  {
      ua.begin();

      System.out.println("Started: "+ua.identifier()+"\n");

      DeploymentContext manager = DeploymentContextFactory.deploymentContext();
      SOAPContext theContext = (SOAPContext) manager.context();

      System.out.println(theContext);

        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        org.w3c.dom.Document doc = builder.newDocument();
        org.w3c.dom.Element ctx = doc.createElement("Context-test");
        final Element context = ((SOAPContext)theContext).serialiseToElement(ctx) ;
       
        org.w3c.dom.Element wscCtx = translate(context);
     
      System.out.println("\nNow got "+DomUtil.nodeAsString(wscCtx));

      ua.cancel();
  }
  catch (Exception ex)
  {
      WSCFTestUtils.cleanup(ua);
        throw ex;
View Full Code Here

    public void testWscContext()
            throws Exception
    {
        System.out.println("Running test : " + this.getClass().getName());

        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();

  try
  {
      ua.begin();

      System.out.println("Started: "+ua.identifier()+"\n");

      DeploymentContext manager = DeploymentContextFactory.deploymentContext();
      Context theContext = manager.context();

      System.out.println(theContext);
     
      ua.cancel();
  }
  catch (Exception ex)
  {
        WSCFTestUtils.cleanup(ua);
View Full Code Here

    public void testSuspendConfirm()
            throws Exception
    {
        System.out.println("Running test : " + this.getClass().getName());

        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();

  try
  {
      ua.begin();

      System.out.println("Started: "+ua.identifier()+"\n");

      ActivityHierarchy hier = ua.suspend();
     
      System.out.println("Suspended: "+hier+"\n");
     
      if (ua.currentActivity() != null) {
            WSCFTestUtils.cleanup(ua);
            fail("Hierarchy still active.");
        }

        ua.confirm();
  }
  catch (NoCoordinatorException ex)
  {
      // why is it ok to get here?
        WSCFTestUtils.cleanup(ua);
View Full Code Here

    public void testSuspend()
            throws Exception
    {
        System.out.println("Running test : " + this.getClass().getName());

        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();

  try
  {
      ua.begin();

      System.out.println("Started: "+ua.identifier()+"\n");

      ActivityHierarchy hier = ua.suspend();

      System.out.println("Suspended: "+hier+"\n");

      if (ua.currentActivity() != null) {
            WSCF11TestUtils.cleanup(ua);
            fail("Hierarchy still active.");
        }
  }
  catch (NoCoordinatorException ex)
View Full Code Here

    public void testBeginCancel()
            throws Exception
    {
        System.out.println("Running test : " + this.getClass().getName());

        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();

      ua.begin();

      System.out.println("Started: "+ua.identifier()+"\n");

      ua.cancel();

        System.out.println("Cancelled");
    }
View Full Code Here

    public void testSuspendConfirm()
            throws Exception
    {
        System.out.println("Running test : " + this.getClass().getName());

        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();

  try
  {
      ua.begin();

      System.out.println("Started: "+ua.identifier()+"\n");

      ActivityHierarchy hier = ua.suspend();

      System.out.println("Suspended: "+hier+"\n");

      if (ua.currentActivity() != null) {
            WSCF11TestUtils.cleanup(ua);
            fail("Hierarchy still active.");
        }

        ua.confirm();
  }
  catch (NoCoordinatorException ex)
  {
      // why is it ok to get here?
        WSCF11TestUtils.cleanup(ua);
View Full Code Here

TOP

Related Classes of com.arjuna.mw.wscf.model.twophase.api.UserCoordinator

Copyright © 2018 www.massapicom. 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.