Support configuring the camel-box integration test account settings via maven properties so users can configure them in ~/.m2/settings.xml
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f0555014 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f0555014 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f0555014 Branch: refs/heads/master Commit: f0555014875c548637d8c1ab0dd6d19b3592f312 Parents: 2936f19 Author: Hiram Chirino <hi...@hiramchirino.com> Authored: Thu Jul 3 12:11:50 2014 -0400 Committer: Hiram Chirino <hi...@hiramchirino.com> Committed: Thu Jul 3 12:11:50 2014 -0400 ---------------------------------------------------------------------- components/camel-box/pom.xml | 6 ++++++ .../camel/component/box/AbstractBoxTestSupport.java | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/f0555014/components/camel-box/pom.xml ---------------------------------------------------------------------- diff --git a/components/camel-box/pom.xml b/components/camel-box/pom.xml index c65e9b1..74cd1d5 100644 --- a/components/camel-box/pom.xml +++ b/components/camel-box/pom.xml @@ -488,6 +488,12 @@ <includes> <include>**/*Test.java</include> </includes> + <systemPropertyVariables> + <camel.box.userName>${camel.box.userName}</camel.box.userName> + <camel.box.userPassword>${camel.box.userPassword}</camel.box.userPassword> + <camel.box.clientId>${camel.box.clientId}</camel.box.clientId> + <camel.box.clientSecret>${camel.box.clientSecret}</camel.box.clientSecret> + </systemPropertyVariables> </configuration> </plugin> </plugins> http://git-wip-us.apache.org/repos/asf/camel/blob/f0555014/components/camel-box/src/test/java/org/apache/camel/component/box/AbstractBoxTestSupport.java ---------------------------------------------------------------------- diff --git a/components/camel-box/src/test/java/org/apache/camel/component/box/AbstractBoxTestSupport.java b/components/camel-box/src/test/java/org/apache/camel/component/box/AbstractBoxTestSupport.java index 130bcaf..0373cda 100644 --- a/components/camel-box/src/test/java/org/apache/camel/component/box/AbstractBoxTestSupport.java +++ b/components/camel-box/src/test/java/org/apache/camel/component/box/AbstractBoxTestSupport.java @@ -82,6 +82,15 @@ public abstract class AbstractBoxTestSupport extends CamelTestSupport { e); } + addSystemProperty("camel.box.userName", "userName", properties); + addSystemProperty("camel.box.userPassword", "userPassword", properties); + addSystemProperty("camel.box.clientId", "clientId", properties); + addSystemProperty("camel.box.clientSecret", "clientSecret", properties); + addSystemProperty("camel.box.refreshToken", "refreshToken", properties); + addSystemProperty("camel.box.testFolderId", "testFolderId", properties); + addSystemProperty("camel.box.testFileId", "testFileId", properties); + addSystemProperty("camel.box.testUserId", "testUserId", properties); + // cache test properties refreshToken = properties.getProperty(REFRESH_TOKEN_PROPERTY); testFolderId = properties.getProperty("testFolderId"); @@ -136,6 +145,13 @@ public abstract class AbstractBoxTestSupport extends CamelTestSupport { return context; } + private void addSystemProperty(String sourceName, String targetName, Properties properties) { + String value = System.getProperty(sourceName); + if( value!=null && !value.trim().isEmpty() ) { + properties.put(targetName, value); + } + } + @AfterClass public static void tearDownAfterClass() throws Exception { CamelTestSupport.tearDownAfterClass();