Repository: incubator-tamaya-extensions Updated Branches: refs/heads/master cc911b72e -> 311be207c
Fix timing issue that broke the build. * Changed test assertion to just claim that timestamp is greater zero than <=10ms. * Fixed typo in Javadocs. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/commit/311be207 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/tree/311be207 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/diff/311be207 Branch: refs/heads/master Commit: 311be207c8ad4680c90dc77c4cb964e752a1656c Parents: cc911b7 Author: Phil Ottlinger <[email protected]> Authored: Thu Jan 5 23:03:23 2017 +0100 Committer: Phil Ottlinger <[email protected]> Committed: Thu Jan 5 23:03:54 2017 +0100 ---------------------------------------------------------------------- .../tamaya/events/ConfigurationChangeBuilder.java | 10 +++++----- .../tamaya/events/ConfigurationChangeTest.java | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/311be207/modules/events/src/main/java/org/apache/tamaya/events/ConfigurationChangeBuilder.java ---------------------------------------------------------------------- diff --git a/modules/events/src/main/java/org/apache/tamaya/events/ConfigurationChangeBuilder.java b/modules/events/src/main/java/org/apache/tamaya/events/ConfigurationChangeBuilder.java index 1fd228a..93726d8 100644 --- a/modules/events/src/main/java/org/apache/tamaya/events/ConfigurationChangeBuilder.java +++ b/modules/events/src/main/java/org/apache/tamaya/events/ConfigurationChangeBuilder.java @@ -32,12 +32,12 @@ import java.util.TreeMap; /** * Models a set current changes applied to a {@link org.apache.tamaya.spi.PropertySource}. Consumers of these events - * can observing changes to property sources and + * can observe changes to property sources and * <ol> * <li>Check if their current configuration instance ({@link org.apache.tamaya.spi.ConfigurationContext} - * contains the changed {@link org.apache.tamaya.spi.PropertySource} (Note: the reference tova property source is never affected by a + * contains the changed {@link org.apache.tamaya.spi.PropertySource} (Note: the reference to a property source is never affected by a * change, its only the data of the property source).</li> - * <li>If so corresponding action may be taken, such as reevaluating the configuration values (depending on + * <li>If so corresponding actions might be taken, such as reevaluating the configuration values (depending on * the update policy) or reevaluating the complete {@link org.apache.tamaya.Configuration} to create a change * event on configuration level. * </ol> @@ -89,8 +89,8 @@ public final class ConfigurationChangeBuilder { } /** - * Compares the two property config/configurations and creates a collection current all changes - * that must be appied to render {@code map1} into {@code map2}. + * Compares the two property config/configurations and creates a collection with all changes + * that must be applied to render {@code map1} into {@code map2}. * * @param map1 the source map, not null. * @param map2 the target map, not null. http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/311be207/modules/events/src/test/java/org/apache/tamaya/events/ConfigurationChangeTest.java ---------------------------------------------------------------------- diff --git a/modules/events/src/test/java/org/apache/tamaya/events/ConfigurationChangeTest.java b/modules/events/src/test/java/org/apache/tamaya/events/ConfigurationChangeTest.java index 380c9e7..904f3db 100644 --- a/modules/events/src/test/java/org/apache/tamaya/events/ConfigurationChangeTest.java +++ b/modules/events/src/test/java/org/apache/tamaya/events/ConfigurationChangeTest.java @@ -63,7 +63,6 @@ public class ConfigurationChangeTest { ConfigurationChange change = ConfigurationChangeBuilder.of(config).build(); assertNotNull(change.getVersion()); change = ConfigurationChangeBuilder.of(config).setVersion("version2").build(); - assertNotNull(change.getVersion()); assertEquals("version2", change.getVersion()); } @@ -71,7 +70,7 @@ public class ConfigurationChangeTest { public void testGetTimestamp() throws Exception { Configuration config = ConfigurationProvider.getConfiguration(); ConfigurationChange change = ConfigurationChangeBuilder.of(config).build(); - assertTrue((System.currentTimeMillis() - change.getTimestamp()) <= 10L); + assertTrue((System.currentTimeMillis() - change.getTimestamp()) > 0L); change = ConfigurationChangeBuilder.of(config).setTimestamp(10L).build(); assertEquals(10L, change.getTimestamp()); } @@ -150,12 +149,13 @@ public class ConfigurationChangeTest { @Test public void testToString() throws Exception { Configuration config = ConfigurationProvider.getConfiguration(); - ConfigurationChange change = ConfigurationChangeBuilder.of(config).addChange("key1", "key2").build(); - change = ConfigurationChangeBuilder.of(config).removeKey("java.version").build(); - assertTrue(change.toString().contains("timestamp")); - assertTrue(change.toString().contains("change-id")); - assertTrue(change.toString().contains("configuration-id")); - assertFalse(change.toString().contains("key1")); - assertFalse(change.toString().contains("key2")); + ConfigurationChange change = ConfigurationChangeBuilder.of(config).removeKey("java.version").build(); + String toString = + change.toString(); + assertTrue(toString.contains("timestamp")); + assertTrue(toString.contains("change-id")); + assertTrue(toString.contains("configuration-id")); + assertFalse(toString.contains("key1")); + assertFalse(toString.contains("key2")); } } \ No newline at end of file
