Repository: incubator-tamaya-sandbox Updated Branches: refs/heads/configjsr 36faebb63 -> 87cf9c2c4
- Using Iterable instead of List for adding ConfigSources. - Fixed tests compile issues. Signed-off-by: Anatole Tresch <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/commit/87cf9c2c Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/tree/87cf9c2c Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/diff/87cf9c2c Branch: refs/heads/configjsr Commit: 87cf9c2c43638b66a5101eef2c38d0e3ca6a3451 Parents: 36faebb Author: Anatole Tresch <[email protected]> Authored: Tue Feb 20 10:20:15 2018 +0100 Committer: Anatole Tresch <[email protected]> Committed: Tue Feb 20 10:20:15 2018 +0100 ---------------------------------------------------------------------- .../org/apache/tamaya/metamodel/ext/IntegrationTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tamaya-sandbox/blob/87cf9c2c/metamodel/src/test/java/org/apache/tamaya/metamodel/ext/IntegrationTest.java ---------------------------------------------------------------------- diff --git a/metamodel/src/test/java/org/apache/tamaya/metamodel/ext/IntegrationTest.java b/metamodel/src/test/java/org/apache/tamaya/metamodel/ext/IntegrationTest.java index e689139..ad974df 100644 --- a/metamodel/src/test/java/org/apache/tamaya/metamodel/ext/IntegrationTest.java +++ b/metamodel/src/test/java/org/apache/tamaya/metamodel/ext/IntegrationTest.java @@ -31,6 +31,7 @@ import javax.config.ConfigProvider; import javax.config.spi.ConfigSource; import javax.config.spi.Converter; import java.net.URL; +import java.util.Iterator; import java.util.List; import static junit.framework.TestCase.*; @@ -157,8 +158,7 @@ public class IntegrationTest { ConfigContext context = ((ConfigContextSupplier) config).getConfigContext(); assertTrue(context.getConverters().isEmpty()); assertTrue(context.getFilters().isEmpty()); - assertEquals(2, context.getSources().size()); - assertTrue(context.getSources().get(0) instanceof MyConfigSource); + assertTrue(context.getConfigSources().iterator().next() instanceof MyConfigSource); } } @@ -194,7 +194,10 @@ public class IntegrationTest { ConfigContext context = ((ConfigContextSupplier) config).getConfigContext(); assertTrue(context.getConverters().isEmpty()); assertTrue(context.getFilters().isEmpty()); - assertEquals(1, context.getSources().size()); + assertTrue(context.getConfigSources().iterator().hasNext()); + Iterator it = context.getConfigSources().iterator(); + it.next(); + assertFalse(it.hasNext()); } ConfigSource ps = config.getConfigSources().iterator().next(); assertNotNull(ps);
