Examples of MockEvaluationContext


Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   @Test
   @SuppressWarnings("rawtypes")
   public void testEnqueueEvaluationProcessesConversionAndValidation() throws Exception
   {
      MockEvaluationContext context = new MockEvaluationContext();
      Validator validator = new Validator() {
         @Override
         public boolean isValid(Rewrite event, EvaluationContext context, Object value)
         {
            return "baxter III".equals(value);
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

         }
      };

      Parameter<?> parameter = new DefaultParameter("foo").validatedBy(validator).convertedBy(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 testNotFalseIsTrue()
   {
      Condition condition = Not.any(new False());
      Assert.assertTrue(condition.evaluate(new MockRewrite(), new MockEvaluationContext()));
   }
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   @Test
   public void testNotTrueIsFalse()
   {
      Condition condition = Not.any(new True());
      Assert.assertFalse(condition.evaluate(new MockRewrite(), new MockEvaluationContext()));
   }
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   @Before
   public void before()
   {
      event = new MockRewrite();
      context = new MockEvaluationContext();
      context.put(ParameterStore.class, new DefaultParameterStore());
      context.put(ParameterValueStore.class, new DefaultParameterValueStore());
   }
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

public class OrTest
{
   @Test
   public void testTrueAndTrueIsTrue()
   {
      Assert.assertTrue(Or.any(new True(), new True()).evaluate(new MockRewrite(), new MockEvaluationContext()));
   }
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   }

   @Test
   public void testTrueAndFalseIsTrue()
   {
      Assert.assertTrue(Or.any(new True(), new False()).evaluate(new MockRewrite(), new MockEvaluationContext()));
   }
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   }

   @Test
   public void testFalseAndFalseIsFalse()
   {
      Assert.assertFalse(Or.any(new False(), new False()).evaluate(new MockRewrite(), new MockEvaluationContext()));
   }
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   @Before
   public void before()
   {
      rewrite = new MockInboundRewrite();
      context = new MockEvaluationContext();
      operation = new Operation() {
         @Override
         public void perform(final Rewrite event, final EvaluationContext context)
         {
            performCount++;
View Full Code Here

Examples of org.ocpsoft.rewrite.mock.MockEvaluationContext

   @Test
   public void testInboundReturnsTrue()
   {
      Condition condition = Direction.isInbound();
      Assert.assertTrue(condition.evaluate(new MockInboundRewrite(), new MockEvaluationContext()));
   }
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.