Package org.ocpsoft.rewrite.mock

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext


   @Test
   public void testAttemptsMatchesParameters()
   {
      Path path = Path.matches("/application/{seg}");

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

      Assert.assertTrue(path.evaluate(rewrite, context));

   }
View Full Code Here


   }

   @Test
   public void testMatchesLiteral()
   {
      Assert.assertTrue(Path.matches("/application/path").evaluate(rewrite, new MockEvaluationContext()));
   }
View Full Code Here

   @Test
   public void testMatchesPattern()
   {
      Path path = Path.matches("/application/{param}");
      MockEvaluationContext context = new MockEvaluationContext();
      ParameterUtils.initialize(context, path);
      Assert.assertTrue(path.evaluate(rewrite, context));
   }
View Full Code Here

   }

   @Test
   public void testDoesNotMatchNonHttpRewrites()
   {
      Assert.assertFalse(Path.matches("/blah").evaluate(new MockRewrite(), new MockEvaluationContext()));
   }
View Full Code Here

   }

   @Test
   public void testDomainMatchesInbound()
   {
      Assert.assertTrue(Domain.matches("example.com").evaluate(inbound, new MockEvaluationContext()));
   }
View Full Code Here

   }

   @Test
   public void testCanConvertAndValidateDomain() throws Exception
   {
      MockEvaluationContext context = new MockEvaluationContext();
      Domain hostname = Domain.matches("{p}.com");

      ParameterUtils.initialize(context, hostname);

      Assert.assertTrue(hostname.evaluate(inbound, context));
View Full Code Here

   }

   @Test
   public void testDomainNotMatchesInbound()
   {
      Assert.assertFalse(Domain.matches("other.com").evaluate(inbound, new MockEvaluationContext()));
   }
View Full Code Here

   }

   @Test
   public void testDomainMatchesOutbound()
   {
      Assert.assertTrue(Domain.matches("example.com").evaluate(outbound, new MockEvaluationContext()));
   }
View Full Code Here

   }

   @Test
   public void testDomainNotMatchesOutbound()
   {
      Assert.assertFalse(Domain.matches("other.com").evaluate(outbound, new MockEvaluationContext()));
   }
View Full Code Here

    }

    @Test
    public void testHeaderAndPath()
    {
        MockEvaluationContext context = new MockEvaluationContext();
        Path path = Path.matches("/application/{seg}");
        ParameterUtils.initialize(context, path);
        Header header = Header.exists("Accept-{charset}");
        ParameterUtils.initialize(context, header);
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.