Package nexj.core.runtime

Examples of nexj.core.runtime.Instance.invoke()


      // Test 1: No exception
      primary.setValue("trace", null);
      primary.setValue("throwUncaughtEx", Boolean.FALSE);
      primary.setValue("throwInnerEx", Boolean.FALSE);
      primary.invoke("goForkTry");
      assignmentList = Query.createRead(assignmentClass, null, Boolean.TRUE, null, -1, 0, false, Query.SEC_NONE, m_context).read();
      assertEquals(1, assignmentList.size());
      primary.invoke("resumeForkTry");
      commit();
      assertTrue("scrStart;scrLeft1;scrLeft2;scrLeft3;scrRight1;scrLeft4;scrRight2;scrRight3;scrInnerFinally;scrOuterFinally;scrFinish;".equals(primary.getValue("trace")) ||
View Full Code Here


      primary.setValue("throwUncaughtEx", Boolean.FALSE);
      primary.setValue("throwInnerEx", Boolean.FALSE);
      primary.invoke("goForkTry");
      assignmentList = Query.createRead(assignmentClass, null, Boolean.TRUE, null, -1, 0, false, Query.SEC_NONE, m_context).read();
      assertEquals(1, assignmentList.size());
      primary.invoke("resumeForkTry");
      commit();
      assertTrue("scrStart;scrLeft1;scrLeft2;scrLeft3;scrRight1;scrLeft4;scrRight2;scrRight3;scrInnerFinally;scrOuterFinally;scrFinish;".equals(primary.getValue("trace")) ||
                 "scrStart;scrLeft1;scrLeft2;scrLeft3;scrLeft4;scrRight1;scrRight2;scrRight3;scrInnerFinally;scrOuterFinally;scrFinish;".equals(primary.getValue("trace")));
      assignmentList = Query.createRead(assignmentClass, null, Boolean.TRUE, null, -1, 0, false, Query.SEC_NONE, m_context).read();
      assertEquals(0, assignmentList.size());
View Full Code Here

      // Test 2: Caught Exception
      primary.setValue("trace", null);
      primary.setValue("throwUncaughtEx", Boolean.FALSE);
      primary.setValue("throwInnerEx", Boolean.TRUE);
      primary.invoke("goForkTry");
      commit();
     
      // If DEBUG log mode, then State gets sorted so that left branch of Fork/Join is preferred. This prevents
      // entry to right branch's Try block. Thus the right hand (inner) Finally may not be executed.
      assertTrue("scrStart;scrLeft1;scrLeft2;scrLeft3;scrRight1;scrLeft4;scrInnerFinally;scrCatch;scrOuterFinally;scrFinish;".equals(primary.getValue("trace")) ||
View Full Code Here

      primary.setValue("throwUncaughtEx", Boolean.TRUE);
      primary.setValue("throwInnerEx", Boolean.FALSE);

      try
      {
         primary.invoke("goForkTry");
         fail("Exception not thrown");
      }
      catch (ScriptingException ex)
      {
        
View Full Code Here

   public void testWorkflowTryFinally() throws Exception
   {
      Metaclass primaryClass = getMetadata().getMetaclass("WorkflowTrace");
      Instance primary = (Instance)primaryClass.invoke("new");

      primary.invoke("go");
      commit();
      assertEquals("THROWBLOCK;END_THROWBLOCK;F_INNER;F_OUTER;", primary.getValue("trace"));


      primary.setValue("throwInnerEx", Boolean.TRUE);
View Full Code Here

      assertEquals("THROWBLOCK;END_THROWBLOCK;F_INNER;F_OUTER;", primary.getValue("trace"));


      primary.setValue("throwInnerEx", Boolean.TRUE);
      primary.setValue("trace", null);
      primary.invoke("go");
      commit();
      assertEquals("THROWBLOCK;CAUGHT_INNER;F_INNER;F_OUTER;", primary.getValue("trace"));


      primary.setValue("throwInnerEx", Boolean.FALSE);
View Full Code Here


      primary.setValue("throwInnerEx", Boolean.FALSE);
      primary.setValue("throwOuterEx", Boolean.TRUE);
      primary.setValue("trace", null);
      primary.invoke("go");
      commit();
      assertEquals("THROWBLOCK;F_INNER;CAUGHT_OUTER;F_OUTER;", primary.getValue("trace"));


      primary.setValue("throwOuterEx", Boolean.FALSE);
View Full Code Here

      primary.setValue("throwUncaughtEx", Boolean.TRUE);
      primary.setValue("trace", null);

      try
      {
         primary.invoke("go");
         fail();
      }
      catch (ScriptingException ex)
      {
         assertEquals("THROWBLOCK;F_INNER;F_OUTER;", primary.getValue("trace"));
View Full Code Here

      // An exception whose handler re-enters a try block
      primary.setValue("throwUncaughtEx", Boolean.FALSE);
      primary.setValue("throwOuterEx", Boolean.FALSE);
      primary.setValue("throwOuter2Ex", Boolean.TRUE);
      primary.setValue("trace", null);
      primary.invoke("go");
      commit();
      assertEquals("THROWBLOCK;F_INNER;CAUGHT_OUTER2;RUNNING_IN_OUTER_TRY;END_IN_OUTER_TRY;F_OUTER;", primary.getValue("trace"));
   }

   /**
 
View Full Code Here

      catch (ScriptingException ex)
      {
         assertEquals(Instance.DELETED, assignment.getState());
         assertEquals(Primitive.createInteger(2), assignment.getValue("status"));
         assertEquals("BEFORE;ASSIGNMENT_CREATE;EXECUTE_SEMAPHORE;ASSIGNMENT_DELETE;", primary.getValue("trace"));
         workflow.invoke("delete");
         commit();
      }
   }

   public void testWorkflowSemaphoresInFork() throws Exception
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.