Package org.ocpsoft.rewrite.mock

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext


    public void testHeaderAndPathDoNotMatch()
    {
        Assert.assertFalse(
                    Path.matches("/wrong-application/{path}").and(
                                Header.exists("Accept-{charset}")
                                ).evaluate(rewrite, new MockEvaluationContext()));
    }
View Full Code Here


      Mockito.when(request.getContextPath())
               .thenReturn("/context");

      rewrite = new HttpInboundRewriteImpl(request, null, null);
      context = new MockEvaluationContext();
      context.put(ParameterValueStore.class, new DefaultParameterValueStore());
      store = new DefaultParameterStore();
      context.put(ParameterStore.class, store);
   }
View Full Code Here

   }

   @Test
   public void testMethod()
   {
      Assert.assertTrue(Method.isHead().evaluate(rewrite, new MockEvaluationContext()));
   }
View Full Code Here

   }

   @Test
   public void testMethodNegative()
   {
      Assert.assertFalse(Method.isGet().evaluate(rewrite, new MockEvaluationContext()));
   }
View Full Code Here

         {
            return time != null;
         }
      });

      Assert.assertTrue(jodaTime.evaluate(new MockRewrite(), new MockEvaluationContext()));
   }
View Full Code Here

         {
            return false;
         }
      });

      Assert.assertFalse(jodaTime.evaluate(new MockRewrite(), new MockEvaluationContext()));
   }
View Full Code Here

   }

   @Test
   public void testPortMatches()
   {
      Assert.assertTrue(ServerPort.is(8080).evaluate(rewrite, new MockEvaluationContext()));
   }
View Full Code Here

   }

   @Test
   public void testMultiPortMatches()
   {
      Assert.assertTrue(ServerPort.is(8080, 9090).evaluate(rewrite, new MockEvaluationContext()));
   }
View Full Code Here

   }

   @Test
   public void testMultiPortDoesNotMatch()
   {
      Assert.assertFalse(ServerPort.is(9080, 9090).evaluate(rewrite, new MockEvaluationContext()));
   }
View Full Code Here

   }

   @Test(expected = IllegalArgumentException.class)
   public void testOutOfRangePortThrowsException()
   {
      ServerPort.is(0).evaluate(rewrite, new MockEvaluationContext());
   }
View Full Code Here

TOP

Related Classes of org.ocpsoft.rewrite.mock.MockEvaluationContext

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.