camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1226371 - /camel/trunk/camel-core/src/test/java/org/apache/camel/language/simple/SimpleParserExpressionInvalidTest.java
Date Mon, 02 Jan 2012 08:54:40 GMT
Author: davsclaus
Date: Mon Jan  2 08:54:40 2012
New Revision: 1226371

URL: http://svn.apache.org/viewvc?rev=1226371&view=rev
Log:
Added test based on user forum issue

Modified:
    camel/trunk/camel-core/src/test/java/org/apache/camel/language/simple/SimpleParserExpressionInvalidTest.java

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/language/simple/SimpleParserExpressionInvalidTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/language/simple/SimpleParserExpressionInvalidTest.java?rev=1226371&r1=1226370&r2=1226371&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/language/simple/SimpleParserExpressionInvalidTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/language/simple/SimpleParserExpressionInvalidTest.java
Mon Jan  2 08:54:40 2012
@@ -64,5 +64,45 @@ public class SimpleParserExpressionInval
             assertEquals(15, e.getIndex());
         }
     }
+    
+    public void testNoEndFunction() throws Exception {
+        SimpleExpressionParser parser = new SimpleExpressionParser("Hello ${body");
+        try {
+            parser.parseExpression();
+            fail("Should thrown exception");
+        } catch (SimpleIllegalSyntaxException e) {
+            assertEquals(11, e.getIndex());
+        }
+    }
+
+    public void testNoStartFunction() throws Exception {
+        SimpleExpressionParser parser = new SimpleExpressionParser("Hello {body}");
+        try {
+            parser.parseExpression();
+            fail("Should thrown exception");
+        } catch (SimpleIllegalSyntaxException e) {
+            assertEquals(11, e.getIndex());
+        }
+    }
+
+    public void testNoStartFunction2() throws Exception {
+        SimpleExpressionParser parser = new SimpleExpressionParser("Hello body}");
+        try {
+            parser.parseExpression();
+            fail("Should thrown exception");
+        } catch (SimpleIllegalSyntaxException e) {
+            assertEquals(10, e.getIndex());
+        }
+    }
+
+    public void testPropertyPlaceholderSyntax() throws Exception {
+        SimpleExpressionParser parser = new SimpleExpressionParser("{{myserver}}/${header.myapp}");
+        try {
+            parser.parseExpression();
+            fail("Should thrown exception");
+        } catch (SimpleIllegalSyntaxException e) {
+            assertEquals(10, e.getIndex());
+        }
+    }
 
 }



Mime
View raw message