Examples of UserCoordinator


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)
  {
      WSCF11TestUtils.cleanup(ua);
        throw ex;
View Full Code Here

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

    public void testContextOutput()
            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();

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      org.w3c.dom.Document doc = builder.newDocument();
      org.w3c.dom.Element root = doc.createElement("Context-test");

        // this fails because the documents are different -- need a better test than this
        ((SOAPContext)theContext).serialiseToElement(root) ;
      doc.appendChild(root);

        // this does not do a full recursive conversion to text format -- need a better test than this
        System.out.println(com.arjuna.mw.wscf.utils.DomUtil.nodeAsString(doc));
     
      ua.cancel();
  }
  catch (Exception ex)
  {
        WSCFTestUtils.cleanup(ua);
View Full Code Here

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

    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)
      {
            WSCF11TestUtils.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

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

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
     
      ua.begin();

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

      DeploymentContext manager = DeploymentContextFactory.deploymentContext();
      Context theContext = manager.context();
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      org.w3c.dom.Document doc = builder.newDocument();
      org.w3c.dom.Element root = doc.createElement("Context-test");

        ((SOAPContext)theContext).serialiseToElement(root) ;
      doc.appendChild(root);

      System.out.println(com.arjuna.mw.wscf.utils.DomUtil.nodeAsString(doc));
     
      ua.cancel();

      passed = true;
  }
  catch (Exception ex)
  {
View Full Code Here

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

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
     
      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();

      passed = true;
  }
  catch (Exception ex)
  {
View Full Code Here

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

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
     
      ua.begin();

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

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

      System.out.println(theContext);
     
      ua.cancel();

      passed = true;
  }
  catch (Exception ex)
  {
View Full Code Here

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

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
     
      ua.begin();

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

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

      ua.confirm();
  }
  catch (NoCoordinatorException ex)
  {
      passed = true;
  }
View Full Code Here

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

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
     
      ua.begin();

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

      ua.cancel();

      passed = true;
  }
  catch (Exception ex)
  {
View Full Code Here

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

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
     
      ua.begin();

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

      ua.confirm();

      passed = true;
  }
  catch (Exception ex)
  {
View Full Code Here

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

    {
  boolean passed = false;
 
  try
  {
      UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
     
      ua.begin();

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

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

    ua.cancel();
      }
      else
      {
    System.out.println("Resumed: "+hier+"\n");

    ua.resume(hier);

    ua.cancel();

    passed = true;
      }
  }
  catch (Exception ex)
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.