From 3181b407668fa09b83ff80126b5abdfc4074ab9a Mon Sep 17 00:00:00 2001 From: Benedikt Ritter Date: Fri, 23 Jan 2015 08:10:41 +0000 Subject: [PATCH] Add an additional test for LANG-1055 git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1654135 13f79535-47bb-0310-9956-ffa450edef68 --- src/changes/changes.xml | 1 + .../commons/lang3/text/StrSubstitutorTest.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 9c9f63a95..1476d9b93 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -22,6 +22,7 @@ + StrSubstitutor.replaceSystemProperties does not work consistently Add option to disable the "objectsTriviallyEqual" test in DiffBuilder Add (T) casts to get unit tests to pass in old JDK Add JsonToStringStyle implementation to ToStringStyle diff --git a/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java b/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java index c723d2490..89ee7b4aa 100644 --- a/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java +++ b/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java @@ -589,6 +589,18 @@ public class StrSubstitutorTest { + "directory is ${user.home}.")); } + /** + * Test for LANG-1055: StrSubstitutor.replaceSystemProperties does not work consistently + */ + @Test + public void testLANG1055() { + System.setProperty("test_key", "test_value"); + + String expected = StrSubstitutor.replace("test_key=${test_key}", System.getProperties()); + String actual = StrSubstitutor.replaceSystemProperties("test_key=${test_key}"); + assertEquals(expected, actual); + } + /** * Test the replace of a properties object */