Another new boundary tests for VariableFormatterTest.java: testReplaceEmptyKeys.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@225152 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2005-07-25 16:43:07 +00:00
parent 7785367406
commit d1f1606960
1 changed files with 15 additions and 1 deletions

View File

@ -37,6 +37,8 @@ public class VariableFormatterTest extends TestCase {
static final String REPLACE_TEMPLATE = "The ${animal} jumps over the ${target}.";
static final String REPLACE_TEMPLATE_EMPTY_KEYS = "The ${} jumps over the ${}.";
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.";
@ -248,12 +250,24 @@ public class VariableFormatterTest extends TestCase {
}
/**
* Tests a replace template with missing prefix strings.
* Tests a replace template with missing marker strings.
*/
public void testReplaceNoMarkers() {
testReplaceNoElement(REPLACE_TEMPLATE_NO_MARKERS);
}
/**
* Tests a replace template with missing empty marker strings.
*/
public void testReplaceEmptyKeys() {
try {
testReplaceNoElement(REPLACE_TEMPLATE_EMPTY_KEYS);
fail("Expected IllegalStateException.");
} catch (IllegalStateException e) {
// expected for now.
}
}
/**
* Tests a replace template with missing postfix strings.
*/