camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [camel] 05/10: CAMEL-13947: PropertiesComponent should be a static service and resolved like other similar features.
Date Thu, 26 Sep 2019 05:00:00 GMT
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch CAMEL-13947
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 289fbfe7ee08e65077db22d6256e877d3ca25868
Author: Claus Ibsen <claus.ibsen@gmail.com>
AuthorDate: Wed Sep 25 20:00:02 2019 +0200

    CAMEL-13947: PropertiesComponent should be a static service and resolved like other similar
features.
---
 .../src/main/java/org/apache/camel/spi/PropertiesComponent.java         | 2 ++
 .../camel/component/properties/PropertiesComponentEncodingTest.java     | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java b/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java
index 362497b..7277893 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java
@@ -126,6 +126,8 @@ public interface PropertiesComponent extends StaticService {
      * <p/>
      * If no encoding has been set, then the properties files is loaded using ISO-8859-1
encoding (latin-1)
      * as documented by {@link java.util.Properties#load(java.io.InputStream)}
+     * <p/>
+     * Important you must set encoding before setting locations.
      */
     void setEncoding(String encoding);
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEncodingTest.java
b/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEncodingTest.java
index c216e65..3067256 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEncodingTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEncodingTest.java
@@ -47,8 +47,8 @@ public class PropertiesComponentEncodingTest extends ContextTestSupport
{
     @Override
     protected CamelContext createCamelContext() throws Exception {
         CamelContext context = super.createCamelContext();
-        context.getPropertiesComponent().setLocation("classpath:org/apache/camel/component/properties/myutf8.properties");
         context.getPropertiesComponent().setEncoding("UTF-8");
+        context.getPropertiesComponent().setLocation("classpath:org/apache/camel/component/properties/myutf8.properties");
         return context;
     }
 


Mime
View raw message