From 16630b35f65bf7ed1adf4d1195952b120e24f2d1 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Sat, 23 Jul 2005 22:27:12 +0000 Subject: [PATCH] Sort methods. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@224562 13f79535-47bb-0310-9956-ffa450edef68 --- .../lang/text/VariableFormatterTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/org/apache/commons/lang/text/VariableFormatterTest.java b/src/test/org/apache/commons/lang/text/VariableFormatterTest.java index 3f04e17d9..e4e26cbdd 100644 --- a/src/test/org/apache/commons/lang/text/VariableFormatterTest.java +++ b/src/test/org/apache/commons/lang/text/VariableFormatterTest.java @@ -31,8 +31,8 @@ import org.apache.commons.lang.text.VariableFormatter.MapVariableResolver; */ public class VariableFormatterTest extends TestCase { - private static final String KEY_TARGET = "target"; 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_PREFIX = "The $animal} jumps over the $target}."; @@ -217,6 +217,15 @@ public class VariableFormatterTest extends TestCase { assertEquals("Variable ${var} is unknown!", this.getFormat().replace("Variable ${var} is unknown!")); } + void testReplaceNoElement(String badReplaceTemplate) { + assertEquals(badReplaceTemplate, this.getFormat().replaceObject(badReplaceTemplate)); + Map map = this.getValueMap(); + map.put(KEY_ANIMAL, "cow"); + map.put(KEY_TARGET, "moon"); + assertEquals("The cow jumps over the moon.", this.getFormat().replace(REPLACE_TEMPLATE)); + assertEquals(badReplaceTemplate, this.getFormat().replaceObject(badReplaceTemplate)); + } + /** * Tests a replace template with missing escape strings. */ @@ -238,15 +247,6 @@ public class VariableFormatterTest extends TestCase { testReplaceNoElement(REPLACE_TEMPLATE_NO_SUFFIX); } - void testReplaceNoElement(String badReplaceTemplate) { - assertEquals(badReplaceTemplate, this.getFormat().replaceObject(badReplaceTemplate)); - Map map = this.getValueMap(); - map.put(KEY_ANIMAL, "cow"); - map.put(KEY_TARGET, "moon"); - assertEquals("The cow jumps over the moon.", this.getFormat().replace(REPLACE_TEMPLATE)); - assertEquals(badReplaceTemplate, this.getFormat().replaceObject(badReplaceTemplate)); - } - /** * Tests source texts with nothing to replace. */