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

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


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

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

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

View Full Code Here


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

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


    propertyId = PropertyHelper.getPropertyId("category1", "fun");
    predicate = new EqualsPredicate<String>(propertyId, "bar");
View Full Code Here


    propertyId = PropertyHelper.getPropertyId("category1", "fun");
    predicate = new EqualsPredicate<String>(propertyId, "bar");

    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 LessPredicate<Integer>(propertyId, 10);

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

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

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

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

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

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

    resource.setProperty(propertyId, 100);
    Assert.assertFalse(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 GreaterEqualsPredicate<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.assertTrue(predicate.evaluate(resource));
  }
View Full Code Here

    resource.setProperty(propertyId, 100);
    Assert.assertTrue(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 LessEqualsPredicate<Integer>(propertyId, 10);

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

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

    resource.setProperty(propertyId, 10);
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.