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 d8e187af4f01c6096ae6c1eaf3f7f77b4d778aa3 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Sep 26 10:21:05 2019 +0200 CAMEL-13947: PropertiesComponent should be a static service and resolved like other similar features. --- .../org/apache/camel/component/influxdb/AbstractInfluxDbTest.java | 1 + .../apache/camel/component/mongodb/gridfs/AbstractMongoDbTest.java | 1 + .../test/java/org/apache/camel/component/sql/stored/ParserTest.java | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/camel-influxdb/src/test/java/org/apache/camel/component/influxdb/AbstractInfluxDbTest.java b/components/camel-influxdb/src/test/java/org/apache/camel/component/influxdb/AbstractInfluxDbTest.java index bf5d4b5..9dec4d2 100644 --- a/components/camel-influxdb/src/test/java/org/apache/camel/component/influxdb/AbstractInfluxDbTest.java +++ b/components/camel-influxdb/src/test/java/org/apache/camel/component/influxdb/AbstractInfluxDbTest.java @@ -30,6 +30,7 @@ public class AbstractInfluxDbTest extends CamelTestSupport { protected CamelContext createCamelContext() throws Exception { applicationContext = new AnnotationConfigApplicationContext(MockedInfluxDbConfiguration.class); CamelContext ctx = new SpringCamelContext(applicationContext); + ctx.init(); ctx.getPropertiesComponent().setLocation("classpath:influxdb.test.properties"); return ctx; } diff --git a/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/AbstractMongoDbTest.java b/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/AbstractMongoDbTest.java index 664c757..8f8c6b6 100644 --- a/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/AbstractMongoDbTest.java +++ b/components/camel-mongodb-gridfs/src/test/java/org/apache/camel/component/mongodb/gridfs/AbstractMongoDbTest.java @@ -54,6 +54,7 @@ public abstract class AbstractMongoDbTest extends CamelTestSupport { protected CamelContext createCamelContext() throws Exception { applicationContext = new AnnotationConfigApplicationContext(EmbedMongoConfiguration.class); CamelContext ctx = new SpringCamelContext(applicationContext); + ctx.init(); ctx.getPropertiesComponent().setLocation("classpath:mongodb.test.properties"); return ctx; } diff --git a/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ParserTest.java b/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ParserTest.java index be0f142..598cc49 100644 --- a/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ParserTest.java +++ b/components/camel-sql/src/test/java/org/apache/camel/component/sql/stored/ParserTest.java @@ -22,13 +22,13 @@ import java.util.HashMap; import java.util.Map; import org.apache.camel.Exchange; -import org.apache.camel.component.properties.PropertiesComponent; import org.apache.camel.component.sql.stored.template.TemplateParser; import org.apache.camel.component.sql.stored.template.ast.InOutParameter; import org.apache.camel.component.sql.stored.template.ast.InParameter; import org.apache.camel.component.sql.stored.template.ast.OutParameter; import org.apache.camel.component.sql.stored.template.ast.ParseRuntimeException; import org.apache.camel.component.sql.stored.template.ast.Template; +import org.apache.camel.spi.PropertiesComponent; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Assert; import org.junit.Test; @@ -118,7 +118,7 @@ public class ParserTest extends CamelTestSupport { @Test public void colonInSimple() { - PropertiesComponent pc = (PropertiesComponent) context.getComponent("properties"); + PropertiesComponent pc = context.getPropertiesComponent(); pc.setLocation("classpath:jndi.properties"); Exchange exchange = createExchangeWithBody(1); Template template = parser.parseTemplate("ADDNUMBERS2(-1342 ${properties:java.naming.factory.initial})");