Package org.ocpsoft.rewrite.test

Examples of org.ocpsoft.rewrite.test.MockRewrite


         }
      };

      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);
View Full Code Here


   private Rewrite rewrite;

   @Before
   public void before()
   {
      rewrite = new MockRewrite();
   }
View Full Code Here

         }
      };

      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);
View Full Code Here

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

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

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

   }

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

   }

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

   @Test
   public void testFlattensNestedOrs() throws Exception
   {
      Or or = Or.any(new False(), Or.any(new False(), new True()));
      Assert.assertEquals(3, or.getConditions().size());
      Assert.assertTrue(or.evaluate(new MockRewrite(), null));
      Assert.assertTrue(or.getConditions().get(0) instanceof False);
      Assert.assertTrue(or.getConditions().get(1) instanceof False);
      Assert.assertTrue(or.getConditions().get(2) instanceof True);
   }
View Full Code Here

public class AndTest
{
   @Test
   public void testTrueAndTrueIsTrue()
   {
      Assert.assertTrue(And.all(new True(), new True()).evaluate(new MockRewrite(), null));
   }
View Full Code Here

TOP

Related Classes of org.ocpsoft.rewrite.test.MockRewrite

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.