Examples of PredicateEvaluator


Examples of cascading.pattern.model.tree.decision.PredicateEvaluator

  @Test
  public void testAnd()
    {
    Predicate andPredicate = new AndPredicate( new IsNotMissingPredicate( "var0" ), new EqualsToPredicate( "var1", "value" ) );

    assertTrue( new PredicateEvaluator( expectedFields, andPredicate ).evaluate( tupleEntry ) );
    }
View Full Code Here

Examples of cascading.pattern.model.tree.decision.PredicateEvaluator

  @Test
  public void testOr()
    {
    Predicate orPredicate = new AndPredicate( new IsNotMissingPredicate( "var2" ), new EqualsToPredicate( "var1", "value" ) );

    assertTrue( !new PredicateEvaluator( expectedFields, orPredicate ).evaluate( tupleEntry ) );
    }
View Full Code Here

Examples of cascading.pattern.model.tree.decision.PredicateEvaluator

    {
    Predicate complexPredicate = new AndPredicate(
      new IsNotMissingPredicate( "var0" ),
      new OrPredicate( new EqualsToPredicate( "var1", "value" ), new IsMissingPredicate( "var2" ) ) );

    assertTrue( new PredicateEvaluator( expectedFields, complexPredicate ).evaluate( tupleEntry ) );
    }
View Full Code Here

Examples of cascading.pattern.model.tree.decision.PredicateEvaluator

    Predicate surrogatePredicate = new SurrogatePredicate(
      new EqualsToPredicate( "var2", 0.0d ),
      new EqualsToPredicate( "var2", 0.0d ),
      new TruePredicate() );

    assertTrue( new PredicateEvaluator( expectedFields, surrogatePredicate ).evaluate( tupleEntry ) );
    }
View Full Code Here

Examples of org.apache.sirona.configuration.predicate.PredicateEvaluator

    void init(final @Observes BeforeBeanDiscovery beforeBeanDiscovery) {
        if (!enabled) {
            return;
        }

        performaceEvaluator = new PredicateEvaluator(Configuration.getProperty(Configuration.CONFIG_PROPERTY_PREFIX + "cdi.performance", null), ",");
        jtaEvaluator = new PredicateEvaluator(Configuration.getProperty(Configuration.CONFIG_PROPERTY_PREFIX + "cdi.jta", null), ",");
    }
View Full Code Here

Examples of org.apache.sirona.configuration.predicate.PredicateEvaluator

                && !disabled;
    }

    // @AutoSet
    public void setIncludes(final String includes) {
        this.includes = new PredicateEvaluator(includes, ",");
    }
View Full Code Here

Examples of org.apache.sirona.configuration.predicate.PredicateEvaluator

        this.includes = new PredicateEvaluator(includes, ",");
    }

    // @AutoSet
    public void setExcludes(final String excludes) {
        this.excludes = new PredicateEvaluator(excludes, ",");
    }
View Full Code Here

Examples of org.apache.sirona.configuration.predicate.PredicateEvaluator

        return includes.matches(name) && !excludes.matches(name);
    }

    // @AutoSet should be added to children
    public void setIncludes(final String includes) {
        this.includes = new PredicateEvaluator(includes, ",");
    }
View Full Code Here

Examples of org.apache.sirona.configuration.predicate.PredicateEvaluator

        this.includes = new PredicateEvaluator(includes, ",");
    }

    // @AutoSet should be added to children
    public void setExcludes(final String excludes) {
        this.excludes = new PredicateEvaluator(excludes, ",");
    }
View Full Code Here

Examples of org.apache.sirona.configuration.predicate.PredicateEvaluator

import static org.junit.Assert.assertTrue;

public class PredicateTest {
    @Test
    public void evaluate() {
        final PredicateEvaluator evaluator = new PredicateEvaluator(
            "regex:.+Foo," +
            "regex:Bar.*," +
            "regex:[0-9]+," +
            "prefix:asf," +
            "prefix:sirona," +
            "prefix:!excluded," +
            "suffix:tiger," +
            "suffix:Cat", ",");

        assertTrue(evaluator.matches("AnythingFoo"));
        assertFalse(evaluator.matches("Foo"));
        assertTrue(evaluator.matches("Bar"));
        assertTrue(evaluator.matches("Barcedc"));
        assertFalse(evaluator.matches("azdphdBar"));
        assertFalse(evaluator.matches("fooasf"));
        assertTrue(evaluator.matches("asf"));
        assertFalse(evaluator.matches("excluded"));
        assertTrue(evaluator.matches("asfcdc"));
        assertTrue(evaluator.matches("sironaaaaaaa"));
        assertTrue(evaluator.matches("TomEE the tiger"));
        assertFalse(evaluator.matches("cat"));
        assertTrue(evaluator.matches("Cat"));
        assertTrue(evaluator.matches("1283"));
        assertTrue(evaluator.matches("Ends with Cat"));
    }
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.