Package org.apache.ambari.server.controller.spi

Examples of org.apache.ambari.server.controller.spi.Predicate.evaluate()


    Assert.assertTrue(predicate1.evaluate(resource));

    PredicateBuilder pb2 = new PredicateBuilder();
    Predicate predicate2 = pb2.property(p1).equals(Double.valueOf(99.998)).toPredicate();

    Assert.assertFalse(predicate2.evaluate(resource));
  }

  @Test
  public void testEqualsLong() {
    String p1 = PropertyHelper.getPropertyId("cat1", "prop1");
View Full Code Here


    resource.setProperty(p1, 1L);

    PredicateBuilder pb = new PredicateBuilder();
    Predicate predicate1 = pb.property(p1).equals(1L).toPredicate();

    Assert.assertTrue(predicate1.evaluate(resource));

    PredicateBuilder pb2 = new PredicateBuilder();
    Predicate predicate2 = pb2.property(p1).equals(99L).toPredicate();

    Assert.assertFalse(predicate2.evaluate(resource));
View Full Code Here

    Assert.assertTrue(predicate1.evaluate(resource));

    PredicateBuilder pb2 = new PredicateBuilder();
    Predicate predicate2 = pb2.property(p1).equals(99L).toPredicate();

    Assert.assertFalse(predicate2.evaluate(resource));
  }

  @Test
  public void testGreaterInteger() {
    String p1 = PropertyHelper.getPropertyId("cat1", "prop1");
View Full Code Here

    resource.setProperty(p1, 2);

    PredicateBuilder pb = new PredicateBuilder();
    Predicate predicate1 = pb.property(p1).greaterThan(1).toPredicate();

    Assert.assertTrue(predicate1.evaluate(resource));

    PredicateBuilder pb2 = new PredicateBuilder();
    Predicate predicate2 = pb2.property(p1).greaterThan(99).toPredicate();

    Assert.assertFalse(predicate2.evaluate(resource));
View Full Code Here

    Assert.assertTrue(predicate1.evaluate(resource));

    PredicateBuilder pb2 = new PredicateBuilder();
    Predicate predicate2 = pb2.property(p1).greaterThan(99).toPredicate();

    Assert.assertFalse(predicate2.evaluate(resource));
  }

  @Test
  public void testGreaterFloat() {
    String p1 = PropertyHelper.getPropertyId("cat1", "prop1");
View Full Code Here

    resource.setProperty(p1, (float) 2);

    PredicateBuilder pb = new PredicateBuilder();
    Predicate predicate1 = pb.property(p1).greaterThan((float) 1).toPredicate();

    Assert.assertTrue(predicate1.evaluate(resource));

    PredicateBuilder pb2 = new PredicateBuilder();
    Predicate predicate2 = pb2.property(p1).greaterThan((float) 99).toPredicate();

    Assert.assertFalse(predicate2.evaluate(resource));
View Full Code Here

    Assert.assertTrue(predicate1.evaluate(resource));

    PredicateBuilder pb2 = new PredicateBuilder();
    Predicate predicate2 = pb2.property(p1).greaterThan((float) 99).toPredicate();

    Assert.assertFalse(predicate2.evaluate(resource));
  }

  @Test
  public void testGreaterDouble() {
    String p1 = PropertyHelper.getPropertyId("cat1", "prop1");
View Full Code Here

    resource.setProperty(p1, 2.999);

    PredicateBuilder pb = new PredicateBuilder();
    Predicate predicate1 = pb.property(p1).greaterThan(1.999).toPredicate();

    Assert.assertTrue(predicate1.evaluate(resource));

    PredicateBuilder pb2 = new PredicateBuilder();
    Predicate predicate2 = pb2.property(p1).greaterThan(99.998).toPredicate();

    Assert.assertFalse(predicate2.evaluate(resource));
View Full Code Here

    Assert.assertTrue(predicate1.evaluate(resource));

    PredicateBuilder pb2 = new PredicateBuilder();
    Predicate predicate2 = pb2.property(p1).greaterThan(99.998).toPredicate();

    Assert.assertFalse(predicate2.evaluate(resource));
  }

  @Test
  public void testGreaterLong() {
    String p1 = PropertyHelper.getPropertyId("cat1", "prop1");
View Full Code Here

    resource.setProperty(p1, 2L);

    PredicateBuilder pb = new PredicateBuilder();
    Predicate predicate1 = pb.property(p1).greaterThan(1L).toPredicate();

    Assert.assertTrue(predicate1.evaluate(resource));

    PredicateBuilder pb2 = new PredicateBuilder();
    Predicate predicate2 = pb2.property(p1).greaterThan(99L).toPredicate();

    Assert.assertFalse(predicate2.evaluate(resource));
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.