@Test(groups="Integration") public void shouldAssertAttributeNever() { entity.sensors().set(TestEntity.NAME, "ever"); EntityAsserts.assertAttributeContinuallyNotEqualTo(ImmutableMap.of("timeout", "5s"), entity, TestEntity.NAME, "after"); }
@Beta @SafeVarargs public static <T> void assertAttributeContinuallyNotEqualTo(final Entity entity, final AttributeSensor<T> attribute, T... disallowed) { final Set<T> reject = Sets.newHashSet(disallowed); Asserts.succeedsContinually(new Runnable() { @Override public void run() { T val = entity.getAttribute(attribute); Asserts.assertFalse(reject.contains(val), "Attribute " + attribute + " on " + entity + " has disallowed value " + val); } }); }
EntityAsserts { @Beta @SafeVarargs public static <T> void assertAttributeContinuallyNotEqualTo(final Entity entity, final AttributeSensor<T> attribute, T... disallowed) { final Set<T> reject = Sets.newHashSet(disallowed); Asserts.succeedsContinually(new Runnable() { @Override public void run() { T val = entity.getAttribute(attribute); Asserts.assertFalse(reject.contains(val), "Attribute " + attribute + " on " + entity + " has disallowed value " + val); } }); } }
EntityAsserts { @Beta @SafeVarargs public static <T> void assertAttributeContinuallyNotEqualTo(final Entity entity, final AttributeSensor<T> attribute, T... disallowed) { final Set<T> reject = Sets.newHashSet(disallowed); Asserts.succeedsContinually(new Runnable() { @Override public void run() { T val = entity.getAttribute(attribute); Asserts.assertFalse(reject.contains(val), "Attribute " + attribute + " on " + entity + " has disallowed value " + val); } }); }  }
EntityAsserts { @Beta @SafeVarargs public static <T> void assertAttributeContinuallyNotEqualTo(final Entity entity, final AttributeSensor<T> attribute, T... disallowed) { final Set<T> reject = Sets.newHashSet(disallowed); Asserts.succeedsContinually(new Runnable() { @Override public void run() { T val = entity.getAttribute(attribute); Asserts.assertFalse(reject.contains(val), "Attribute " + attribute + " on " + entity + " has disallowed value " + val); } }); }  static void assertAttributeEquals(Entity entity, AttributeSensor<T> attribute, T expected); static void assertConfigEquals(Entity entity, ConfigKey<T> configKey, T expected); static void assertAttributeEqualsEventually(final Entity entity, final AttributeSensor<T> attribute, final T expected); static void assertAttributeEqualsEventually(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute, final T expected); static T assertAttributeEventuallyNonNull(final Entity entity, final AttributeSensor<T> attribute); static T assertAttributeEventuallyNonNull(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute); static T assertAttributeEventually(final Entity entity, final AttributeSensor<T> attribute, Predicate<? super T> predicate); static T assertAttributeEventually(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute, final Predicate<? super T> predicate); static T assertAttribute(final Entity entity, final AttributeSensor<T> attribute, final Predicate<? super T> predicate); static void assertPredicateEventuallyTrue(final T entity, final Predicate<? super T> predicate); static void assertPredicateEventuallyTrue(Map<?,?> flags, final T entity, final Predicate<? super T> predicate); static void assertAttributeEqualsContinually(final Entity entity, final AttributeSensor<T> attribute, final T expected); static void assertAttributeEqualsContinually(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute, final T expected); static void assertGroupSizeEqualsEventually(final Group group, int expected); static void assertGroupSizeEqualsEventually(Map<?,?> flags, final Group group, final int expected); static void assertAttributeChangesEventually(final Entity entity, final AttributeSensor<?> attribute); @Beta @SafeVarargs static void assertAttributeContinuallyNotEqualTo(final Entity entity, final AttributeSensor<T> attribute, T... disallowed); @Beta @SafeVarargs static void assertAttributeContinuallyNotEqualTo(final Map<?, ?> flags, final Entity entity, final AttributeSensor<T> attribute, T... disallowed); }
EntityAsserts { @Beta @SafeVarargs public static <T> void assertAttributeContinuallyNotEqualTo(final Entity entity, final AttributeSensor<T> attribute, T... disallowed) { final Set<T> reject = Sets.newHashSet(disallowed); Asserts.succeedsContinually(new Runnable() { @Override public void run() { T val = entity.getAttribute(attribute); Asserts.assertFalse(reject.contains(val), "Attribute " + attribute + " on " + entity + " has disallowed value " + val); } }); }  static void assertAttributeEquals(Entity entity, AttributeSensor<T> attribute, T expected); static void assertConfigEquals(Entity entity, ConfigKey<T> configKey, T expected); static void assertAttributeEqualsEventually(final Entity entity, final AttributeSensor<T> attribute, final T expected); static void assertAttributeEqualsEventually(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute, final T expected); static T assertAttributeEventuallyNonNull(final Entity entity, final AttributeSensor<T> attribute); static T assertAttributeEventuallyNonNull(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute); static T assertAttributeEventually(final Entity entity, final AttributeSensor<T> attribute, Predicate<? super T> predicate); static T assertAttributeEventually(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute, final Predicate<? super T> predicate); static T assertAttribute(final Entity entity, final AttributeSensor<T> attribute, final Predicate<? super T> predicate); static void assertPredicateEventuallyTrue(final T entity, final Predicate<? super T> predicate); static void assertPredicateEventuallyTrue(Map<?,?> flags, final T entity, final Predicate<? super T> predicate); static void assertAttributeEqualsContinually(final Entity entity, final AttributeSensor<T> attribute, final T expected); static void assertAttributeEqualsContinually(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute, final T expected); static void assertGroupSizeEqualsEventually(final Group group, int expected); static void assertGroupSizeEqualsEventually(Map<?,?> flags, final Group group, final int expected); static void assertAttributeChangesEventually(final Entity entity, final AttributeSensor<?> attribute); @Beta @SafeVarargs static void assertAttributeContinuallyNotEqualTo(final Entity entity, final AttributeSensor<T> attribute, T... disallowed); @Beta @SafeVarargs static void assertAttributeContinuallyNotEqualTo(final Map<?, ?> flags, final Entity entity, final AttributeSensor<T> attribute, T... disallowed);  }