Examples of EqualsPredicate


Examples of org.apache.ambari.server.controller.predicate.EqualsPredicate

    assertEquals("OrOperator", new OrOperator(1).getName());
  }

  @Test
  public void testToPredicate() {
    EqualsPredicate p1 = new EqualsPredicate<String>("p1", "one");
    EqualsPredicate p2 = new EqualsPredicate<String>("p2", "two");
    OrPredicate orPRedicate = new OrPredicate(p1, p2);

    assertEquals(orPRedicate, new OrOperator(1).toPredicate(p1, p2));
  }
View Full Code Here

Examples of org.apache.ambari.server.controller.predicate.EqualsPredicate

    assertEquals("NotOperator", new NotOperator(1).getName());
  }

  @Test
  public void testToPredicate() {
    EqualsPredicate p = new EqualsPredicate<String>("prop", "val");
    NotPredicate notPredicate = new NotPredicate(p);

    assertEquals(notPredicate, new NotOperator(1).toPredicate(null, p));
  }
View Full Code Here

Examples of org.apache.ambari.server.controller.predicate.EqualsPredicate

  @Test
  public void testToPredicate() throws Exception {
    String prop = "prop";
    String val = "one,2,three";
    EqualsPredicate p1 = new EqualsPredicate<String>(prop, "one");
    EqualsPredicate p2 = new EqualsPredicate<String>(prop, "2");
    EqualsPredicate p3 = new EqualsPredicate<String>(prop, "three");
    OrPredicate orPredicate = new OrPredicate(p1, p2, p3);

    assertEquals(orPredicate, new InOperator().toPredicate(prop, val));
  }
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.