Examples of MockEvaluationContext


Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   @Test
   public void testSubflowRestoresOriginalFlowState()
   {
      rewrite.setFlow(ServletRewriteFlow.REDIRECT_PERMANENT);

      Flow result = SubflowTask.perform(rewrite, new MockEvaluationContext(), new SubflowTask() {

         @Override
         public void performInSubflow(ServletRewrite<?, ?> event, EvaluationContext context)
         {
            Assert.assertEquals(ServletRewriteFlow.REDIRECT_PERMANENT, rewrite.getFlow());
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   @Test
   public void testSubflowRestoresOriginalFlowStateWithInitializedFlow()
   {
      rewrite.setFlow(ServletRewriteFlow.REDIRECT_PERMANENT);

      Flow result = SubflowTask.perform(rewrite, new MockEvaluationContext(), ServletRewriteFlow.INCLUDE,
               new SubflowTask() {

                  @Override
                  public void performInSubflow(ServletRewrite<?, ?> event, EvaluationContext context)
                  {
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   {
      rewrite.setFlow(ServletRewriteFlow.REDIRECT_PERMANENT);

      Flow result = null;
      try {
         result = SubflowTask.perform(rewrite, new MockEvaluationContext(), new SubflowTask() {

            @Override
            public void performInSubflow(ServletRewrite<?, ?> event, EvaluationContext context)
            {
               Assert.assertEquals(ServletRewriteFlow.REDIRECT_PERMANENT, rewrite.getFlow());
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   {
      rewrite.setFlow(ServletRewriteFlow.REDIRECT_PERMANENT);

      Flow result = null;
      try {
         result = SubflowTask.perform(rewrite, new MockEvaluationContext(), ServletRewriteFlow.INCLUDE,
                  new SubflowTask() {

                     @Override
                     public void performInSubflow(ServletRewrite<?, ?> event, EvaluationContext context)
                     {
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   }

   @Test(expected = IllegalArgumentException.class)
   public void testCannotAccessNonexistentEvaluationContextPropertyInbound() throws Exception
   {
      MockEvaluationContext context = new MockEvaluationContext();
      Evaluation.property("property").retrieve(inbound, context);
   }
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   }

   @Test(expected = IllegalArgumentException.class)
   public void testCannotAccessNonexistentEvaluationContextPropertyOutbound() throws Exception
   {
      MockEvaluationContext context = new MockEvaluationContext();
      Evaluation.property("property").retrieve(outbound, context);
   }
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   }

   @Test
   public void testCanAccessEvaluationContextPropertyInbound() throws Exception
   {
      MockEvaluationContext context = new MockEvaluationContext();
      try {
         Evaluation.property("property").retrieve(inbound, context);
         Assert.fail();
      }
      catch (IllegalArgumentException e) {}
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

         }
      };

      Parameter<?> parameter = new DefaultParameter("foo").configuredBy(validator).configuredBy(converter);

      Object value = parameter.getConverter().convert(new MockRewrite(), new MockEvaluationContext(), new Object());

      @SuppressWarnings("unchecked")
      boolean valid = ((Validator<Object>) parameter.getValidator()).isValid(new MockRewrite(),
               new MockEvaluationContext(), value);

      Assert.assertTrue(validated);
      Assert.assertFalse(valid);
      Assert.assertTrue(converted);
      Assert.assertNull(value);
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   }

   @Test
   public void testCanAccessEvaluationContextPropertyOutbound() throws Exception
   {
      MockEvaluationContext context = new MockEvaluationContext();
      try {
         Evaluation.property("property").retrieve(outbound, context);
         Assert.fail();
      }
      catch (IllegalArgumentException e) {}
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   }

   @Test
   public void testEnqueueSubmissionsExecutesEvaluationEagerly() throws Exception
   {
      MockEvaluationContext context = new MockEvaluationContext();

      DefaultParameter parameter = new DefaultParameter("lincoln");
      Assert.assertTrue(ParameterUtils.enqueueSubmission(rewrite, context,
               parameter.bindsTo(Evaluation.property("lincoln")), "baxter"));
      Assert.assertEquals("baxter", Evaluation.property("lincoln").retrieve(rewrite, context));
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.