Package com.linkedin.data.it

Examples of com.linkedin.data.it.Predicate


  }

  @Test
  public void testOrAnd()
  {
    final Predicate parsed = PredicateExpressionParser.parse("com.linkedin.data.it.AlwaysTruePredicate | com.linkedin.data.it.AlwaysFalsePredicate & com.linkedin.data.it.AlwaysTruePredicate");
    Assert.assertEquals(parsed.getClass(), OrPredicate.class);

    final List<Predicate> orChildren = ((OrPredicate) parsed).getChildPredicates();
    Assert.assertEquals(orChildren.get(0).getClass(), AlwaysTruePredicate.class);
    Assert.assertEquals(orChildren.get(1).getClass(), AndPredicate.class);
View Full Code Here


  }

  @Test
  public void testAndOrAnd()
  {
    final Predicate parsed = PredicateExpressionParser.parse("com.linkedin.data.it.AlwaysTruePredicate & com.linkedin.data.it.AlwaysFalsePredicate | com.linkedin.data.it.AlwaysFalsePredicate & com.linkedin.data.it.AlwaysTruePredicate");
    Assert.assertEquals(parsed.getClass(), OrPredicate.class);

    final List<Predicate> orChildren = ((OrPredicate) parsed).getChildPredicates();
    Assert.assertEquals(orChildren.get(0).getClass(), AndPredicate.class);
    Assert.assertEquals(orChildren.get(1).getClass(), AndPredicate.class);
View Full Code Here

  }

  @Test
  public void testOrAndOr()
  {
    final Predicate parsed = PredicateExpressionParser.parse("com.linkedin.data.it.AlwaysTruePredicate | com.linkedin.data.it.AlwaysFalsePredicate & com.linkedin.data.it.AlwaysTruePredicate | com.linkedin.data.it.AlwaysFalsePredicate");
    Assert.assertEquals(parsed.getClass(), OrPredicate.class);

    final List<Predicate> orChildren = ((OrPredicate) parsed).getChildPredicates();
    Assert.assertEquals(orChildren.get(0).getClass(), AlwaysTruePredicate.class);
    Assert.assertEquals(orChildren.get(1).getClass(), AndPredicate.class);
    Assert.assertEquals(orChildren.get(2).getClass(), AlwaysFalsePredicate.class);
View Full Code Here

  }

  @Test
  public void testNotAnd()
  {
    final Predicate parsed = PredicateExpressionParser.parse("!com.linkedin.data.it.AlwaysTruePredicate & com.linkedin.data.it.AlwaysFalsePredicate");
    Assert.assertEquals(parsed.getClass(), AndPredicate.class);

    final List<Predicate> andChildren = ((AndPredicate) parsed).getChildPredicates();
    Assert.assertEquals(andChildren.get(0).getClass(), NotPredicate.class);
    Assert.assertEquals(andChildren.get(1).getClass(), AlwaysFalsePredicate.class);

    final Predicate notChild = ((NotPredicate) andChildren.get(0)).getChildPredicate();
    Assert.assertEquals(notChild.getClass(), AlwaysTruePredicate.class);
  }
View Full Code Here

  }

  @Test
  public void testNotNotAnd()
  {
    final Predicate parsed = PredicateExpressionParser.parse("!!com.linkedin.data.it.AlwaysTruePredicate & com.linkedin.data.it.AlwaysFalsePredicate");
    Assert.assertEquals(parsed.getClass(), AndPredicate.class);

    final List<Predicate> andChildren = ((AndPredicate) parsed).getChildPredicates();
    Assert.assertEquals(andChildren.get(0).getClass(), NotPredicate.class);
    Assert.assertEquals(andChildren.get(1).getClass(), AlwaysFalsePredicate.class);

    final Predicate notChild1 = ((NotPredicate) andChildren.get(0)).getChildPredicate();
    Assert.assertEquals(notChild1.getClass(), NotPredicate.class);

    final Predicate notChild2 = ((NotPredicate) notChild1).getChildPredicate();
    Assert.assertEquals(notChild2.getClass(), AlwaysTruePredicate.class);
  }
View Full Code Here

  }

  @Test
  public void testAndNot()
  {
    final Predicate parsed = PredicateExpressionParser.parse("com.linkedin.data.it.AlwaysTruePredicate & !com.linkedin.data.it.AlwaysFalsePredicate");
    Assert.assertEquals(parsed.getClass(), AndPredicate.class);

    final List<Predicate> andChildren = ((AndPredicate) parsed).getChildPredicates();
    Assert.assertEquals(andChildren.get(0).getClass(), AlwaysTruePredicate.class);
    Assert.assertEquals(andChildren.get(1).getClass(), NotPredicate.class);

    final Predicate notChild = ((NotPredicate) andChildren.get(1)).getChildPredicate();
    Assert.assertEquals(notChild.getClass(), AlwaysFalsePredicate.class);
  }
View Full Code Here

  }

  @Test
  public void testNotNotOr()
  {
    final Predicate parsed = PredicateExpressionParser.parse("!!com.linkedin.data.it.AlwaysTruePredicate | com.linkedin.data.it.AlwaysFalsePredicate");
    Assert.assertEquals(parsed.getClass(), OrPredicate.class);

    final List<Predicate> orChildren = ((OrPredicate) parsed).getChildPredicates();
    Assert.assertEquals(orChildren.get(0).getClass(), NotPredicate.class);
    Assert.assertEquals(orChildren.get(1).getClass(), AlwaysFalsePredicate.class);

    final Predicate notChild1 = ((NotPredicate) orChildren.get(0)).getChildPredicate();
    Assert.assertEquals(notChild1.getClass(), NotPredicate.class);

    final Predicate notChild2 = ((NotPredicate) notChild1).getChildPredicate();
    Assert.assertEquals(notChild2.getClass(), AlwaysTruePredicate.class);
  }
View Full Code Here

  }

  @Test
  public void testOrNot()
  {
    final Predicate parsed = PredicateExpressionParser.parse("com.linkedin.data.it.AlwaysTruePredicate | !com.linkedin.data.it.AlwaysFalsePredicate");
    Assert.assertEquals(parsed.getClass(), OrPredicate.class);

    final List<Predicate> orChildren = ((OrPredicate) parsed).getChildPredicates();
    Assert.assertEquals(orChildren.get(0).getClass(), AlwaysTruePredicate.class);
    Assert.assertEquals(orChildren.get(1).getClass(), NotPredicate.class);

    final Predicate notChild = ((NotPredicate) orChildren.get(1)).getChildPredicate();
    Assert.assertEquals(notChild.getClass(), AlwaysFalsePredicate.class);
  }
View Full Code Here

  }

  @Test
  public void testParen()
  {
    final Predicate parsed = PredicateExpressionParser.parse("(com.linkedin.data.it.AlwaysTruePredicate)");
    Assert.assertEquals(parsed.getClass(), AlwaysTruePredicate.class);
  }
View Full Code Here

  }

  @Test
  public void testDoubleParen()
  {
    final Predicate parsed = PredicateExpressionParser.parse("((com.linkedin.data.it.AlwaysTruePredicate))");
    Assert.assertEquals(parsed.getClass(), AlwaysTruePredicate.class);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.data.it.Predicate

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.