From 5bb6f9c75d5c6077028eee7a5b9e02a1b7a03b67 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Sat, 16 Aug 2008 01:44:12 +0000 Subject: [PATCH] correcting TODO --- .../spel/TemplateExpressionParsing.java | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/org.springframework.expression/src/test/java/org/springframework/expression/spel/TemplateExpressionParsing.java b/org.springframework.expression/src/test/java/org/springframework/expression/spel/TemplateExpressionParsing.java index 57f24aa026..488e83fa37 100644 --- a/org.springframework.expression/src/test/java/org/springframework/expression/spel/TemplateExpressionParsing.java +++ b/org.springframework.expression/src/test/java/org/springframework/expression/spel/TemplateExpressionParsing.java @@ -27,35 +27,38 @@ public class TemplateExpressionParsing extends ExpressionTestCase { public void testParsingSimpleTemplateExpression01() throws Exception { SpelExpressionParser parser = new SpelExpressionParser(); - Expression expr = parser.parseExpression("hello ${'world'}",DefaultTemplateParserContext.INSTANCE); + Expression expr = parser.parseExpression("hello ${'world'}", DefaultTemplateParserContext.INSTANCE); Object o = expr.getValue(); System.out.println(o); - assertEquals("hello world",o.toString()); + assertEquals("hello world", o.toString()); } public void testParsingSimpleTemplateExpression02() throws Exception { SpelExpressionParser parser = new SpelExpressionParser(); - Expression expr = parser.parseExpression("hello ${'to'} you",DefaultTemplateParserContext.INSTANCE); + Expression expr = parser.parseExpression("hello ${'to'} you", DefaultTemplateParserContext.INSTANCE); Object o = expr.getValue(); System.out.println(o); - assertEquals("hello to you",o.toString()); + assertEquals("hello to you", o.toString()); } public void testParsingSimpleTemplateExpression03() throws Exception { SpelExpressionParser parser = new SpelExpressionParser(); - Expression expr = parser.parseExpression("The quick ${'brown'} fox jumped over the ${'lazy'} dog",DefaultTemplateParserContext.INSTANCE); + Expression expr = parser.parseExpression("The quick ${'brown'} fox jumped over the ${'lazy'} dog", + DefaultTemplateParserContext.INSTANCE); Object o = expr.getValue(); System.out.println(o); - assertEquals("The quick brown fox jumped over the lazy dog",o.toString()); + assertEquals("The quick brown fox jumped over the lazy dog", o.toString()); } - // TODO need to support this case but what is the neatest way? Escapet the clasing delimiters in the expression string? -// public void testParsingTemplateExpressionThatEmbedsTheDelimiters() throws Exception { -// SpelExpressionParser parser = new SpelExpressionParser(); -// Expression expr = parser.parseExpression("The quick ${{'green','brown'}.${true}} fox jumped over the ${'lazy'} dog",DefaultTemplateParserContext.INSTANCE); -// Object o = expr.getValue(); -// System.out.println(o); -// assertEquals("The quick brown fox jumped over the lazy dog",o.toString()); -// } + // TODO need to support this case but what is the neatest way? Escape the clashing delimiters in the expression + // string? + // public void testParsingTemplateExpressionThatEmbedsTheDelimiters() throws Exception { + // SpelExpressionParser parser = new SpelExpressionParser(); + // Expression expr = parser.parseExpression("The quick ${{'green','brown'}.${true}} fox jumped over the ${'lazy'} + // dog",DefaultTemplateParserContext.INSTANCE); + // Object o = expr.getValue(); + // System.out.println(o); + // assertEquals("The quick brown fox jumped over the lazy dog",o.toString()); + // } }