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

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


    resource.setProperty(propertyId, 1);
    Assert.assertTrue(predicate.evaluate(resource));

    resource.setProperty(propertyId, 100);
    Assert.assertFalse(predicate.evaluate(resource));

    resource.setProperty(propertyId, 10);
    Assert.assertTrue(predicate.evaluate(resource));
  }
View Full Code Here


    resource.setProperty(propertyId, 100);
    Assert.assertFalse(predicate.evaluate(resource));

    resource.setProperty(propertyId, 10);
    Assert.assertTrue(predicate.evaluate(resource));
  }

  @Test
  public void testGetProperties() {
    String propertyId = PropertyHelper.getPropertyId("category1", "foo");
View Full Code Here

    Resource resource = new ResourceImpl(Resource.Type.HostComponent);
    String propertyId = PropertyHelper.getPropertyId("category1", "foo");
    Predicate predicate = new GreaterPredicate<Integer>(propertyId, 10);

    resource.setProperty(propertyId, 1);
    Assert.assertFalse(predicate.evaluate(resource));

    resource.setProperty(propertyId, 100);
    Assert.assertTrue(predicate.evaluate(resource));

    resource.setProperty(propertyId, 10);
View Full Code Here

    resource.setProperty(propertyId, 1);
    Assert.assertFalse(predicate.evaluate(resource));

    resource.setProperty(propertyId, 100);
    Assert.assertTrue(predicate.evaluate(resource));

    resource.setProperty(propertyId, 10);
    Assert.assertFalse(predicate.evaluate(resource));
  }
View Full Code Here

    resource.setProperty(propertyId, 100);
    Assert.assertTrue(predicate.evaluate(resource));

    resource.setProperty(propertyId, 10);
    Assert.assertFalse(predicate.evaluate(resource));
  }

  @Test
  public void testGetProperties() {
    String propertyId = PropertyHelper.getPropertyId("category1", "foo");
View Full Code Here

    Resource resource = new ResourceImpl(Resource.Type.HostComponent);
    String propertyId = PropertyHelper.getPropertyId("category1", "foo");
    Predicate predicate = new GreaterPredicate<Integer>(propertyId, 10);

    resource.setProperty(propertyId, 1);
    Assert.assertFalse(predicate.evaluate(resource));

    resource.setProperty(propertyId, 100);
    Assert.assertTrue(predicate.evaluate(resource));

    resource.setProperty(propertyId, 10);
View Full Code Here

    resource.setProperty(propertyId, 1);
    Assert.assertFalse(predicate.evaluate(resource));

    resource.setProperty(propertyId, 100);
    Assert.assertTrue(predicate.evaluate(resource));

    resource.setProperty(propertyId, 10);
    Assert.assertFalse(predicate.evaluate(resource));
  }
View Full Code Here

    resource.setProperty(propertyId, 100);
    Assert.assertTrue(predicate.evaluate(resource));

    resource.setProperty(propertyId, 10);
    Assert.assertFalse(predicate.evaluate(resource));
  }

  @Test
  public void testNullValue() {
    try {
View Full Code Here

    Resource resource = new ResourceImpl(Resource.Type.HostComponent);
    String propertyId = PropertyHelper.getPropertyId("category1", "foo");
    Predicate predicate = new GreaterPredicate<Double>(propertyId, 0.1);

    resource.setProperty(propertyId, 1.3);
    Assert.assertTrue(predicate.evaluate(resource));

    resource.setProperty(propertyId, 0.06);
    Assert.assertFalse(predicate.evaluate(resource));

    resource.setProperty(propertyId, 100.3);
View Full Code Here

    resource.setProperty(propertyId, 1.3);
    Assert.assertTrue(predicate.evaluate(resource));

    resource.setProperty(propertyId, 0.06);
    Assert.assertFalse(predicate.evaluate(resource));

    resource.setProperty(propertyId, 100.3);
    Assert.assertTrue(predicate.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.