diff options
author | Greg Wilkins | 2015-06-19 05:27:47 +0000 |
---|---|---|
committer | Greg Wilkins | 2015-06-19 05:27:47 +0000 |
commit | 13b63c194b010201c439932ece2f1bc628ebf287 (patch) | |
tree | 771c4ae21b48e80864d4e5d4bf0f794aa488c6b6 /jetty-start/src/test | |
parent | b0a3c7c5eafc472d685f86178ca04b173616215e (diff) | |
download | org.eclipse.jetty.project-13b63c194b010201c439932ece2f1bc628ebf287.tar.gz org.eclipse.jetty.project-13b63c194b010201c439932ece2f1bc628ebf287.tar.xz org.eclipse.jetty.project-13b63c194b010201c439932ece2f1bc628ebf287.zip |
Default values for properties in ini files
While this feature is not strictly needed, the patch contains some good code cleanups. So it will be applied and then the default feature
removed in a subsequent commit.
Diffstat (limited to 'jetty-start/src/test')
-rw-r--r-- | jetty-start/src/test/java/org/eclipse/jetty/start/PropsTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/PropsTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/PropsTest.java index f7c9ee1039..0151f3b61a 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/PropsTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/PropsTest.java @@ -98,6 +98,19 @@ public class PropsTest } @Test + public void testSimpleExpandWithDefaults() + { + Props props = new Props(); + props.setProperty("name","jetty",FROM_TEST); + props.setProperty("version","9.1",FROM_TEST); + + assertThat(props.expand("port=8080"),is("port=8080")); + assertThat(props.expand("jdk=${java.version:=WRONG}"),is("jdk=" + System.getProperty("java.version"))); + assertThat(props.expand("id=${name:=WRONG}-${version:=WRONG}"),is("id=jetty-9.1")); + assertThat(props.expand("id=${unknown:=UNKNOWN}-${wibble}"),is("id=UNKNOWN-${wibble}")); + } + + @Test public void testNoExpandDoubleDollar() { Props props = new Props(); |