You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/10/19 15:22:58 UTC

svn commit: r1024230 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/component/properties/PropertiesComponent.java test/java/org/apache/camel/component/properties/PropertiesComponentTest.java

Author: davsclaus
Date: Tue Oct 19 13:22:58 2010
New Revision: 1024230

URL: http://svn.apache.org/viewvc?rev=1024230&view=rev
Log:
CAMEL-3250: Applied patch with thanks to Daniel Bevenius.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentTest.java

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=1024230&r1=1024229&r2=1024230&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 Tue Oct 19 13:22:58 2010
@@ -42,6 +42,13 @@ public class PropertiesComponent extends
     private PropertiesParser propertiesParser = new DefaultPropertiesParser();
     private String[] locations;
     private boolean cache = true;
+    
+    public PropertiesComponent() {
+    }
+    
+    public PropertiesComponent(String... locations) {
+        this.locations = locations;
+    }
 
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {

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=1024230&r1=1024229&r2=1024230&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 Tue Oct 19 13:22:58 2010
@@ -209,12 +209,7 @@ public class PropertiesComponentTest ext
     @Override
     protected CamelContext createCamelContext() throws Exception {
         CamelContext context = super.createCamelContext();
-
-        PropertiesComponent pc = new PropertiesComponent();
-        pc.setCamelContext(context);
-        pc.setLocations(new String[]{"classpath:org/apache/camel/component/properties/myproperties.properties"});
-        context.addComponent("properties", pc);
-
+        context.addComponent("properties", new PropertiesComponent("classpath:org/apache/camel/component/properties/myproperties.properties"));
         return context;
     }