Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 56416200D30 for ; Mon, 30 Oct 2017 22:17:19 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 54C96160BE4; Mon, 30 Oct 2017 21:17:19 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9ADFD1609D5 for ; Mon, 30 Oct 2017 22:17:18 +0100 (CET) Received: (qmail 48196 invoked by uid 500); 30 Oct 2017 21:17:17 -0000 Mailing-List: contact commits-help@tamaya.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tamaya.incubator.apache.org Delivered-To: mailing list commits@tamaya.incubator.apache.org Received: (qmail 48187 invoked by uid 99); 30 Oct 2017 21:17:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Oct 2017 21:17:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 009871A2C6F for ; Mon, 30 Oct 2017 21:17:17 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.222 X-Spam-Level: X-Spam-Status: No, score=-4.222 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 4KRAym2F4z7a for ; Mon, 30 Oct 2017 21:17:15 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 0D70C5FB4E for ; Mon, 30 Oct 2017 21:17:14 +0000 (UTC) Received: (qmail 48179 invoked by uid 99); 30 Oct 2017 21:17:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Oct 2017 21:17:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3FE46DFC2F; Mon, 30 Oct 2017 21:17:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pottlinger@apache.org To: commits@tamaya.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-tamaya git commit: Fix tests Date: Mon, 30 Oct 2017 21:17:14 +0000 (UTC) archived-at: Mon, 30 Oct 2017 21:17:19 -0000 Repository: incubator-tamaya Updated Branches: refs/heads/master 2e44ea50e -> 35f3b45a1 Fix tests and eliminate warnings. Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/35f3b45a Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/35f3b45a Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/35f3b45a Branch: refs/heads/master Commit: 35f3b45a1a6382593ad145f86b3866c30a3b8e25 Parents: 2e44ea5 Author: Phil Ottlinger Authored: Mon Oct 30 22:17:00 2017 +0100 Committer: Phil Ottlinger Committed: Mon Oct 30 22:17:00 2017 +0100 ---------------------------------------------------------------------- .../core/propertysource/CLIPropertySourceTest.java | 14 +++++++------- .../EnvironmentPropertySourceTest.java | 16 +++++++--------- 2 files changed, 14 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/35f3b45a/code/core/src/test/java/org/apache/tamaya/core/propertysource/CLIPropertySourceTest.java ---------------------------------------------------------------------- diff --git a/code/core/src/test/java/org/apache/tamaya/core/propertysource/CLIPropertySourceTest.java b/code/core/src/test/java/org/apache/tamaya/core/propertysource/CLIPropertySourceTest.java index 20126f3..bd6468b 100644 --- a/code/core/src/test/java/org/apache/tamaya/core/propertysource/CLIPropertySourceTest.java +++ b/code/core/src/test/java/org/apache/tamaya/core/propertysource/CLIPropertySourceTest.java @@ -40,19 +40,19 @@ public class CLIPropertySourceTest { assertEquals(ps.getProperties().get("c").getValue(), "c"); CLIPropertySource.initMainArgs("sss"); assertFalse(ps.getProperties().isEmpty()); - assertEquals(ps.getProperties().get("sss").getValue(), "sss"); + assertEquals("sss", ps.getProperties().get("sss").getValue()); CLIPropertySource.initMainArgs("-a", "b", "--c", "sss", "--val=vvv"); assertFalse(ps.getProperties().isEmpty()); - assertEquals(ps.getProperties().get("a").getValue(), "b"); - assertEquals(ps.getProperties().get("c").getValue(), "c"); - assertEquals(ps.getProperties().get("sss").getValue(), "sss"); + assertEquals("b", ps.getProperties().get("a").getValue()); + assertEquals("c", ps.getProperties().get("c").getValue()); + assertEquals("sss", ps.getProperties().get("sss").getValue()); // getProperties() throws Exception { System.setProperty("main.args", "-a b\t--c sss "); ps = new CLIPropertySource(); assertFalse(ps.getProperties().isEmpty()); System.clearProperty("main.args"); - assertEquals(ps.getProperties().get("a").getValue(), "b"); - assertEquals(ps.getProperties().get("c").getValue(), "c"); - assertEquals(ps.getProperties().get("sss").getValue(), "sss"); + assertEquals("b", ps.getProperties().get("a").getValue()); + assertEquals("c", ps.getProperties().get("c").getValue()); + assertEquals("sss", ps.getProperties().get("sss").getValue()); } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/35f3b45a/code/core/src/test/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySourceTest.java ---------------------------------------------------------------------- diff --git a/code/core/src/test/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySourceTest.java b/code/core/src/test/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySourceTest.java index 80c4a65..477ffb2 100644 --- a/code/core/src/test/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySourceTest.java +++ b/code/core/src/test/java/org/apache/tamaya/core/propertysource/EnvironmentPropertySourceTest.java @@ -107,12 +107,13 @@ public class EnvironmentPropertySourceTest { mock(EnvironmentPropertySource.SystemPropertiesProvider.class); when(provider.getEnvPropsPrefix()).thenReturn("zzz"); - when(provider.getenv()).thenReturn(new HashMap() {{ - put("zzz.A", "aaa"); - put("zzz.B", "bbb"); - put("C", "ccc"); - put("D", "ddd"); - }}); + HashMap configuredValues = new HashMap(); + configuredValues.put("zzz.A", "aaa"); + configuredValues.put("zzz.B", "bbb"); + configuredValues.put("C", "ccc"); + configuredValues.put("D", "ddd"); + + when(provider.getenv()).thenReturn(configuredValues); envPropertySource.setPropertiesProvider(provider); @@ -176,7 +177,4 @@ public class EnvironmentPropertySourceTest { assertThat(envPropertySource.isDisabled()).isTrue(); } - - - } \ No newline at end of file