Package nexj.core.runtime

Examples of nexj.core.runtime.InvocationContext


      assertEquals("User", changeRequest.getMetaclass().getName());
   }

   public void testDynamicRestrictedReadRequest() throws MarshallerException, IOException
   {
      XMLUnmarshaller unmarshaller = new XMLUnmarshaller(new InvocationContext(Repository.getMetadata()));
      SchemeParser parser = new SchemeParser(new InvocationContext(Repository.getMetadata())
         .getMachine().getGlobalEnvironment());
      StringReader reader = new StringReader("<User-Read-Request xmlns=\"" + XML.NS_URI_TNS + "\"><class>User-test</class>"
         + "<attributes>(fullName)</attributes><where></where><orderBy></orderBy><count>8</count>"
         + "<offset>0</offset></User-Read-Request>");
      XMLReadRequest readRequest = (XMLReadRequest)unmarshaller.deserialize(reader);
View Full Code Here


      metaclass.addEvent(publicEv);
      metaclass.addEvent(staticEv);
      metadata.addMetaclass(metaclass);

      // test protected event
      XMLUnmarshaller unmarshaller = new XMLUnmarshaller(new InvocationContext(metadata));
      String sElement = XSDGenerator.computeElementName(protectedEv);
      StringReader reader = new StringReader(
         "<" + sElement + " xmlns='" + XML.NS_URI_TNS + '/' + metaclass.getName() + "'/>");

      try
View Full Code Here

      StringWriter writer = new StringWriter();

      try
      {
         new XMLMarshaller(new InvocationContext(Repository.getMetadata())).serialize(pair, writer);
         fail("Expected exception: err.rpc.xml.circularReference");
      }
      catch (IOException e)
      {
         assertTrue(e.getCause() instanceof SOAPMarshallerException);
View Full Code Here

      return MatchNode.parse(m_parser.parse(expression));
   }

   public void testEvaluation()
   {
      InvocationContext context = new InvocationContext(Repository.getMetadata());
      MatchOperator op = new MatchOperator(context);
      Metaclass metaclass = context.getMetadata().getMetaclass("Contact");
      AttributeOperator attribOp = new AttributeOperator(
         new Field(new Query(metaclass, context), metaclass.getAttribute("firstName")));

      context.setLocale(Locale.ENGLISH);
      op.setAttribute(attribOp);
      attribOp.setConstant(true);
      attribOp.setValue("a abc def ghi");

      op.setExpression(parse("a and b"));
View Full Code Here

    */
   protected void setUp() throws Exception
   {
      super.setUp();

      m_marshaller = new JSONMarshaller(new InvocationContext(Repository.getMetadata()));
      m_unmarshaller = new JSONUnmarshaller(new InvocationContext(Repository.getMetadata()));
   }
View Full Code Here

   }

   public void testSchemeExpression() throws UnmarshallerException, IOException
   {
      m_unmarshaller = new JSONUnmarshaller(new InvocationContext(Repository.getMetadata()));

      Pair pair = (Pair) m_unmarshaller.deserialize(new StringReader("{\":expression\":\"(firstName lastName fullName \\\"loginName\\\" )\"}"));
      assertEquals(Pair.list(Symbol.define("firstName"), Symbol.define("lastName"), Symbol.define("fullName") , "loginName"), pair);
   }
View Full Code Here

    * @see TestCase#setUp()
    */
   protected void setUp() throws Exception
   {
      super.setUp();
      m_marshaller = new TextMarshaller(new InvocationContext(Repository.getMetadata()));
      m_unmarshaller = new TextUnmarshaller(new InvocationContext(Repository.getMetadata()));
   }
View Full Code Here

    * @see nexj.core.rpc.text.TextMarshallerTest#setUp()
    */
   protected void setUp() throws Exception
   {
      super.setUp();
      m_marshaller = new RefTextMarshaller(new InvocationContext(Repository.getMetadata()));
   }
View Full Code Here

    * @see TestCase#setUp()
    */
   protected void setUp() throws Exception
   {
      super.setUp();
      m_context = new InvocationContext(Repository.getMetadata());
      m_context.setSecure(false);
      ThreadContextHolder.setContext(m_context);
   }
View Full Code Here

   /*
    * Test for Object getInstance(InvocationContext)
    */
   public void testGetInstanceInvocationContext()
   {
      InvocationContext context = new InvocationContext(Repository.getMetadata());
      TestComponent inst = (TestComponent)m_comp.getInstance(context);
     
      assertNotNull(inst);
      assertSame(context, inst.getInvocationContext());
      assertEquals(1, inst.getInitializationCount());
View Full Code Here

TOP

Related Classes of nexj.core.runtime.InvocationContext

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.