Package org.ocpsoft.rewrite.mock

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext


   }

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


   }

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

   }

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

   }

   @Test
   public void testDomainNoPath() throws Exception
   {
      Assert.assertFalse(Path.matches("").evaluate(outboundDryDomain, new MockEvaluationContext()));
   }
View Full Code Here

   }

   @Test
   public void testLoneAnchor() throws Exception
   {
      Assert.assertFalse(Path.matches("").evaluate(outboundLoneAnchor, new MockEvaluationContext()));
   }
View Full Code Here

   @Test
   public void testHeaderExists()
   {
      Header header = Header.exists("Accept-{head}");
      MockEvaluationContext context = new MockEvaluationContext();
      ParameterUtils.initialize(context, header);
      Assert.assertTrue(header.evaluate(rewrite, context));
   }
View Full Code Here

   @Test
   public void testHeaderExists2()
   {
      Header header = Header.exists("Content-Length");
      MockEvaluationContext context = new MockEvaluationContext();
      ParameterUtils.initialize(context, header);
      Assert.assertTrue(header.evaluate(rewrite, context));
   }
View Full Code Here

   }

   @Test
   public void testHeaderExistsFalse()
   {
      Assert.assertFalse(Header.exists("Host").evaluate(rewrite, new MockEvaluationContext()));
   }
View Full Code Here

   @Test
   public void testHeaderContains()
   {
      Header header = Header.valueExists("UTF-{enc}");
      MockEvaluationContext context = new MockEvaluationContext();
      ParameterUtils.initialize(context, header);
      Assert.assertTrue(header.evaluate(rewrite, context));
   }
View Full Code Here

   @Test
   public void testHeaderMatches()
   {
      Header header = Header.matches("Accept-Charset", "{enc}");

      MockEvaluationContext context = new MockEvaluationContext();
      ParameterUtils.initialize(context, header);

      ParameterStore parameters = DefaultParameterStore.getInstance(context);
      Parameter<?> parameter = parameters.get("enc");
      if (parameter instanceof ConfigurableParameter<?>)
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.