From 7785367406e20267812a317721beb266e7011abf Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Sun, 24 Jul 2005 20:09:42 +0000 Subject: [PATCH] Another new boundary tests for VariableFormatterTest.java. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@224650 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/lang/text/VariableFormatterTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/org/apache/commons/lang/text/VariableFormatterTest.java b/src/test/org/apache/commons/lang/text/VariableFormatterTest.java index e4e26cbdd..e653e8b19 100644 --- a/src/test/org/apache/commons/lang/text/VariableFormatterTest.java +++ b/src/test/org/apache/commons/lang/text/VariableFormatterTest.java @@ -32,10 +32,17 @@ import org.apache.commons.lang.text.VariableFormatter.MapVariableResolver; public class VariableFormatterTest extends TestCase { private static final String KEY_ANIMAL = "animal"; + private static final String KEY_TARGET = "target"; + static final String REPLACE_TEMPLATE = "The ${animal} jumps over the ${target}."; + static final String REPLACE_TEMPLATE_NO_ESCAPE = "The {animal} jumps over the {target}."; + + static final String REPLACE_TEMPLATE_NO_MARKERS = "The animal jumps over the target."; + static final String REPLACE_TEMPLATE_NO_PREFIX = "The $animal} jumps over the $target}."; + static final String REPLACE_TEMPLATE_NO_SUFFIX = "The ${animal jumps over the ${target."; private VariableFormatter format; @@ -240,6 +247,13 @@ public class VariableFormatterTest extends TestCase { testReplaceNoElement(REPLACE_TEMPLATE_NO_PREFIX); } + /** + * Tests a replace template with missing prefix strings. + */ + public void testReplaceNoMarkers() { + testReplaceNoElement(REPLACE_TEMPLATE_NO_MARKERS); + } + /** * Tests a replace template with missing postfix strings. */