camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r930255 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/builder/ camel-core/src/main/java/org/apache/camel/component/properties/ camel-core/src/main/java/org/apache/camel/impl/ camel-c...
Date Fri, 02 Apr 2010 12:33:56 GMT
Author: davsclaus
Date: Fri Apr  2 12:33:55 2010
New Revision: 930255

URL: http://svn.apache.org/viewvc?rev=930255&view=rev
Log:
CAMEL-2599: Changed Camel properties token to avoid clash with Spring EL in Spring 3.0

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesParser.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentDefaultTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEndpointTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentRegistryTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesResolverTest.java
    camel/trunk/camel-core/src/test/resources/org/apache/camel/component/properties/myproperties.properties
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringBuilderRefPropertiesTest.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringPackagePropertiesTest.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringPackageScanPropertiesTest.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/route/SpringSimpleRoute.java
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringBuilderRefPropertiesTest.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPackagePropertiesTest.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPackageScanPropertiesTest.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponent2Test.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponent3Test.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponentTest.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolver2Test.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolver3Test.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolverTest.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/jmxConfigUsingProperties.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceUsingPropertyTest-context.xml

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java Fri Apr  2 12:33:55
2010
@@ -444,7 +444,7 @@ public interface CamelContext extends Se
     Language resolveLanguage(String language);
 
     /**
-     * Parses the given text and resolve any property placeholders - using #{key}.
+     * Parses the given text and resolve any property placeholders - using {{key}}.
      *
      * @param text the text such as an endpoint uri or the likes
      * @return the text with resolved property placeholders

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java Fri
Apr  2 12:33:55 2010
@@ -1313,9 +1313,9 @@ public final class ExpressionBuilder {
                         Component component = exchange.getContext().getComponent("properties");
                         PropertiesComponent pc = exchange.getContext().getTypeConverter()
                                 .mandatoryConvertTo(PropertiesComponent.class, component);
-                        // enclose key with #{ } to force parsing
+                        // enclose key with {{ }} to force parsing
                         String[] paths = locations.split(",");
-                        return pc.parseUri("#{" + key + "}", paths);
+                        return pc.parseUri(PropertiesComponent.PREFIX_TOKEN + key + PropertiesComponent.SUFFIX_TOKEN,
paths);
                     } else {
                         // the properties component is mandatory if no locations provided
                         Component component = exchange.getContext().hasComponent("properties");
@@ -1325,8 +1325,8 @@ public final class ExpressionBuilder {
                         }
                         PropertiesComponent pc = exchange.getContext().getTypeConverter()
                                 .mandatoryConvertTo(PropertiesComponent.class, component);
-                        // enclose key with #{ } to force parsing
-                        return pc.parseUri("#{" + key + "}");
+                        // enclose key with {{ }} to force parsing
+                        return pc.parseUri(PropertiesComponent.PREFIX_TOKEN + key + PropertiesComponent.SUFFIX_TOKEN);
                     }
                 } catch (Exception e) {
                     throw ObjectHelper.wrapRuntimeCamelException(e);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
Fri Apr  2 12:33:55 2010
@@ -33,6 +33,9 @@ import org.apache.commons.logging.LogFac
  */
 public class PropertiesComponent extends DefaultComponent {
 
+    public static final String PREFIX_TOKEN = "{{";
+    public static final String SUFFIX_TOKEN = "}}";
+
     private static final transient Log LOG = LogFactory.getLog(PropertiesComponent.class);
     private final Map<String[], Properties> cacheMap = new LRUCache<String[], Properties>(1000);
     private PropertiesResolver propertiesResolver = new DefaultPropertiesResolver();
@@ -75,10 +78,18 @@ public class PropertiesComponent extends
             }
         }
 
+        // enclose tokens if missing
+        if (!uri.contains(PREFIX_TOKEN) && !uri.startsWith(PREFIX_TOKEN)) {
+            uri = PREFIX_TOKEN + uri;
+        }
+        if (!uri.contains(SUFFIX_TOKEN) && !uri.endsWith(SUFFIX_TOKEN)) {
+            uri = uri + SUFFIX_TOKEN;
+        }
+
         if (LOG.isTraceEnabled()) {
             LOG.trace("Parsing uri " + uri + " with properties: " + prop);
         }
-        return PropertiesParser.parseUri(uri, prop);
+        return PropertiesParser.parseUri(uri, prop, PREFIX_TOKEN, SUFFIX_TOKEN);
     }
 
     public String[] getLocations() {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesParser.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesParser.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesParser.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesParser.java
Fri Apr  2 12:33:55 2010
@@ -27,9 +27,6 @@ import java.util.Properties;
  */
 public final class PropertiesParser {
 
-    private static final String PREFIX_TOKEN = "#{";
-    private static final String SUFFIX_TOKEN = "}";
-
     private PropertiesParser() {
     }
 
@@ -38,10 +35,12 @@ public final class PropertiesParser {
      *
      * @param uri the uri
      * @param properties the properties
+     * @param prefixToken the prefix token
+     * @param suffixToken the suffix token
      * @return the uri with replaced placeholders
      * @throws IllegalArgumentException if uri syntax is not valid or a property is not found
      */
-    public static String parseUri(String uri, Properties properties) throws IllegalArgumentException
{
+    public static String parseUri(String uri, Properties properties, String prefixToken,
String suffixToken) throws IllegalArgumentException {
         String answer = uri;
         boolean done = false;
 
@@ -50,7 +49,7 @@ public final class PropertiesParser {
         List<String> visited = new ArrayList<String>();
         while (!done) {
             List<String> replaced = new ArrayList<String>();
-            answer = doParseUri(answer, properties, replaced);
+            answer = doParseUri(answer, properties, replaced, prefixToken, suffixToken);
 
             // check the replaced with the visited to avoid circular reference
             for (String replace : replaced) {
@@ -62,18 +61,18 @@ public final class PropertiesParser {
             visited.addAll(replaced);
 
             // are we done yet
-            done = !answer.contains(PREFIX_TOKEN);
+            done = !answer.contains(prefixToken);
         }
         return answer;
     }
 
-    private static String doParseUri(String uri, Properties properties, List<String>
replaced) {
+    private static String doParseUri(String uri, Properties properties, List<String>
replaced, String prefixToken, String suffixToken) {
         StringBuilder sb = new StringBuilder();
 
         int pivot = 0;
         int size = uri.length();
         while (pivot < size) {
-            int idx = uri.indexOf(PREFIX_TOKEN, pivot);
+            int idx = uri.indexOf(prefixToken, pivot);
             if (idx < 0) {
                 sb.append(createConstantPart(uri, pivot, size));
                 break;
@@ -81,10 +80,10 @@ public final class PropertiesParser {
                 if (pivot < idx) {
                     sb.append(createConstantPart(uri, pivot, idx));
                 }
-                pivot = idx + PREFIX_TOKEN.length();
-                int endIdx = uri.indexOf(SUFFIX_TOKEN, pivot);
+                pivot = idx + prefixToken.length();
+                int endIdx = uri.indexOf(suffixToken, pivot);
                 if (endIdx < 0) {
-                    throw new IllegalArgumentException("Expecting " + SUFFIX_TOKEN + " but
found end of string for uri: " + uri);
+                    throw new IllegalArgumentException("Expecting " + suffixToken + " but
found end of string for uri: " + uri);
                 }
                 String key = uri.substring(pivot, endIdx);
 
@@ -93,7 +92,7 @@ public final class PropertiesParser {
                     throw new IllegalArgumentException("Property with key [" + key + "] not
found in properties for uri: " + uri);
                 }
                 sb.append(part);
-                pivot = endIdx + SUFFIX_TOKEN.length();
+                pivot = endIdx + suffixToken.length();
             }
         }
         return sb.toString();

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Fri
Apr  2 12:33:55 2010
@@ -727,7 +727,7 @@ public class DefaultCamelContext extends
 
     public String resolvePropertyPlaceholders(String uri) throws Exception {
         // do not parse uris that are designated for the properties component as it will
handle that itself
-        if (uri != null && !uri.startsWith("properties:") && uri.contains("#{"))
{
+        if (uri != null && !uri.startsWith("properties:") && uri.contains(PropertiesComponent.PREFIX_TOKEN))
{
             // the uri contains property placeholders so lookup mandatory properties component
and let it parse it
             Component component = hasComponent("properties");
             if (component == null) {

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentDefaultTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentDefaultTest.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentDefaultTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentDefaultTest.java
Fri Apr  2 12:33:55 2010
@@ -32,7 +32,7 @@ public class PropertiesComponentDefaultT
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:#{bar.end}?locations=org/apache/camel/component/properties/bar.properties");
+                from("direct:start").to("properties:bar.end?locations=org/apache/camel/component/properties/bar.properties");
             }
         });
         context.start();
@@ -48,7 +48,7 @@ public class PropertiesComponentDefaultT
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:#{bar.end}?locations=org/apache/camel/component/properties/unknown.properties");
+                from("direct:start").to("properties:bar.end?locations=org/apache/camel/component/properties/unknown.properties");
             }
         });
         try {

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEndpointTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEndpointTest.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEndpointTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEndpointTest.java
Fri Apr  2 12:33:55 2010
@@ -36,7 +36,7 @@ public class PropertiesComponentEndpoint
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("mock:#{cool.result}");
+                from("direct:start").to("mock:{{cool.result}}");
             }
         });
         context.start();
@@ -52,16 +52,16 @@ public class PropertiesComponentEndpoint
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("#{cool.start}")
-                    .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
-                    .to("mock:#{cool.result}");
+                from("{{cool.start}}")
+                    .to("log:{{cool.start}}?showBodyType=false&showExchangeId={{cool.showid}}")
+                    .to("mock:{{cool.result}}");
             }
         });
         context.start();
 
-        getMockEndpoint("mock:#{cool.result}").expectedMessageCount(1);
+        getMockEndpoint("mock:{{cool.result}}").expectedMessageCount(1);
 
-        template.sendBody("#{cool.start}", "Hello World");
+        template.sendBody("{{cool.start}}", "Hello World");
 
         assertMockEndpointsSatisfied();
     }
@@ -72,9 +72,9 @@ public class PropertiesComponentEndpoint
             context.addRoutes(new RouteBuilder() {
                 @Override
                 public void configure() throws Exception {
-                    from("#{cool.start}")
-                        .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
-                        .to("mock:#{cool.result}");
+                    from("{{cool.start}}")
+                        .to("log:{{cool.start}}?showBodyType=false&showExchangeId={{cool.showid}}")
+                        .to("mock:{{cool.result}}");
                 }
             });
             context.start();

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentRegistryTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentRegistryTest.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentRegistryTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentRegistryTest.java
Fri Apr  2 12:33:55 2010
@@ -70,30 +70,30 @@ public class PropertiesComponentRegistry
     public void testPropertiesComponentRegistryLookupName() throws Exception {
         context.start();
 
-        assertSame(foo, context.getRegistry().lookup("#{bean.foo}"));
-        assertSame(bar, context.getRegistry().lookup("#{bean.bar}"));
+        assertSame(foo, context.getRegistry().lookup("{{bean.foo}}"));
+        assertSame(bar, context.getRegistry().lookup("{{bean.bar}}"));
 
         try {
-            context.getRegistry().lookup("#{bean.unknown}");
+            context.getRegistry().lookup("{{bean.unknown}}");
             fail("Should have thrown exception");
         } catch (RuntimeCamelException e) {
             IllegalArgumentException cause = assertIsInstanceOf(IllegalArgumentException.class,
e.getCause());
-            assertEquals("Property with key [bean.unknown] not found in properties for uri:
#{bean.unknown}", cause.getMessage());
+            assertEquals("Property with key [bean.unknown] not found in properties for uri:
{{bean.unknown}}", cause.getMessage());
         }
     }
 
     public void testPropertiesComponentRegistryLookupNameAndType() throws Exception {
         context.start();
 
-        assertSame(foo, context.getRegistry().lookup("#{bean.foo}", MyFooBean.class));
-        assertSame(bar, context.getRegistry().lookup("#{bean.bar}", MyDummyBean.class));
+        assertSame(foo, context.getRegistry().lookup("{{bean.foo}}", MyFooBean.class));
+        assertSame(bar, context.getRegistry().lookup("{{bean.bar}}", MyDummyBean.class));
 
         try {
-            context.getRegistry().lookup("#{bean.unknown}", MyDummyBean.class);
+            context.getRegistry().lookup("{{bean.unknown}}", MyDummyBean.class);
             fail("Should have thrown exception");
         } catch (RuntimeCamelException e) {
             IllegalArgumentException cause = assertIsInstanceOf(IllegalArgumentException.class,
e.getCause());
-            assertEquals("Property with key [bean.unknown] not found in properties for uri:
#{bean.unknown}", cause.getMessage());
+            assertEquals("Property with key [bean.unknown] not found in properties for uri:
{{bean.unknown}}", cause.getMessage());
         }
     }
 

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentTest.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentTest.java
Fri Apr  2 12:33:55 2010
@@ -36,7 +36,7 @@ public class PropertiesComponentTest ext
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:#{cool.end}");
+                from("direct:start").to("properties:{{cool.end}}");
             }
         });
         context.start();
@@ -52,7 +52,7 @@ public class PropertiesComponentTest ext
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:mock:#{cool.result}");
+                from("direct:start").to("properties:mock:{{cool.result}}");
             }
         });
         context.start();
@@ -68,7 +68,7 @@ public class PropertiesComponentTest ext
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:#{cool.mock}:#{cool.mock}");
+                from("direct:start").to("properties:{{cool.mock}}:{{cool.mock}}");
             }
         });
         context.start();
@@ -84,7 +84,7 @@ public class PropertiesComponentTest ext
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:#{cool.concat}");
+                from("direct:start").to("properties:cool.concat");
             }
         });
         context.start();
@@ -100,7 +100,7 @@ public class PropertiesComponentTest ext
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:#{bar.end}?locations=org/apache/camel/component/properties/bar.properties");
+                from("direct:start").to("properties:{{bar.end}}?locations=org/apache/camel/component/properties/bar.properties");
             }
         });
         context.start();
@@ -116,8 +116,8 @@ public class PropertiesComponentTest ext
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:#{bar.end}?locations=org/apache/camel/component/properties/bar.properties");
-                from("direct:cheese").to("properties:#{cheese.end}?locations=org/apache/camel/component/properties/bar.properties,"
+                from("direct:start").to("properties:bar.end?locations=org/apache/camel/component/properties/bar.properties");
+                from("direct:cheese").to("properties:cheese.end?locations=org/apache/camel/component/properties/bar.properties,"
                         + "classpath:org/apache/camel/component/properties/cheese.properties");
             }
         });
@@ -136,7 +136,7 @@ public class PropertiesComponentTest ext
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:#{foo.unknown}");
+                from("direct:start").to("properties:{{foo.unknown}}");
             }
         });
         try {
@@ -145,7 +145,7 @@ public class PropertiesComponentTest ext
         } catch (FailedToCreateRouteException e) {
             ResolveEndpointFailedException cause = assertIsInstanceOf(ResolveEndpointFailedException.class,
e.getCause());
             IllegalArgumentException iae = assertIsInstanceOf(IllegalArgumentException.class,
cause.getCause());
-            assertEquals("Property with key [foo.unknown] not found in properties for uri:
#{foo.unknown}", iae.getMessage());
+            assertEquals("Property with key [foo.unknown] not found in properties for uri:
{{foo.unknown}}", iae.getMessage());
         }
     }
 
@@ -153,7 +153,7 @@ public class PropertiesComponentTest ext
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:#{cool.a}");
+                from("direct:start").to("properties:cool.a");
             }
         });
         try {
@@ -162,7 +162,7 @@ public class PropertiesComponentTest ext
         } catch (FailedToCreateRouteException e) {
             ResolveEndpointFailedException cause = assertIsInstanceOf(ResolveEndpointFailedException.class,
e.getCause());
             IllegalArgumentException iae = assertIsInstanceOf(IllegalArgumentException.class,
cause.getCause());
-            assertEquals("Circular reference detected with key [cool.a] in uri #{cool.a}",
iae.getMessage());
+            assertEquals("Circular reference detected with key [cool.a] in uri {{cool.a}}",
iae.getMessage());
         }
     }
 
@@ -170,8 +170,9 @@ public class PropertiesComponentTest ext
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:#{cool.end}");
-                from("direct:foo").to("properties:mock:#{cool.result}");
+                // properties component can also have {{ }} around but its not needed
+                from("direct:start").to("properties:{{cool.end}}");
+                from("direct:foo").to("properties:mock:{{cool.result}}");
             }
         });
         context.start();
@@ -191,8 +192,8 @@ public class PropertiesComponentTest ext
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("properties:#{cool.end}");
-                from("direct:foo").to("properties:mock:#{cool.result}");
+                from("direct:start").to("properties:cool.end");
+                from("direct:foo").to("properties:mock:{{cool.result}}");
             }
         });
         context.start();

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesResolverTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesResolverTest.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesResolverTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesResolverTest.java
Fri Apr  2 12:33:55 2010
@@ -43,7 +43,7 @@ public class PropertiesResolverTest exte
                 context.addRoutes(new RouteBuilder() {
                     @Override
                     public void configure() throws Exception {
-                        from("direct:start").to("properties:#{foo}");
+                        from("direct:start").to("properties:foo");
                     }
                 });
             }

Modified: camel/trunk/camel-core/src/test/resources/org/apache/camel/component/properties/myproperties.properties
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/resources/org/apache/camel/component/properties/myproperties.properties?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/resources/org/apache/camel/component/properties/myproperties.properties
(original)
+++ camel/trunk/camel-core/src/test/resources/org/apache/camel/component/properties/myproperties.properties
Fri Apr  2 12:33:55 2010
@@ -17,13 +17,13 @@
 
 cool.end=mock:result
 cool.result=result
-cool.concat=mock:#{cool.result}
+cool.concat=mock:{{cool.result}}
 cool.start=direct:cool
 cool.showid=true
 
 # circular reference test
-cool.a=#{cool.b}
-cool.b=#{cool.c}
-cool.c=#{cool.a}
+cool.a={{cool.b}}
+cool.b={{cool.c}}
+cool.c={{cool.a}}
 
 cool.mock=mock
\ No newline at end of file

Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringBuilderRefPropertiesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringBuilderRefPropertiesTest.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringBuilderRefPropertiesTest.java
(original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringBuilderRefPropertiesTest.java
Fri Apr  2 12:33:55 2010
@@ -31,7 +31,7 @@ public class SpringBuilderRefPropertiesT
     }
 
     public void testSpringBuilderRefProperties() throws Exception {
-        getMockEndpoint("#{result}").expectedMessageCount(1);
+        getMockEndpoint("{{result}}").expectedMessageCount(1);
 
         template.sendBody("direct:start", "Hello World");
 

Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringPackagePropertiesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringPackagePropertiesTest.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringPackagePropertiesTest.java
(original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringPackagePropertiesTest.java
Fri Apr  2 12:33:55 2010
@@ -31,7 +31,7 @@ public class SpringPackagePropertiesTest
     }
 
     public void testSpringPackageProperties() throws Exception {
-        getMockEndpoint("#{result}").expectedMessageCount(1);
+        getMockEndpoint("{{result}}").expectedMessageCount(1);
 
         template.sendBody("direct:start", "Hello World");
 

Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringPackageScanPropertiesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringPackageScanPropertiesTest.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringPackageScanPropertiesTest.java
(original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringPackageScanPropertiesTest.java
Fri Apr  2 12:33:55 2010
@@ -31,7 +31,7 @@ public class SpringPackageScanProperties
     }
 
     public void testSpringPackageProperties() throws Exception {
-        getMockEndpoint("#{result}").expectedMessageCount(1);
+        getMockEndpoint("{{result}}").expectedMessageCount(1);
 
         template.sendBody("direct:start", "Hello World");
 

Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/route/SpringSimpleRoute.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/route/SpringSimpleRoute.java?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/route/SpringSimpleRoute.java
(original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/properties/route/SpringSimpleRoute.java
Fri Apr  2 12:33:55 2010
@@ -25,7 +25,7 @@ public class SpringSimpleRoute extends S
 
     @Override
     public void configure() throws Exception {
-        from("direct:start").to("#{result}");
+        from("direct:start").to("{{result}}");
     }
 
 }

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringBuilderRefPropertiesTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringBuilderRefPropertiesTest.xml?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringBuilderRefPropertiesTest.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringBuilderRefPropertiesTest.xml
Fri Apr  2 12:33:55 2010
@@ -26,7 +26,7 @@
 
     <camelContext xmlns="http://camel.apache.org/schema/spring">
         <propertyPlaceholder id="properties" location="org/apache/camel/component/properties/myprop.properties"/>
-        <routeBuilder ref="#{mybuilder}"/>
+        <routeBuilder ref="{{mybuilder}}"/>
     </camelContext>
 
 </beans>

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPackagePropertiesTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPackagePropertiesTest.xml?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPackagePropertiesTest.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPackagePropertiesTest.xml
Fri Apr  2 12:33:55 2010
@@ -24,7 +24,7 @@
 
     <camelContext xmlns="http://camel.apache.org/schema/spring">
         <propertyPlaceholder id="properties" location="org/apache/camel/component/properties/myprop.properties"/>
-        <package>#{routebuilders}</package>
+        <package>{{routebuilders}}</package>
         <jmxAgent id="agent"/>
     </camelContext>
 

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPackageScanPropertiesTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPackageScanPropertiesTest.xml?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPackageScanPropertiesTest.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPackageScanPropertiesTest.xml
Fri Apr  2 12:33:55 2010
@@ -25,8 +25,8 @@
     <camelContext xmlns="http://camel.apache.org/schema/spring">
         <propertyPlaceholder id="properties" location="org/apache/camel/component/properties/myprop.properties"/>
         <packageScan>
-            <package>org.apache.camel.#{routescan}</package>
-            <includes>#{routeincludes}</includes>
+            <package>org.apache.camel.{{routescan}}</package>
+            <includes>{{routeincludes}}</includes>
         </packageScan>
         <jmxAgent id="agent"/>
     </camelContext>

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponent2Test.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponent2Test.xml?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponent2Test.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponent2Test.xml
Fri Apr  2 12:33:55 2010
@@ -30,22 +30,22 @@
 
         <route>
             <from uri="direct:start"/>
-            <to uri="properties:#{cool.end}"/>
+            <to uri="properties:{{cool.end}}"/>
         </route>
 
         <route>
             <from uri="direct:bar"/>
-            <to uri="properties:mock:#{cool.bar}"/>
+            <to uri="properties:mock:{{cool.bar}}"/>
         </route>
 
         <route>
             <from uri="direct:start2"/>
-            <to uri="#{cool.end}"/>
+            <to uri="{{cool.end}}"/>
         </route>
 
         <route>
             <from uri="direct:bar2"/>
-            <to uri="mock:#{cool.bar}"/>
+            <to uri="mock:{{cool.bar}}"/>
         </route>
     </camelContext>
 

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponent3Test.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponent3Test.xml?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponent3Test.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponent3Test.xml
Fri Apr  2 12:33:55 2010
@@ -29,22 +29,22 @@
 
         <route>
             <from uri="direct:start"/>
-            <to uri="properties:#{cool.end}"/>
+            <to uri="properties:{{cool.end}}"/>
         </route>
 
         <route>
             <from uri="direct:bar"/>
-            <to uri="properties:mock:#{cool.bar}"/>
+            <to uri="properties:mock:{{cool.bar}}"/>
         </route>
 
         <route>
             <from uri="direct:start2"/>
-            <to uri="#{cool.end}"/>
+            <to uri="{{cool.end}}"/>
         </route>
 
         <route>
             <from uri="direct:bar2"/>
-            <to uri="mock:#{cool.bar}"/>
+            <to uri="mock:{{cool.bar}}"/>
         </route>
     </camelContext>
 

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponentTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponentTest.xml?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponentTest.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponentTest.xml
Fri Apr  2 12:33:55 2010
@@ -30,22 +30,22 @@
 
         <route>
             <from uri="direct:start"/>
-            <to uri="properties:#{cool.end}"/>
+            <to uri="properties:{{cool.end}}"/>
         </route>
 
         <route>
             <from uri="direct:bar"/>
-            <to uri="properties:mock:#{cool.bar}"/>
+            <to uri="properties:mock:{{cool.bar}}"/>
         </route>
 
         <route>
             <from uri="direct:start2"/>
-            <to uri="#{cool.end}"/>
+            <to uri="{{cool.end}}"/>
         </route>
 
         <route>
             <from uri="direct:bar2"/>
-            <to uri="mock:#{cool.bar}"/>
+            <to uri="mock:{{cool.bar}}"/>
         </route>
     </camelContext>
 

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolver2Test.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolver2Test.xml?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolver2Test.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolver2Test.xml
Fri Apr  2 12:33:55 2010
@@ -30,7 +30,7 @@
                              propertiesResolverRef="myResolver"/>
         <route>
             <from uri="direct:start"/>
-            <to uri="properties:#{foo}"/>
+            <to uri="properties:foo"/>
         </route>
     </camelContext>
 

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolver3Test.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolver3Test.xml?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolver3Test.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolver3Test.xml
Fri Apr  2 12:33:55 2010
@@ -29,7 +29,7 @@
 
         <route>
             <from uri="direct:start"/>
-            <to uri="properties:#{foo}"/>
+            <to uri="properties:foo"/>
         </route>
     </camelContext>
 

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolverTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolverTest.xml?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolverTest.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesResolverTest.xml
Fri Apr  2 12:33:55 2010
@@ -32,7 +32,7 @@
     <camelContext xmlns="http://camel.apache.org/schema/spring">
         <route>
             <from uri="direct:start"/>
-            <to uri="properties:#{foo}"/>
+            <to uri="properties:foo"/>
         </route>
     </camelContext>
 

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/jmxConfigUsingProperties.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/jmxConfigUsingProperties.xml?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/jmxConfigUsingProperties.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/jmxConfigUsingProperties.xml
Fri Apr  2 12:33:55 2010
@@ -27,8 +27,8 @@
         <propertyPlaceholder id="properties" location="org/apache/camel/spring/jmx.properties"/>
 
         <!-- we can use propery placeholders when we define the JMX agent -->
-        <jmxAgent id="agent" registryPort="#{myjmx.port}"
-                  usePlatformMBeanServer="#{myjmx.usePlatform}"
+        <jmxAgent id="agent" registryPort="{{myjmx.port}}"
+                  usePlatformMBeanServer="{{myjmx.usePlatform}}"
                   createConnector="true"
                   statisticsLevel="RoutesOnly"
                 />

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceUsingPropertyTest-context.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceUsingPropertyTest-context.xml?rev=930255&r1=930254&r2=930255&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceUsingPropertyTest-context.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringTraceUsingPropertyTest-context.xml
Fri Apr  2 12:33:55 2010
@@ -23,14 +23,14 @@
     ">
 
     <!-- START SNIPPET: e1 -->
-    <camelContext trace="#{foo.trace}" xmlns="http://camel.apache.org/schema/spring">
+    <camelContext trace="{{foo.trace}}" xmlns="http://camel.apache.org/schema/spring">
         <propertyPlaceholder id="properties" location="org/apache/camel/spring/processor/myprop.properties"/>
 
-        <template id="camelTemplate" defaultEndpoint="#{foo.cool}"/>
+        <template id="camelTemplate" defaultEndpoint="{{foo.cool}}"/>
 
         <route>
             <from uri="direct:start"/>
-            <setHeader headerName="#{foo.header}">
+            <setHeader headerName="{{foo.header}}">
                 <simple>${in.body} World!</simple>
             </setHeader>
             <to uri="mock:result"/>



Mime
View raw message