You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2013/12/09 03:11:05 UTC

[01/50] [abbrv] git commit: Polished some examples

Updated Branches:
  refs/heads/camel-gora 76e35334e -> c88e547cc (forced update)


Polished some examples


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/16b988ef
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/16b988ef
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/16b988ef

Branch: refs/heads/camel-gora
Commit: 16b988ef979a27299adc820dda41e8e802af4e05
Parents: 07a0b9e
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Nov 28 18:17:27 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Nov 28 18:20:37 2013 +0100

----------------------------------------------------------------------
 examples/camel-example-cafe/README.txt    |   2 +-
 examples/camel-example-cafe/pom.xml       | 221 +++++++++++++------------
 examples/camel-example-console/README.txt |   2 +-
 examples/camel-example-console/pom.xml    |  13 +-
 4 files changed, 119 insertions(+), 119 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/16b988ef/examples/camel-example-cafe/README.txt
----------------------------------------------------------------------
diff --git a/examples/camel-example-cafe/README.txt b/examples/camel-example-cafe/README.txt
index 692a118..205b834 100644
--- a/examples/camel-example-cafe/README.txt
+++ b/examples/camel-example-cafe/README.txt
@@ -7,7 +7,7 @@ You will need to compile this example first:
   mvn compile
 
 To run the example type
-  mvn exec:java
+  mvn camel:run
 
 You can see the routing rules by looking at the java code in the
 src/main/java directory and the Spring XML configuration lives in

http://git-wip-us.apache.org/repos/asf/camel/blob/16b988ef/examples/camel-example-cafe/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-cafe/pom.xml b/examples/camel-example-cafe/pom.xml
index 6f3471e..57b56bd 100755
--- a/examples/camel-example-cafe/pom.xml
+++ b/examples/camel-example-cafe/pom.xml
@@ -1,114 +1,115 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-	<!--
-		Licensed to the Apache Software Foundation (ASF) under one or more
-		contributor license agreements. See the NOTICE file distributed with
-		this work for additional information regarding copyright ownership.
-		The ASF licenses this file to You under the Apache License, Version
-		2.0 (the "License"); you may not use this file except in compliance
-		with the License. You may obtain a copy of the License at
-
-		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
-		applicable law or agreed to in writing, software distributed under the
-		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-		CONDITIONS OF ANY KIND, either express or implied. See the License for
-		the specific language governing permissions and limitations under the
-		License.
-	-->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-	<modelVersion>4.0.0</modelVersion>
-
-	<parent>
-		<groupId>org.apache.camel</groupId>
-		<artifactId>examples</artifactId>
-		<version>2.13-SNAPSHOT</version>
-	</parent>
-
-	<artifactId>camel-example-cafe</artifactId>
-	<packaging>bundle</packaging>
-	<name>Camel :: Example :: Cafe </name>
-	<description>A cafe example showing how to work with Camel</description>
-
-	<properties>
-		<camel.osgi.export.pkg>org.apache.camel.example.cafe.*</camel.osgi.export.pkg>
-	</properties>
-
-	<dependencies>
-
-		<dependency>
-			<groupId>org.apache.camel</groupId>
-			<artifactId>camel-spring</artifactId>
-		</dependency>
-
-        <!-- lets use log4j -->
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-        </dependency>
-		<dependency>
-			<groupId>log4j</groupId>
-			<artifactId>log4j</artifactId>
-		</dependency>
-
-		<!-- for testing -->
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<scope>test</scope>
-		</dependency>
-
-	</dependencies>
-
-	<build>
-		<plugins>
-			<plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>attach-artifacts</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>attach-artifact</goal>
-                        </goals>
-                        <configuration>
-                            <artifacts>
-                                <artifact>
-                                    <file>target/classes/features.xml</file>
-                                    <type>xml</type>
-                                    <classifier>features</classifier>
-                                </artifact>
-                            </artifacts>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-			<!-- Allows the routes to be run via 'mvn camel:run' -->
-			<plugin>
-				<groupId>org.apache.camel</groupId>
-				<artifactId>camel-maven-plugin</artifactId>
-				<version>${project.version}</version>
-			</plugin>
-
-			<!-- Allows the example to be run via 'mvn compile exec:java' -->
-			<plugin>
-				<groupId>org.codehaus.mojo</groupId>
-				<artifactId>exec-maven-plugin</artifactId>
-				<configuration>
-					<mainClass>org.apache.camel.example.cafe.CafeRouteBuilder</mainClass>
-					<includePluginDependencies>false</includePluginDependencies>
-				</configuration>
-			</plugin>
-
-		</plugins>
-	</build>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version
+  2.0 (the "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+  applicable law or agreed to in writing, software distributed under the
+  License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+  CONDITIONS OF ANY KIND, either express or implied. See the License for
+  the specific language governing permissions and limitations under the
+  License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>examples</artifactId>
+    <version>2.13-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>camel-example-cafe</artifactId>
+  <packaging>bundle</packaging>
+  <name>Camel :: Example :: Cafe</name>
+  <description>A cafe example showing how to work with Camel</description>
+
+  <properties>
+    <camel.osgi.export.pkg>org.apache.camel.example.cafe.*</camel.osgi.export.pkg>
+  </properties>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-spring</artifactId>
+    </dependency>
+
+    <!-- lets use log4j -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+    </dependency>
+
+    <!-- for testing -->
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-test</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-artifacts</id>
+            <phase>package</phase>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  <file>target/classes/features.xml</file>
+                  <type>xml</type>
+                  <classifier>features</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+
+      <!-- Allows the routes to be run via 'mvn camel:run' -->
+      <plugin>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-maven-plugin</artifactId>
+        <version>${project.version}</version>
+      </plugin>
+
+      <!-- Allows the example to be run via 'mvn compile exec:java' -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <configuration>
+          <mainClass>org.apache.camel.example.cafe.CafeRouteBuilder</mainClass>
+          <includePluginDependencies>false</includePluginDependencies>
+        </configuration>
+      </plugin>
+
+    </plugins>
+  </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/camel/blob/16b988ef/examples/camel-example-console/README.txt
----------------------------------------------------------------------
diff --git a/examples/camel-example-console/README.txt b/examples/camel-example-console/README.txt
index 6e9ec99..7002036 100644
--- a/examples/camel-example-console/README.txt
+++ b/examples/camel-example-console/README.txt
@@ -7,7 +7,7 @@ You will need to compile this example first:
   mvn compile
 
 To run the example type
-  mvn exec:java
+  mvn camel:run
 
 You can see the routing rules by looking at the XML in the directory:
   src/main/resources/META-INF/spring

http://git-wip-us.apache.org/repos/asf/camel/blob/16b988ef/examples/camel-example-console/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-console/pom.xml b/examples/camel-example-console/pom.xml
index 08babc6..6ba7c75 100644
--- a/examples/camel-example-console/pom.xml
+++ b/examples/camel-example-console/pom.xml
@@ -59,15 +59,14 @@
 
   <build>
     <plugins>
-      <!-- Allows the example to be run via 'mvn compile exec:java' -->
+
+      <!-- Allows the routes to be run via 'mvn camel:run' -->
       <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>exec-maven-plugin</artifactId>
-        <configuration>
-          <mainClass>org.apache.camel.example.console.CamelConsoleMain</mainClass>
-          <includePluginDependencies>false</includePluginDependencies>
-        </configuration>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-maven-plugin</artifactId>
+        <version>${project.version}</version>
       </plugin>
+
     </plugins>
 
   </build>


[44/50] [abbrv] git commit: added the license header

Posted by ni...@apache.org.
added the license header


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8f326152
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8f326152
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8f326152

Branch: refs/heads/camel-gora
Commit: 8f32615275261788d92e6cd1d53e3de43c0416cd
Parents: 4a6f1a2
Author: cmueller <cm...@apache.org>
Authored: Sat Dec 7 21:32:02 2013 +0100
Committer: cmueller <cm...@apache.org>
Committed: Sat Dec 7 21:32:02 2013 +0100

----------------------------------------------------------------------
 .../services/org/apache/camel/component/aws-swf    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8f326152/components/camel-aws/src/main/resources/META-INF/services/org/apache/camel/component/aws-swf
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/resources/META-INF/services/org/apache/camel/component/aws-swf b/components/camel-aws/src/main/resources/META-INF/services/org/apache/camel/component/aws-swf
index 5e33c5b..3d10c74 100644
--- a/components/camel-aws/src/main/resources/META-INF/services/org/apache/camel/component/aws-swf
+++ b/components/camel-aws/src/main/resources/META-INF/services/org/apache/camel/component/aws-swf
@@ -1 +1,18 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
 class=org.apache.camel.component.aws.swf.SWFComponent


[14/50] [abbrv] git commit: Fixed test

Posted by ni...@apache.org.
Fixed test


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/102843f0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/102843f0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/102843f0

Branch: refs/heads/camel-gora
Commit: 102843f024ebb120e6e31c0046b6fbc5c37fb9a3
Parents: 635356a
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Dec 2 09:19:59 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Dec 2 09:19:59 2013 +0100

----------------------------------------------------------------------
 .../testng/AbstractCamelTestNGSpringContextTestsPlainTest.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/102843f0/components/camel-testng/src/test/java/org/apache/camel/testng/AbstractCamelTestNGSpringContextTestsPlainTest.java
----------------------------------------------------------------------
diff --git a/components/camel-testng/src/test/java/org/apache/camel/testng/AbstractCamelTestNGSpringContextTestsPlainTest.java b/components/camel-testng/src/test/java/org/apache/camel/testng/AbstractCamelTestNGSpringContextTestsPlainTest.java
index 1984450..d1aa63d 100644
--- a/components/camel-testng/src/test/java/org/apache/camel/testng/AbstractCamelTestNGSpringContextTestsPlainTest.java
+++ b/components/camel-testng/src/test/java/org/apache/camel/testng/AbstractCamelTestNGSpringContextTestsPlainTest.java
@@ -102,9 +102,10 @@ public class AbstractCamelTestNGSpringContextTestsPlainTest
     @Test
     public void testStopwatch() {
         StopWatch stopWatch = StopWatchTestExecutionListener.getStopWatch();
-        
+
+        // some servers is slower
         assertNotNull(stopWatch);
-        assertTrue(stopWatch.taken() < 100);
+        assertTrue(stopWatch.taken() < 1000);
     }
     
     @Test


[18/50] [abbrv] git commit: Upgraded to AHC 1.7.21.

Posted by ni...@apache.org.
Upgraded to AHC 1.7.21.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7bf03d0f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7bf03d0f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7bf03d0f

Branch: refs/heads/camel-gora
Commit: 7bf03d0f8da4a8143670a141fdaad8fff8629d55
Parents: 708a3cb
Author: Babak Vahdat <bv...@apache.org>
Authored: Mon Dec 2 20:40:35 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Mon Dec 2 20:40:35 2013 +0100

----------------------------------------------------------------------
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7bf03d0f/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 92edad8..930739b 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -37,7 +37,7 @@
     <abdera-version>1.1.3</abdera-version>
     <!-- Note that activemq dependency is only used for testing! -->
     <activemq-version>5.9.0</activemq-version>
-    <ahc-version>1.7.20</ahc-version>
+    <ahc-version>1.7.21</ahc-version>
     <ant-bundle-version>1.7.0_6</ant-bundle-version>
     <antlr-bundle-version>3.4_1</antlr-bundle-version>
     <antlr-runtime-bundle-version>3.4_2</antlr-runtime-bundle-version>


[36/50] [abbrv] git commit: CAMEL-7038: Polished.

Posted by ni...@apache.org.
CAMEL-7038: Polished.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/33d7c49c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/33d7c49c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/33d7c49c

Branch: refs/heads/camel-gora
Commit: 33d7c49cb2c124f2b102f0b0221cfaf089b88915
Parents: 4ca3621
Author: Babak Vahdat <bv...@apache.org>
Authored: Wed Dec 4 13:27:36 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Wed Dec 4 13:27:36 2013 +0100

----------------------------------------------------------------------
 .../camel-guice/src/main/java/org/apache/camel/guice/Main.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/33d7c49c/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java b/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
index 1d6d375..4966bd0 100644
--- a/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
+++ b/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
@@ -33,6 +33,7 @@ import com.google.common.collect.Maps;
 import com.google.inject.Binding;
 import com.google.inject.Injector;
 import com.google.inject.Key;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.guice.inject.Injectors;
@@ -130,7 +131,7 @@ public class Main extends MainSupport {
     }
 
     protected void doStop() throws Exception {
-        LOG.info("Apache Camel stopping");
+        super.doStop();
 
         if (injector != null) {
             Injectors.close(injector);
@@ -148,7 +149,7 @@ public class Main extends MainSupport {
         for (CamelContext camelContext : getCamelContexts()) {
             return camelContext.createProducerTemplate();
         }
-        throw new IllegalArgumentException("No CamelContexts are available so cannot create a ProducerTemplate!");
+        throw new IllegalArgumentException("No CamelContext is available so cannot create a ProducerTemplate!");
     }
 
     protected Map<String, CamelContext> getCamelContextMap() {


[24/50] [abbrv] CAMEL-7030: quartz components now register the quartz scheduler in JMX by default, unless configured not to do so by end user. Fixed route policy tests using custom date type instead of using the java.util.Date.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SimplePolicies.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SimplePolicies.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SimplePolicies.xml
index ea3aea8..b213a8a 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SimplePolicies.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SimplePolicies.xml
@@ -22,39 +22,41 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="date" class="org.apache.camel.routepolicy.quartz2.SimpleDate"/>
-
-    <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy"/>
-
-    <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
-    	<property name="routeStartDate" ref="date"/>
-    	<property name="routeStartRepeatCount" value="1"/>
-    	<property name="routeStartRepeatInterval" value="3000"/>    	
-    </bean>
-    
-    <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
-    	<property name="routeStopDate" ref="date"/>
-    	<property name="routeStopRepeatCount" value="1"/>
-    	<property name="routeStopRepeatInterval" value="3000"/>    	
-	</bean>
-	
-	<bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
-    	<property name="routeSuspendDate" ref="date"/>
-    	<property name="routeSuspendRepeatCount" value="1"/>
-    	<property name="routeSuspendRepeatInterval" value="3000"/>    	
-  	</bean>
-  	
-  	<bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
-       	<property name="routeResumeDate" ref="date"/>
-    	<property name="routeResumeRepeatCount" value="1"/>
-    	<property name="routeResumeRepeatInterval" value="3000"/>    	
- 	</bean> 
- 	
-    <routeContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
-        <route id="testRoute">
-            <from uri="direct:start"/>
-            <to uri="mock:success"/>
-        </route>
-    </routeContext>
+  <bean id="now" class="org.apache.camel.routepolicy.quartz2.DateFactory" factory-method="createDate">
+    <constructor-arg index="0" value="3000"/>
+  </bean>
+
+  <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy"/>
+
+  <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
+    <property name="routeStartDate" ref="now"/>
+    <property name="routeStartRepeatCount" value="1"/>
+    <property name="routeStartRepeatInterval" value="3000"/>
+  </bean>
+
+  <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
+    <property name="routeStopDate" ref="now"/>
+    <property name="routeStopRepeatCount" value="1"/>
+    <property name="routeStopRepeatInterval" value="3000"/>
+  </bean>
+
+  <bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
+    <property name="routeSuspendDate" ref="now"/>
+    <property name="routeSuspendRepeatCount" value="1"/>
+    <property name="routeSuspendRepeatInterval" value="3000"/>
+  </bean>
+
+  <bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
+    <property name="routeResumeDate" ref="now"/>
+    <property name="routeResumeRepeatCount" value="1"/>
+    <property name="routeResumeRepeatInterval" value="3000"/>
+  </bean>
+
+  <routeContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
+    <route id="testRoute">
+      <from uri="direct:start"/>
+      <to uri="mock:success"/>
+    </route>
+  </routeContext>
 
 </beans>


[47/50] [abbrv] git commit: CAMEL-4817 Added camel-gora component with thanks to Ioannis

Posted by ni...@apache.org.
CAMEL-4817 Added camel-gora component with thanks to Ioannis


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8ad60f0f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8ad60f0f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8ad60f0f

Branch: refs/heads/camel-gora
Commit: 8ad60f0fd59049985fba3a025e7fa8d0384cc8d5
Parents: f68954c
Author: Willem Jiang <wi...@gmail.com>
Authored: Tue Nov 19 14:34:04 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Dec 9 10:07:07 2013 +0800

----------------------------------------------------------------------
 components/camel-gora/pom.xml                   | 208 ++++++++
 .../camel/component/gora/GoraAttribute.java     | 106 +++++
 .../camel/component/gora/GoraComponent.java     | 109 +++++
 .../camel/component/gora/GoraConfiguration.java | 476 +++++++++++++++++++
 .../camel/component/gora/GoraConstants.java     |  39 ++
 .../camel/component/gora/GoraConsumer.java      | 132 +++++
 .../camel/component/gora/GoraEndpoint.java      | 105 ++++
 .../camel/component/gora/GoraOperation.java     |  85 ++++
 .../camel/component/gora/GoraProducer.java      | 131 +++++
 .../camel/component/gora/utils/GoraUtils.java   | 326 +++++++++++++
 .../src/main/resources/META-INF/LICENSE.txt     | 203 ++++++++
 .../src/main/resources/META-INF/NOTICE.txt      |  11 +
 .../services/org/apache/camel/component/gora    |  18 +
 .../component/gora/GoraConfigurationTest.java   |  78 +++
 .../camel/component/gora/GoraConsumerTest.java  | 103 ++++
 .../camel/component/gora/GoraProducerTest.java  | 314 ++++++++++++
 .../camel/component/gora/GoraTestSupport.java   |  29 ++
 .../component/gora/utils/GoraUtilsTest.java     |  56 +++
 18 files changed, 2529 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-gora/pom.xml b/components/camel-gora/pom.xml
new file mode 100644
index 0000000..f2318ff
--- /dev/null
+++ b/components/camel-gora/pom.xml
@@ -0,0 +1,208 @@
+<!--
+	 Copyright 2011 Ioannis Polyzos
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+			                 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>components</artifactId>
+        <version>2.12-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-gora</artifactId>
+    <packaging>bundle</packaging>
+    <name>Camel :: Gora</name>
+
+    <description>
+        Gora Component for Apache Camel.
+    </description>
+
+    <properties>
+        <!--
+          General
+        -->
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+        <!--
+            OSGi
+        -->
+        <camel.osgi.export.pkg>
+            org.apache.camel.component.gora.*
+        </camel.osgi.export.pkg>
+        <camel.osgi.import.before.defaults>
+            org.apache.camel.*
+            com.google.common.base;version="[11,14)",
+            org.apache.hadoop.conf;version="[1,2)"
+        </camel.osgi.import.before.defaults>
+        <camel.osgi.export.pkg>org.apache.camel.component.gora.*</camel.osgi.export.pkg>
+        <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=gora</camel.osgi.export.service>
+
+        <!--
+            Libraries versions
+        -->
+
+        <!-- apache gora -->
+        <apache-gora.version>0.4-SNAPSHOT</apache-gora.version>
+
+        <mockito.version>1.9.0</mockito.version>
+        <powermock.version>1.4.11</powermock.version>
+
+        <hadoop.version>1.1.1_1</hadoop.version>
+        <avro.version>1.6.1_1</avro.version>
+        <jackson.version>1.6.9</jackson.version>
+
+        <jdom.version>1.1.2_1</jdom.version>
+        <guava.version>11.0.2_2</guava.version>
+        <commons-beanutils.version>1.8.3</commons-beanutils.version>
+
+    </properties>
+
+    <build>
+        <defaultGoal>install</defaultGoal>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        <testResources>
+            <testResource>
+                <directory>src/test/resources</directory>
+                <filtering>true</filtering>
+            </testResource>
+        </testResources>
+    </build>
+
+    <dependencies>
+        <!-- logging  -->
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+        </dependency>
+
+        <!-- testing -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>${mockito.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.powermock</groupId>
+            <artifactId>powermock-core</artifactId>
+            <version>${powermock.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.powermock</groupId>
+            <artifactId>powermock-module-junit4</artifactId>
+            <version>${powermock.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.powermock</groupId>
+            <artifactId>powermock-api-mockito</artifactId>
+            <version>${powermock.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-spring</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- apache camel -->
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core</artifactId>
+        </dependency>
+
+        <!-- apache gora -->
+        <dependency>
+            <groupId>org.apache.gora</groupId>
+            <artifactId>gora-core</artifactId>
+            <version>${apache-gora.version}</version>
+        </dependency>
+
+        <!-- hadoop -->
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.hadoop-core</artifactId>
+            <version>${hadoop.version}</version>
+        </dependency>
+
+        <!-- Avro  -->
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.avro</artifactId>
+            <version>${avro.version}</version>
+        </dependency>
+
+        <!-- other -->
+        <!-- Avro needs this version of jackson -->
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-core-asl</artifactId>
+            <version>${jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-mapper-asl</artifactId>
+            <version>${jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.jdom</artifactId>
+            <version>${jdom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.guava</artifactId>
+            <version>${guava.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>${commons-beanutils.version}</version>
+        </dependency>
+    </dependencies>
+
+    <licenses>
+        <license>
+            <name>Apache 2.0 License</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+        </license>
+    </licenses>
+
+</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraAttribute.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraAttribute.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraAttribute.java
new file mode 100644
index 0000000..aeab95f
--- /dev/null
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraAttribute.java
@@ -0,0 +1,106 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora;
+
+/**
+ * Camel-Gora attributes
+ *
+ * @author ipolyzos
+ */
+public enum GoraAttribute {
+
+    /**
+     * Gora KEY attribute
+     */
+    GORA_KEY("goraKey"),
+
+    /**
+     * Gora operation header name
+     */
+    GORA_OPERATION("goraOperation"),
+
+    /**
+     * Gora Query Start Time attribute
+     */
+    GORA_QUERY_START_TIME("startTime"),
+
+    /**
+     * Gora Query End Time attribute
+     */
+    GORA_QUERY_END_TIME("endTime"),
+
+    /**
+     * Gora Query Start Key attribute
+     */
+    GORA_QUERY_START_KEY("startKey"),
+
+    /**
+     * Gora Query End Key attribute
+     */
+    GORA_QUERY_END_KEY("endKey"),
+
+    /**
+     * Gora Query Key Range From attribute
+     */
+    GORA_QUERY_KEY_RANGE_FROM("keyRangeFrom"),
+
+    /**
+     * Gora Query Key Range To attribute
+     */
+    GORA_QUERY_KEY_RANGE_TO("keyRangeTo"),
+
+    /**
+     * Gora Query Time Range From attribute
+     */
+    GORA_QUERY_TIME_RANGE_FROM("timeRangeFrom"),
+
+    /**
+     * Gora Query Key Range To attribute
+     */
+    GORA_QUERY_TIME_RANGE_TO("timeRangeTo"),
+
+    /**
+     * Gora Query Limit attribute
+     */
+    GORA_QUERY_LIMIT("limit"),
+
+    /**
+     * Gora Query Timestamp attribute
+     */
+    GORA_QUERY_TIMESTAMP("timestamp"),
+
+    /**
+     * Gora Query Fields attribute
+     */
+    GORA_QUERY_FIELDS("fields");
+    /**
+     * Enum value
+     */
+    public final String value;
+
+    /**
+     * Enum constructor
+     *
+     * @param str Operation Value
+     */
+    private GoraAttribute(final String str) {
+
+        value = str;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java
new file mode 100644
index 0000000..03f2573
--- /dev/null
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java
@@ -0,0 +1,109 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.impl.DefaultComponent;
+
+import org.apache.gora.persistency.Persistent;
+import org.apache.gora.store.DataStore;
+import org.apache.gora.store.DataStoreFactory;
+import org.apache.hadoop.conf.Configuration;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.Properties;
+
+import static org.apache.camel.component.gora.GoraConstants.GORA_DEFAULT_DATASTORE_KEY;
+
+
+/**
+ * Camel-Gora {@link Endpoint}.
+ *
+ * @author ipolyzos
+ */
+public class GoraComponent extends DefaultComponent {
+
+    /**
+     * GORA datastore
+     */
+    private DataStore<Object,? extends Persistent> dataStore;
+
+    /**
+     * GORA properties
+     */
+    private Properties goraProperties;
+
+    /**
+     * Hadoop configuration
+     */
+    private Configuration configuration;
+
+    /**
+     *
+     * Initialize class and create DataStore instance
+     *
+     * @param config  component configuration
+     * @throws IOException
+     */
+    private void init(final GoraConfiguration config) throws IOException {
+
+        this.configuration = new Configuration();
+        this.goraProperties = DataStoreFactory.createProps();
+
+        this.dataStore = DataStoreFactory.getDataStore(goraProperties.getProperty(GORA_DEFAULT_DATASTORE_KEY,
+                                                                                  config.getDataStoreClass()),
+                                                        config.getKeyClass(),
+                                                        config.getValueClass(),
+                                                        this.configuration);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected Endpoint createEndpoint(final String uri,
+                                      final String remaining,
+                                      final Map<String, Object> parameters) throws Exception {
+
+        final GoraConfiguration config = new GoraConfiguration();
+        setProperties(config, parameters);
+
+        try {
+
+           init(config);
+        } catch (IOException ex) {
+
+           throw new RuntimeException(ex);
+        }
+
+        return new GoraEndpoint(uri, this, config, dataStore);
+    }
+
+    /**
+     * Get DataStore
+     *
+     * @return DataStore
+     */
+    public DataStore getDataStore() {
+
+        return dataStore;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConfiguration.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConfiguration.java
new file mode 100644
index 0000000..3deabee
--- /dev/null
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConfiguration.java
@@ -0,0 +1,476 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora;
+
+import com.google.common.base.Strings;
+import org.apache.hadoop.conf.Configuration;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Strings.isNullOrEmpty;
+
+
+/**
+ * Gora Configuration.
+ *
+ * @author ipolyzos
+ */
+public class GoraConfiguration {
+
+    /**
+     * key type
+     */
+    private String keyClass;
+
+    /**
+     * configuration
+     */
+    private Configuration hadoopConfiguration;
+
+    /**
+     * value type
+     */
+    private String valueClass;
+
+    /**
+     *  dataStore type
+     */
+    private String dataStoreClass;
+
+    /** Consumer only properties! */
+
+    /**
+     *  Gora Query Start Time attribute
+     */
+    private long startTime;
+
+    /**
+     * Gora Query End Time attribute
+     */
+    private long endTime;
+
+    /**
+     * Gora Query Time Range From attribute
+     */
+    private long timeRangeFrom;
+
+    /**
+     * Gora Query Key Range To attribute
+     */
+    private long timeRangeTo;
+
+    /**
+     * Gora Query Limit attribute
+     */
+    private long limit;
+
+    /**
+     * Gora Query Timestamp attribute
+     */
+    private long timestamp;
+
+    /**
+     * Gora Query Start Key attribute
+     */
+    private Object startKey;
+
+    /**
+     * Gora Query End Key attribute
+     */
+    private Object endKey;
+
+    /**
+     * Gora Query Key Range From attribute
+     */
+    private Object keyRangeFrom;
+
+    /**
+     * Gora Query Key Range To attribute
+     */
+    private Object keyRangeTo;
+
+
+    /**
+     * Gora Query Fields attribute
+     */
+    private Strings fields;
+
+    /**
+     * Concurrent Consumers
+     *
+     * <b>NOTE:<b/> used only by consumer
+     */
+    private int concurrentConsumers = 1;
+
+    /**
+     * Flush on every operation
+     *
+     * <b>NOTE:<b/> used only by producer
+     */
+    private boolean flushOnEveryOperation = true;
+
+    /**
+     * Default Constructor
+     */
+    public GoraConfiguration() {
+
+        this.hadoopConfiguration = new Configuration();
+    }
+
+    /**
+     * Get type of the key (i.e clients)
+     *
+     * @return key class
+     */
+    public String getKeyClass() {
+
+        return keyClass;
+    }
+
+    /**
+     * Set type class of the key
+     *
+     * @param keyClass
+     */
+    public void setKeyClass(final String keyClass) {
+
+        if (isNullOrEmpty(keyClass)){
+
+            throw new IllegalArgumentException("Key class could not be null or empty!");
+        }
+
+        this.keyClass = keyClass;
+    }
+
+    /**
+     * Get type of the value
+     *
+     * @return
+     */
+    public String getValueClass() {
+
+        return valueClass;
+    }
+
+    /**
+     * Set type of the value
+     *
+     * @param valueClass
+     */
+    public void setValueClass(final String valueClass) {
+
+        if (isNullOrEmpty(valueClass)){
+
+            throw new IllegalArgumentException("Value class  could not be null or empty!");
+        }
+
+        this.valueClass = valueClass;
+    }
+
+    /**
+     * Get type of the dataStore
+     *
+     * @return  DataStore class
+     */
+    public String getDataStoreClass() {
+
+        return dataStoreClass;
+    }
+
+    /**
+     * Set type of the dataStore
+     *
+     * @param dataStoreClass
+     */
+    public void setDataStoreClass(String dataStoreClass) {
+
+
+        if (isNullOrEmpty(dataStoreClass)){
+
+            throw new IllegalArgumentException("DataStore class could not be null or empty!");
+        }
+
+        this.dataStoreClass = dataStoreClass;
+    }
+
+    /**
+     * Get Hadoop Configuration
+     *
+     * @return
+     */
+    public Configuration getHadoopConfiguration() {
+
+        return hadoopConfiguration;
+    }
+
+    /**
+     * Get Start Time
+     *
+     * @return
+     */
+    public long getStartTime() {
+
+        return startTime;
+    }
+
+    /**
+     * Set Start Time
+     *
+     * @return
+     */
+    public void setStartTime(long startTime) {
+
+        this.startTime = startTime;
+    }
+
+    /**
+     * Get End Time
+     *
+     * @return
+     */
+    public long getEndTime() {
+
+        return endTime;
+    }
+
+    /**
+     * Set End Time
+     *
+     * @return
+     */
+    public void setEndTime(long endTime) {
+
+        this.endTime = endTime;
+    }
+
+    /**
+     * Get Time Range From
+     *
+     * @return
+     */
+    public long getTimeRangeFrom() {
+
+        return timeRangeFrom;
+    }
+
+    /**
+     * Set Time Range From
+     *
+     * @return
+     */
+    public void setTimeRangeFrom(long timeRangeFrom) {
+
+        this.timeRangeFrom = timeRangeFrom;
+    }
+
+    /**
+     * Get Time Range To
+     *
+     * @return
+     */
+    public long getTimeRangeTo() {
+
+        return timeRangeTo;
+    }
+
+    /**
+     * Set Time Range To
+     *
+     * @return
+     */
+    public void setTimeRangeTo(long timeRangeTo) {
+
+        this.timeRangeTo = timeRangeTo;
+    }
+
+    /**
+     * Get Limit
+     *
+     * @return
+     */
+    public long getLimit() {
+
+        return limit;
+    }
+
+    /**
+     * Set Limit
+     *
+     * @param limit
+     */
+    public void setLimit(long limit) {
+        this.limit = limit;
+    }
+
+    /**
+     * Get Timestamp
+     *
+     * @return
+     */
+    public long getTimestamp() {
+
+        return timestamp;
+    }
+
+    /**
+     * Set Timestamp
+     *
+     * @param timestamp
+     */
+    public void setTimestamp(long timestamp) {
+
+        this.timestamp = timestamp;
+    }
+
+    /**
+     * Get Start Key
+     *
+     * @return
+     */
+    public Object getStartKey() {
+        return startKey;
+    }
+
+    /**
+     * Set Start Key
+     *
+     * @param startKey
+     */
+    public void setStartKey(Object startKey) {
+        this.startKey = startKey;
+    }
+
+    /**
+     * Get End Key
+     *
+     * @return
+     */
+    public Object getEndKey() {
+        return endKey;
+    }
+
+    /**
+     * Set End Key
+     *
+     * @param endKey
+     */
+    public void setEndKey(Object endKey) {
+        this.endKey = endKey;
+    }
+
+    /**
+     * Get Key Range From
+     * @return
+     */
+    public Object getKeyRangeFrom() {
+        return keyRangeFrom;
+    }
+
+    /**
+     * Set Key Range From
+     *
+     * @param keyRangeFrom
+     */
+    public void setKeyRangeFrom(Object keyRangeFrom) {
+        this.keyRangeFrom = keyRangeFrom;
+    }
+
+    /**
+     * Get Key Range To
+     * @return
+     */
+    public Object getKeyRangeTo() {
+        return keyRangeTo;
+    }
+
+    /**
+     * Set Key Range To
+     *
+     * @param keyRangeTo
+     */
+    public void setKeyRangeTo(Object keyRangeTo) {
+        this.keyRangeTo = keyRangeTo;
+    }
+
+    /**
+     * Get Fields
+     *
+     * @return
+     */
+    public Strings getFields() {
+
+        return fields;
+    }
+
+    /**
+     * Set Fields
+     *
+     * @param fields
+     */
+    public void setFields(Strings fields) {
+
+        this.fields = fields;
+    }
+
+    /**
+     * Get Concurrent Consumers
+     * @return
+     */
+    public int getConcurrentConsumers() {
+
+        return concurrentConsumers;
+    }
+
+    /**
+     * Set Concurrent Consumers
+     *
+     * @param concurrentConsumers
+     */
+    public void setConcurrentConsumers(int concurrentConsumers) {
+
+        this.concurrentConsumers = concurrentConsumers;
+    }
+
+    /**
+     * Get flush on every operation
+     *
+     * @return
+     */
+    public boolean isFlushOnEveryOperation() {
+        return flushOnEveryOperation;
+    }
+
+    /**
+     * Set flush on every operation
+     *
+     * @param flushOnEveryOperation
+     */
+    public void setFlushOnEveryOperation(boolean flushOnEveryOperation) {
+        this.flushOnEveryOperation = flushOnEveryOperation;
+    }
+
+    /**
+     * Set Hadoop Configuration
+     *
+     * @param hadoopConfiguration
+     */
+    public void setHadoopConfiguration(Configuration hadoopConfiguration) {
+
+        checkNotNull(hadoopConfiguration,"Hadoop Configuration could not be null!");
+        this.hadoopConfiguration = hadoopConfiguration;
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConstants.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConstants.java
new file mode 100644
index 0000000..de08fb7
--- /dev/null
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConstants.java
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora;
+
+/**
+ * Camel Gora component constants
+ *
+ * @author ipolyzos
+ */
+public final class GoraConstants {
+
+    /**
+     * default DataStore key
+     */
+    public static final String GORA_DEFAULT_DATASTORE_KEY = "gora.datastore.default";
+
+    /**
+     * Private constructor
+     */
+    private GoraConstants() {
+        // prevent instantiation
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConsumer.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConsumer.java
new file mode 100644
index 0000000..51983a4
--- /dev/null
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConsumer.java
@@ -0,0 +1,132 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora;
+
+import org.apache.camel.Consumer;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.gora.utils.GoraUtils;
+import org.apache.camel.impl.ScheduledPollConsumer;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.gora.query.Query;
+import org.apache.gora.query.Result;
+import org.apache.gora.store.DataStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Date;
+import java.util.concurrent.ExecutorService;
+
+/**
+ * Implementation of Camel-Gora {@link Consumer}.
+ *
+ * @author ipolyzos
+ */
+public class GoraConsumer extends ScheduledPollConsumer {
+
+    /**
+     * logger
+     */
+    private static final Logger LOG = LoggerFactory.getLogger(GoraConsumer.class);
+
+    /**
+     * GORA datastore
+     */
+    private final DataStore dataStore;
+
+    /**
+     * Camel-Gora endpoint configuration
+     */
+    private final GoraConfiguration configuration;
+
+    /**
+     * Camel Gora Query
+     */
+    private Query query;
+
+    /**
+     * executor service
+     */
+    private ExecutorService executor;
+
+    /**
+     * Poll run
+     */
+    private boolean firstRun;
+
+
+    /**
+     * Consumer Constructor
+     *
+     * @param endpoint      Reference to the Camel-Gora endpoint
+     * @param processor     Reference to Consumer Processor
+     * @param configuration Reference to Camel-Gora endpoint configuration
+     * @param dataStore     Reference to the datastore
+     */
+    public GoraConsumer(final Endpoint endpoint,
+                        final Processor processor,
+                        final GoraConfiguration configuration,
+                        final DataStore dataStore) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
+
+        super(endpoint, processor);
+
+        this.configuration = configuration;
+        this.dataStore = dataStore;
+
+        this.query = GoraUtils.constractQueryFromConfiguration(this.dataStore, this.configuration);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected int poll() throws Exception {
+
+        final Exchange exchange = this.getEndpoint().createExchange();
+
+        // compute time (aprox) since last update
+        if(firstRun){
+
+            this.query.setStartTime(System.currentTimeMillis());
+        }else{
+
+            this.query.setStartTime(System.currentTimeMillis() - getDelay());
+        }
+
+        //proceed with query
+        final Result result = query.execute();
+
+        LOG.trace("Processing exchange [{}]...", exchange);
+
+        try {
+
+            getProcessor().process(exchange);
+        } finally {
+
+            if (exchange.getException() != null) {
+
+                getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException());
+            }
+        }
+
+        return Long.valueOf(result.getOffset()).intValue();
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java
new file mode 100644
index 0000000..2674013
--- /dev/null
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java
@@ -0,0 +1,105 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora;
+
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.gora.store.DataStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Gora endpoint
+ *
+ * @author ipolyzos
+ */
+public class GoraEndpoint extends DefaultEndpoint {
+
+    /**
+     * logger
+     */
+    private static final Logger LOG = LoggerFactory.getLogger(GoraEndpoint.class);
+
+    /**
+     * Gora DataStore
+     */
+    private final DataStore dataStore;
+
+    /**
+     * Camel-Gora Endpoint Configuratopn
+     */
+    private GoraConfiguration configuration;
+
+    /**
+     * GORA endpoint default constructor
+     *
+     * @param uri           Endpoint URI
+     * @param goraComponent Reference to the Camel-Gora component
+     * @param config        Reference to Camel-Gora endpoint configuration
+     * @param dataStore     Reference to Gora DataStore
+     */
+    public GoraEndpoint(final String uri,
+                        final GoraComponent goraComponent,
+                        final GoraConfiguration config,
+                        final DataStore dataStore) {
+
+        super(uri, goraComponent);
+        this.configuration = config;
+        this.dataStore = dataStore;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Producer createProducer() throws Exception {
+
+        return new GoraProducer(this, this.configuration, this.dataStore);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Consumer createConsumer(final Processor processor) throws Exception {
+
+        //throw new UnsupportedOperationException("Not supported");
+        return new GoraConsumer(this,processor ,this.configuration, this.dataStore);
+    }
+
+    /**
+     * Get Configutation
+     *
+     * @return
+     */
+    public GoraConfiguration getConfiguration() {
+        return configuration;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isSingleton() {
+
+        return true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraOperation.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraOperation.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraOperation.java
new file mode 100644
index 0000000..3fd4284
--- /dev/null
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraOperation.java
@@ -0,0 +1,85 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.gora;
+
+/**
+ * Camel-Gora Operations.
+ *
+ * @author ipolyzos
+ */
+public enum GoraOperation {
+
+    /**
+     * Gora "put" operation
+     */
+    PUT("put"),
+
+    /**
+     * Gora fetch/"get" operation
+     */
+    GET("get"),
+
+    /**
+     * Gora "delete" operation
+     */
+    DELETE("delete"),
+
+    /**
+     * Gora "get schema name" operation
+     */
+    GET_SCHEMA_NAME("getSchemaName"),
+
+    /**
+     * Gora "delete schema" operation
+     */
+    DELETE_SCHEMA("deleteSchema"),
+
+    /**
+     * Gora "create schema" operation
+     */
+    CREATE_SCHEMA("createSchema"),
+
+    /**
+     * Gora "query" operation
+     */
+    QUERY("query"),
+
+    /**
+     * Gora "deleteByQuery" operation
+     */
+    DELETE_BY_QUERY("deleteByQuery"),
+
+    /**
+     * Gora "schemaExists" operation
+     */
+    SCHEMA_EXIST("schemaExists");
+
+    /**
+     * Enum value
+     */
+    public final String value;
+
+    /**
+     * Enum constructor
+     *
+     * @param str Operation Value
+     */
+    private GoraOperation(final String str) {
+
+        value = str;
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraProducer.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraProducer.java
new file mode 100644
index 0000000..d395fc6
--- /dev/null
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraProducer.java
@@ -0,0 +1,131 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.ServicePoolAware;
+import org.apache.camel.impl.DefaultProducer;
+import org.apache.gora.store.DataStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Map;
+
+import static org.apache.camel.component.gora.utils.GoraUtils.*;
+
+/**
+ * Camel-Gora {@link DefaultProducer}.
+ *
+ * @author ipolyzos
+ */
+public class GoraProducer extends DefaultProducer implements ServicePoolAware {
+
+    /**
+     * logger
+     */
+    private static final Logger LOG = LoggerFactory.getLogger(GoraProducer.class);
+
+    /**
+     * Camel-Gora endpoint configuration
+     */
+    private final GoraConfiguration configuration;
+
+    /**
+     * GORA datastore
+     */
+    private final DataStore dataStore;
+
+    /**
+     * Constructor
+     *
+     * @param endpoint      Reference to the Camel-Gora endpoint
+     * @param configuration Reference to Camel-Gora endpoint configuration
+     * @param dataStore     Reference to the datastore
+     */
+    public GoraProducer(final Endpoint endpoint,
+                        final GoraConfiguration configuration,
+                        final DataStore dataStore) {
+
+        super(endpoint);
+        this.dataStore = dataStore;
+        this.configuration = configuration;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void process(final Exchange exchange) throws Exception {
+
+        final String operation = (String) exchange.getIn().getHeader(GoraAttribute.GORA_OPERATION.value);
+
+        if (operation == null || operation.isEmpty()) {
+
+            throw new RuntimeException("Gora operation is null or empty!");
+        }
+
+        Object result = 0; // 0 used as default response in order to avoid null body exception
+
+        if (GoraOperation.PUT.value.equalsIgnoreCase(operation)) {
+
+            dataStore.put(getKeyFromExchange(exchange), getValueFromExchange(exchange));
+        } else if (GoraOperation.GET.value.equalsIgnoreCase(operation)) {
+
+            result = dataStore.get(getKeyFromExchange(exchange));
+        } else if (GoraOperation.DELETE.value.equalsIgnoreCase(operation)) {
+
+            result = dataStore.delete(getKeyFromExchange(exchange));
+        } else if (GoraOperation.QUERY.value.equalsIgnoreCase(operation)) {
+
+            final Map<String,Object> props = exchange.getIn().getHeaders();
+            result = constractQueryFromPropertiesMap(props,dataStore,this.configuration).execute();
+        } else if (GoraOperation.DELETE_BY_QUERY.value.equalsIgnoreCase(operation)) {
+
+            final Map<String,Object> props = exchange.getIn().getHeaders();
+            result = dataStore.deleteByQuery(constractQueryFromPropertiesMap(props,dataStore,this.configuration));
+        } else if (GoraOperation.GET_SCHEMA_NAME.value.equalsIgnoreCase(operation)) {
+
+            result = dataStore.getSchemaName();
+        } else if (GoraOperation.DELETE_SCHEMA.value.equalsIgnoreCase(operation)) {
+
+            dataStore.deleteSchema();
+        } else if (GoraOperation.CREATE_SCHEMA.value.equalsIgnoreCase(operation)) {
+
+            dataStore.createSchema();
+        } else if (GoraOperation.SCHEMA_EXIST.value.equalsIgnoreCase(operation)) {
+
+            result = dataStore.schemaExists();
+        }else {
+
+            throw new RuntimeException("Unknown operation!");
+        }
+
+        /*
+           from the tests auto-flush seems not to work always
+           therefore a temporary solution is calling flush
+           on every action
+        */
+        if (configuration.isFlushOnEveryOperation()){
+            dataStore.flush();
+        }
+
+        exchange.getOut().setBody(result);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/java/org/apache/camel/component/gora/utils/GoraUtils.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/utils/GoraUtils.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/utils/GoraUtils.java
new file mode 100644
index 0000000..bec9de4
--- /dev/null
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/utils/GoraUtils.java
@@ -0,0 +1,326 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora.utils;
+
+import com.google.common.base.Objects;
+import org.apache.camel.Exchange;
+import org.apache.camel.component.gora.GoraAttribute;
+import org.apache.camel.component.gora.GoraConfiguration;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.gora.persistency.Persistent;
+import org.apache.gora.query.Query;
+import org.apache.gora.store.DataStore;
+import org.apache.gora.store.DataStoreFactory;
+import org.apache.gora.util.GoraException;
+import org.apache.gora.util.IOUtils;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Map;
+
+import static com.google.common.base.Preconditions.*;
+
+/**
+ * GoraUtil class contain utility methods for the
+ * camel component.
+ *
+ * @author ipolyzos
+ */
+public class GoraUtils {
+
+
+
+    /**
+     * Private Constructor to prevent
+     * instantiation of the class.
+     */
+    private GoraUtils() {
+
+        // utility Class
+    }
+
+    /**
+     * Utility method to construct a new query from the exchange
+     *
+     * <b>NOTE:</b> values used in order construct the query
+     * should be stored in the "in" message headers.
+     *
+     * @param dataStore
+     * @param conf
+     * @return
+     * @throws ClassNotFoundException
+     * @throws IllegalAccessException
+     * @throws NoSuchMethodException
+     * @throws InvocationTargetException
+     */
+    public static Query<?, ? extends Persistent> constractQueryFromConfiguration(final DataStore dataStore,
+                                                                                 final GoraConfiguration conf) throws ClassNotFoundException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+
+
+        final Query query = dataStore.newQuery();
+
+        if (configurationExist(GoraAttribute.GORA_QUERY_START_TIME, conf)) {
+            query.setStartTime(getAttributeAsLong(GoraAttribute.GORA_QUERY_START_TIME, conf));
+        }
+
+        if (configurationExist(GoraAttribute.GORA_QUERY_END_TIME, conf)) {
+            query.setEndTime(getAttributeAsLong(GoraAttribute.GORA_QUERY_END_TIME, conf));
+        }
+
+        if (configurationExist(GoraAttribute.GORA_QUERY_LIMIT, conf)) {
+            query.setLimit(getAttributeAsLong(GoraAttribute.GORA_QUERY_LIMIT, conf));
+        }
+
+        if (configurationExist(GoraAttribute.GORA_QUERY_TIME_RANGE_FROM, conf)
+                && configurationExist(GoraAttribute.GORA_QUERY_TIME_RANGE_TO, conf)) {
+            query.setTimeRange(getAttributeAsLong(GoraAttribute.GORA_QUERY_TIME_RANGE_FROM, conf),
+                    getAttributeAsLong(GoraAttribute.GORA_QUERY_TIME_RANGE_TO, conf));
+        }
+
+        if (configurationExist(GoraAttribute.GORA_QUERY_TIMESTAMP, conf)) {
+            query.setTimestamp(getAttributeAsLong(GoraAttribute.GORA_QUERY_TIMESTAMP, conf));
+        }
+
+        if (configurationExist(GoraAttribute.GORA_QUERY_START_KEY, conf)) {
+            query.setStartKey(getAttribute(GoraAttribute.GORA_QUERY_START_KEY, conf));
+        }
+
+        if (configurationExist(GoraAttribute.GORA_QUERY_END_KEY, conf)) {
+            query.setEndKey(getAttribute(GoraAttribute.GORA_QUERY_END_KEY, conf));
+        }
+
+        if (configurationExist(GoraAttribute.GORA_QUERY_KEY_RANGE_FROM, conf)
+                && configurationExist(GoraAttribute.GORA_QUERY_KEY_RANGE_TO, conf)) {
+            query.setKeyRange(getAttribute(GoraAttribute.GORA_QUERY_KEY_RANGE_FROM, conf),
+                    getAttribute(GoraAttribute.GORA_QUERY_KEY_RANGE_TO, conf));
+        }
+
+        return query;
+    }
+
+    /**
+     * Utility method to construct a new query from the exchange
+     *
+     * <b>NOTE:</b> values used in order construct the query
+     * should be stored in the "in" message headers.
+     *
+     * @param propertiesMap
+     * @param dataStore
+     * @param conf
+     * @return
+     * @throws ClassNotFoundException
+     */
+    public static Query<?, ? extends Persistent> constractQueryFromPropertiesMap(final Map<String, ?> propertiesMap,
+                                                                                 final DataStore dataStore,
+                                                                                 final GoraConfiguration conf) throws ClassNotFoundException {
+
+
+        final Query query = dataStore.newQuery();
+
+        if (propertyExist(GoraAttribute.GORA_QUERY_START_TIME, propertiesMap)) {
+            query.setStartTime(getPropertyAsLong(GoraAttribute.GORA_QUERY_START_TIME, propertiesMap));
+        }
+
+        if (propertyExist(GoraAttribute.GORA_QUERY_END_TIME, propertiesMap)) {
+            query.setEndTime(getPropertyAsLong(GoraAttribute.GORA_QUERY_END_TIME, propertiesMap));
+        }
+
+        if (propertyExist(GoraAttribute.GORA_QUERY_LIMIT, propertiesMap)) {
+            query.setLimit(getPropertyAsLong(GoraAttribute.GORA_QUERY_LIMIT, propertiesMap));
+        }
+
+        if (propertyExist(GoraAttribute.GORA_QUERY_TIME_RANGE_FROM, propertiesMap)
+                && propertyExist(GoraAttribute.GORA_QUERY_TIME_RANGE_TO, propertiesMap)) {
+                    query.setTimeRange(getPropertyAsLong(GoraAttribute.GORA_QUERY_TIME_RANGE_FROM, propertiesMap),
+                    getPropertyAsLong(GoraAttribute.GORA_QUERY_TIME_RANGE_TO, propertiesMap));
+        }
+
+        if (propertyExist(GoraAttribute.GORA_QUERY_TIMESTAMP, propertiesMap)) {
+            query.setTimestamp(getPropertyAsLong(GoraAttribute.GORA_QUERY_TIMESTAMP, propertiesMap));
+        }
+
+        if (propertyExist(GoraAttribute.GORA_QUERY_START_KEY, propertiesMap)) {
+            query.setStartKey(getProperty(GoraAttribute.GORA_QUERY_START_KEY, propertiesMap));
+        }
+
+        if (propertyExist(GoraAttribute.GORA_QUERY_END_KEY, propertiesMap)) {
+            query.setStartKey(getProperty(GoraAttribute.GORA_QUERY_END_KEY, propertiesMap));
+        }
+
+        if (propertyExist(GoraAttribute.GORA_QUERY_KEY_RANGE_FROM, propertiesMap)
+                && propertyExist(GoraAttribute.GORA_QUERY_KEY_RANGE_TO, propertiesMap)) {
+            query.setKeyRange(getProperty(GoraAttribute.GORA_QUERY_KEY_RANGE_FROM, propertiesMap),
+                    getProperty(GoraAttribute.GORA_QUERY_KEY_RANGE_TO, propertiesMap));
+        }
+
+        return query;
+    }
+
+    /**
+     * Utility method to check if a value exist in the configuration class
+     *
+     * <b>NOTE:</>
+     * Checks only if is not null
+     *
+     * @param attr
+     * @param conf
+     * @return
+     * @throws IllegalAccessException
+     * @throws NoSuchMethodException
+     * @throws InvocationTargetException
+     */
+    protected static boolean configurationExist(final GoraAttribute attr,
+                                                final GoraConfiguration conf) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+
+        return (PropertyUtils.getSimpleProperty(conf, attr.value) != null);
+    }
+
+    /**
+     * Utility method to check if a value exist in the properties map
+     *
+     * @param attr
+     * @param propertiesMap
+     * @return
+     */
+    protected static boolean propertyExist(final GoraAttribute attr,
+                                           final Map<String, ?> propertiesMap) {
+
+        return propertiesMap.containsKey(attr.value);
+    }
+
+
+    /**
+     * Utility method to extract value from configuration
+     *
+     * @param attr
+     * @param conf
+     * @return
+     * @throws IllegalAccessException
+     * @throws NoSuchMethodException
+     * @throws InvocationTargetException
+     */
+    protected static Object getAttribute(final GoraAttribute attr,
+                                         final GoraConfiguration conf) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+
+        return PropertyUtils.getSimpleProperty(conf, attr.value);
+    }
+
+    /**
+     * Utility method to extract value from configuration as String
+     *
+     * @param attr
+     * @param conf
+     * @return
+     * @throws IllegalAccessException
+     * @throws NoSuchMethodException
+     * @throws InvocationTargetException
+     */
+    protected static String getAttributeAsString(final GoraAttribute attr,
+                                                 final GoraConfiguration conf) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+
+        return String.valueOf(getAttribute(attr, conf));
+    }
+
+
+    /**
+     * Utility method to extract value from configuration as Long
+     *
+     * @param attr
+     * @param conf
+     * @return
+     * @throws IllegalAccessException
+     * @throws NoSuchMethodException
+     * @throws InvocationTargetException
+     */
+    protected static Long getAttributeAsLong(final GoraAttribute attr,
+                                           final GoraConfiguration conf) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+
+        return Long.parseLong(getAttributeAsString(attr,conf));
+    }
+
+    /**
+     * Utility method to extract value of a map
+     *
+     * @param attr
+     * @param propertiesMap
+     * @return
+     */
+    protected static Object getProperty(final GoraAttribute attr,
+                                        final Map<String, ?> propertiesMap) {
+
+        return propertiesMap.get(attr.value);
+    }
+
+    /**
+     * Utility method to extract value of a map as String
+     *
+     * @param attr
+     * @param propertiesMap
+     * @return
+     */
+    protected static String getPropertyAsString(final GoraAttribute attr,
+                                              final Map<String, ?> propertiesMap) {
+
+        return String.valueOf(getProperty(attr, propertiesMap));
+    }
+
+    /**
+     * Utility method to extract value of a map as long
+     *
+     * @param attr
+     * @param propertiesMap
+     * @return
+     */
+    protected static Long getPropertyAsLong(final GoraAttribute attr,
+                                          final Map<String, ?> propertiesMap) {
+
+        return Long.parseLong(getPropertyAsString(attr, propertiesMap));
+    }
+
+
+    /**
+     * Utility method to extract GORA key from the exchange
+     *
+     * <b>NOTE:</b> key value expected to be stored
+     * in the "in" message headers.
+     *
+     * @param exchange The Camel Exchange
+     * @return The key
+     */
+    public static Object getKeyFromExchange(Exchange exchange) {
+
+        final Object key = exchange.getIn().getHeader(GoraAttribute.GORA_KEY.value);
+
+        checkNotNull(key, "Key should not be null!");
+        return key;
+    }
+
+    /**
+     * Utility method to extract the value from the exchange
+     *
+     * <b>NOTE:</b> the value expected to be instance
+     * of persistent type.
+     *
+     * @param exchange The Camel Exchange
+     * @return The value
+     */
+    public static Persistent getValueFromExchange(Exchange exchange) {
+
+        return exchange.getIn().getBody(Persistent.class);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/resources/META-INF/LICENSE.txt
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/resources/META-INF/LICENSE.txt b/components/camel-gora/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/components/camel-gora/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/resources/META-INF/NOTICE.txt
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/resources/META-INF/NOTICE.txt b/components/camel-gora/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/components/camel-gora/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+   =========================================================================
+   ==  NOTICE file corresponding to the section 4 d of                    ==
+   ==  the Apache License, Version 2.0,                                   ==
+   ==  in this case for the Apache Camel distribution.                    ==
+   =========================================================================
+
+   This product includes software developed by
+   The Apache Software Foundation (http://www.apache.org/).
+
+   Please read the different LICENSE files present in the licenses directory of
+   this distribution.

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/main/resources/META-INF/services/org/apache/camel/component/gora
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/resources/META-INF/services/org/apache/camel/component/gora b/components/camel-gora/src/main/resources/META-INF/services/org/apache/camel/component/gora
new file mode 100644
index 0000000..4cb9abb
--- /dev/null
+++ b/components/camel-gora/src/main/resources/META-INF/services/org/apache/camel/component/gora
@@ -0,0 +1,18 @@
+## ------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ------------------------------------------------------------------------
+
+class=org.apache.camel.component.gora.GoraComponent

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConfigurationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConfigurationTest.java b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConfigurationTest.java
new file mode 100644
index 0000000..dcfd548
--- /dev/null
+++ b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConfigurationTest.java
@@ -0,0 +1,78 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora;
+
+import org.junit.Test;
+
+/**
+ * GORA Configuration Tests
+ *
+ * @author ipolyzos
+ */
+public class GoraConfigurationTest {
+
+
+    @Test(expected = IllegalArgumentException.class)
+    public void setKeyClassClassShouldThrowExceptionIfNull(){
+
+        final GoraConfiguration conf = new GoraConfiguration();
+        conf.setValueClass(null);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void setKeyClassShouldThrowExceptionIfEmpty(){
+
+        final GoraConfiguration conf = new GoraConfiguration();
+        conf.setValueClass("");
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void setValueClassClassShouldThrowExceptionIfNull(){
+
+        final GoraConfiguration conf = new GoraConfiguration();
+        conf.setValueClass(null);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void setValueClassClassShouldThrowExceptionIfEmpty(){
+
+        final GoraConfiguration conf = new GoraConfiguration();
+        conf.setValueClass("");
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void setDataStoreClassShouldThrowExceptionIfNull(){
+
+        final GoraConfiguration conf = new GoraConfiguration();
+        conf.setDataStoreClass(null);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void setDataStoreClassShouldThrowExceptionIfEmpty(){
+
+        final GoraConfiguration conf = new GoraConfiguration();
+        conf.setDataStoreClass("");
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void setHadoopConfigurationShouldThrowExceptionIfNull(){
+
+        final GoraConfiguration conf = new GoraConfiguration();
+        conf.setHadoopConfiguration(null);
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConsumerTest.java b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConsumerTest.java
new file mode 100644
index 0000000..605591c
--- /dev/null
+++ b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConsumerTest.java
@@ -0,0 +1,103 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Message;
+import org.apache.camel.Processor;
+import org.apache.camel.component.gora.utils.GoraUtils;
+import org.apache.gora.query.Query;
+import org.apache.gora.store.DataStore;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.lang.reflect.InvocationTargetException;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+/**
+ * GORA Consumer Tests
+ *
+ * @author ipolyzos
+ */
+public class GoraConsumerTest extends GoraTestSupport {
+
+    /**
+     * Mock CamelExchange
+     */
+    private Exchange mockCamelExchange;
+
+    /**
+     * Mock Gora Endpoint
+     */
+    private GoraEndpoint mockGoraEndpoint;
+
+    /**
+     * Mock Gora Configuration
+     */
+    private GoraConfiguration mockGoraConfiguration;
+
+    /**
+     * Mock Camel Message
+     */
+    private Message mockCamelMessage;
+
+    /**
+     * Mock Gora DataStore
+     */
+    private DataStore mockDatastore;
+
+    /**
+     * Mock Processor
+     */
+    private Processor mockGoraProcessor;
+
+    /**
+     * Mock GoraUtils
+     */
+    private GoraUtils mockGoraUtils;
+
+    @Before
+    public void setUp()  {
+
+        //setup mocks
+        mockCamelExchange = mock(Exchange.class);
+        mockGoraEndpoint = mock(GoraEndpoint.class);
+        mockGoraConfiguration = mock(GoraConfiguration.class);
+        mockCamelMessage = mock(Message.class);
+        mockDatastore = mock(DataStore.class);
+        mockGoraUtils = mock(GoraUtils.class);
+
+        //setup default conditions
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelExchange.getPattern()).thenReturn(ExchangePattern.InOnly);
+    }
+
+
+    @Test
+    public void consumerInstantiationWithMocksShouldSucceed() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
+
+
+        final Query mockQuery = mock(Query.class);
+        when(mockDatastore.newQuery()).thenReturn(mockQuery);
+        GoraConsumer goraConsumer = new GoraConsumer(mockGoraEndpoint, mockGoraProcessor, mockGoraConfiguration, mockDatastore);
+    }
+
+}


[33/50] [abbrv] git commit: CAMEL-7036 Fixed the issue of Camel XSD validation not working with apache xerces

Posted by ni...@apache.org.
CAMEL-7036 Fixed the issue of Camel XSD validation not working with apache xerces


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f5dafb14
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f5dafb14
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f5dafb14

Branch: refs/heads/camel-gora
Commit: f5dafb1495fe307f6a5aeb4a4adbc85d478d77a9
Parents: 1c1d3a8
Author: Willem Jiang <wi...@gmail.com>
Authored: Wed Dec 4 12:51:50 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Wed Dec 4 12:52:18 2013 +0800

----------------------------------------------------------------------
 .../processor/validation/ValidatingProcessor.java   |  5 ++---
 .../camel/processor/ValidatingProcessorTest.java    | 16 ++++++++++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f5dafb14/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java
index bd9f783..200d0fe 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java
@@ -130,13 +130,12 @@ public class ValidatingProcessor implements AsyncProcessor {
                 }
             }
 
+            //CAMEL-7036 We don't need to set the result if the source is an instance of StreamSource
             if (source instanceof DOMSource) {
                 result = new DOMResult();
-            } else if (source instanceof StreamSource) {
-                result = new StreamResult(new StringWriter());
             } else if (source instanceof SAXSource) {
                 result = new SAXResult();
-            } else if (source instanceof StAXSource) {
+            } else if (source instanceof StAXSource || source instanceof StreamSource) {
                 result = null;
             }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/f5dafb14/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorTest.java
index 2b2175e..0726e2b 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorTest.java
@@ -20,6 +20,7 @@ import java.io.File;
 
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.StringSource;
 import org.apache.camel.ValidationException;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
@@ -56,6 +57,21 @@ public class ValidatingProcessorTest extends ContextTestSupport {
 
         assertMockEndpointsSatisfied();
     }
+    
+    public void testStringSourceMessage() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:valid");
+        mock.expectedMessageCount(1);
+
+        String xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>"
+            + "<user xmlns=\"http://foo.com/bar\">"
+            + "  <id>1</id>"
+            + "  <username>davsclaus</username>"
+            + "</user>";
+
+        template.sendBody("direct:start", new StringSource(xml));
+
+        assertMockEndpointsSatisfied();
+    }
 
     public void testValidMessageTwice() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:valid");


[13/50] [abbrv] git commit: Fixed test

Posted by ni...@apache.org.
Fixed test


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/635356ab
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/635356ab
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/635356ab

Branch: refs/heads/camel-gora
Commit: 635356abbfc883d250288e526378ffbcddc5bc0e
Parents: b048537
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Dec 2 09:16:04 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Dec 2 09:16:04 2013 +0100

----------------------------------------------------------------------
 .../util/jsse/SSLContextParametersTest.java     | 51 ++++++++++++--------
 1 file changed, 30 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/635356ab/camel-core/src/test/java/org/apache/camel/util/jsse/SSLContextParametersTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/jsse/SSLContextParametersTest.java b/camel-core/src/test/java/org/apache/camel/util/jsse/SSLContextParametersTest.java
index 11c82b2..bc163c2 100644
--- a/camel-core/src/test/java/org/apache/camel/util/jsse/SSLContextParametersTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/jsse/SSLContextParametersTest.java
@@ -553,13 +553,16 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
         engine = context.createSSLEngine();
         socket = (SSLSocket) context.getSocketFactory().createSocket();
         serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
-        
-        assertTrue(engine.getEnabledCipherSuites().length >= 1);
-        assertStartsWith(engine.getEnabledCipherSuites(), "TLS");
-        assertTrue(socket.getEnabledCipherSuites().length >= 1);
-        assertStartsWith(socket.getEnabledCipherSuites(), "TLS");
-        assertTrue(serverSocket.getEnabledCipherSuites().length >= 1);
-        assertStartsWith(serverSocket.getEnabledCipherSuites(), "TLS");
+
+        // not all platforms/JDKs have these cipher suites
+        if (!isPlatform("aix")) {
+            assertTrue(engine.getEnabledCipherSuites().length >= 1);
+            assertStartsWith(engine.getEnabledCipherSuites(), "TLS");
+            assertTrue(socket.getEnabledCipherSuites().length >= 1);
+            assertStartsWith(socket.getEnabledCipherSuites(), "TLS");
+            assertTrue(serverSocket.getEnabledCipherSuites().length >= 1);
+            assertStartsWith(serverSocket.getEnabledCipherSuites(), "TLS");
+        }
     }
 
     public void testSecureSocketProtocols() throws Exception {
@@ -619,13 +622,16 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
         engine = context.createSSLEngine();
         socket = (SSLSocket) context.getSocketFactory().createSocket();
         serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
-        
-        assertEquals(1, engine.getEnabledProtocols().length);
-        assertEquals("TLSv1", engine.getEnabledProtocols()[0]);
-        assertEquals(1, socket.getEnabledProtocols().length);
-        assertEquals("TLSv1", socket.getEnabledProtocols()[0]);
-        assertEquals(1, socket.getEnabledProtocols().length);
-        assertEquals("TLSv1", serverSocket.getEnabledProtocols()[0]);        
+
+        // not all platforms/JDKs have these cipher suites
+        if (!isPlatform("aix")) {
+            assertEquals(1, engine.getEnabledProtocols().length);
+            assertEquals("TLSv1", engine.getEnabledProtocols()[0]);
+            assertEquals(1, socket.getEnabledProtocols().length);
+            assertEquals("TLSv1", socket.getEnabledProtocols()[0]);
+            assertEquals(1, socket.getEnabledProtocols().length);
+            assertEquals("TLSv1", serverSocket.getEnabledProtocols()[0]);
+        }
     }
     
     public void testSecureSocketProtocolsFilter() throws Exception {
@@ -692,13 +698,16 @@ public class SSLContextParametersTest extends AbstractJsseParametersTest {
         engine = context.createSSLEngine();
         socket = (SSLSocket) context.getSocketFactory().createSocket();
         serverSocket = (SSLServerSocket) context.getServerSocketFactory().createServerSocket();
-        
-        assertTrue(engine.getEnabledProtocols().length >= 1);
-        assertStartsWith(engine.getEnabledProtocols(), "TLS");
-        assertTrue(socket.getEnabledProtocols().length >= 1);
-        assertStartsWith(socket.getEnabledProtocols(), "TLS");
-        assertTrue(socket.getEnabledProtocols().length >= 1);
-        assertStartsWith(serverSocket.getEnabledProtocols(), "TLS");        
+
+        // not all platforms/JDKs have these cipher suites
+        if (!isPlatform("aix")) {
+            assertTrue(engine.getEnabledProtocols().length >= 1);
+            assertStartsWith(engine.getEnabledProtocols(), "TLS");
+            assertTrue(socket.getEnabledProtocols().length >= 1);
+            assertStartsWith(socket.getEnabledProtocols(), "TLS");
+            assertTrue(socket.getEnabledProtocols().length >= 1);
+            assertStartsWith(serverSocket.getEnabledProtocols(), "TLS");
+        }
     }
     
     public void testSessionTimeout() throws Exception {


[05/50] [abbrv] git commit: Upgraded to karaf 2.3.3.

Posted by ni...@apache.org.
Upgraded to karaf 2.3.3.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/46b5128f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/46b5128f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/46b5128f

Branch: refs/heads/camel-gora
Commit: 46b5128fc44bf29445e893eb87479c951b268420
Parents: d2d305e
Author: Babak Vahdat <bv...@apache.org>
Authored: Thu Nov 28 22:52:44 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Thu Nov 28 22:52:44 2013 +0100

----------------------------------------------------------------------
 platforms/karaf/features/src/main/resources/config.properties | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/46b5128f/platforms/karaf/features/src/main/resources/config.properties
----------------------------------------------------------------------
diff --git a/platforms/karaf/features/src/main/resources/config.properties b/platforms/karaf/features/src/main/resources/config.properties
index 7875d6a..d85b437 100755
--- a/platforms/karaf/features/src/main/resources/config.properties
+++ b/platforms/karaf/features/src/main/resources/config.properties
@@ -35,9 +35,9 @@ org.osgi.framework.system.packages= \
  org.osgi.service.packageadmin;uses:="org.osgi.framework";version="1.2",\
  org.osgi.service.url;version="1.0", \
  org.osgi.util.tracker;uses:="org.osgi.framework";version="1.5.1", \
- org.apache.karaf.jaas.boot;version="2.3.2", \
- org.apache.karaf.jaas.boot.principal;version="2.3.2", \
- org.apache.karaf.version;version="2.3.2", \
+ org.apache.karaf.jaas.boot;version="2.3.3", \
+ org.apache.karaf.jaas.boot.principal;version="2.3.3", \
+ org.apache.karaf.version;version="2.3.3", \
  ${jre-${java.specification.version}}
 
 org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com.sun.*,javax.transaction,javax.transaction.*


[25/50] [abbrv] git commit: CAMEL-7030: quartz components now register the quartz scheduler in JMX by default, unless configured not to do so by end user. Fixed route policy tests using custom date type instead of using the java.util.Date.

Posted by ni...@apache.org.
CAMEL-7030: quartz components now register the quartz scheduler in JMX by default, unless configured not to do so by end user. Fixed route policy tests using custom date type instead of using the java.util.Date.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/31b419c9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/31b419c9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/31b419c9

Branch: refs/heads/camel-gora
Commit: 31b419c9d4959a98b1ad99dae6952cdf384f1798
Parents: 125d751
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Dec 3 10:49:27 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Dec 3 10:49:50 2013 +0100

----------------------------------------------------------------------
 .../camel/component/quartz/QuartzComponent.java | 19 ++++++
 .../camel/component/quartz/BaseQuartzTest.java  | 38 +++++++++++
 .../quartz/QuartUnderscoreTimerNameTest.java    |  3 +-
 .../quartz/QuartzAddDynamicRouteTest.java       |  3 +-
 ...tzAddRoutesAfterCamelContextStartedTest.java |  3 +-
 .../component/quartz/QuartzAutoStartTest.java   |  3 +-
 .../component/quartz/QuartzComponentTest.java   |  3 +-
 .../component/quartz/QuartzCronRouteTest.java   |  3 +-
 .../QuartzCronRouteWithSmallCacheTest.java      |  3 +-
 .../quartz/QuartzEndpointConfigureTest.java     |  3 +-
 .../quartz/QuartzJobRouteUnderscoreTest.java    |  3 +-
 .../component/quartz/QuartzManagementTest.java  | 72 ++++++++++++++++++++
 .../component/quartz/QuartzPropertiesTest.java  |  3 +-
 .../quartz/QuartzRouteRestartTest.java          |  3 +-
 .../camel/component/quartz/QuartzRouteTest.java |  3 +-
 .../quartz/QuartzStartDelayedOptionTest.java    |  3 +-
 .../quartz/QuartzStartDelayedTest.java          |  3 +-
 .../component/quartz/QuartzStopRouteTest.java   |  3 +-
 .../quartz/QuartzSuspendRouteTest.java          |  3 +-
 .../quartz/StatefulQuartzRouteTest.java         |  3 +-
 .../camel/routepolicy/quartz/DateFactory.java   | 29 ++++++++
 .../camel/routepolicy/quartz/SimpleDate.java    | 33 ---------
 .../camel/routepolicy/quartz/CronPolicies.xml   | 50 +++++++-------
 .../routepolicy/quartz/MultiplePolicies.xml     | 36 +++++-----
 .../camel/routepolicy/quartz/SimplePolicies.xml | 12 ++--
 .../component/quartz2/QuartzComponent.java      | 28 +++++++-
 .../camel/component/quartz2/BaseQuartzTest.java | 38 +++++++++++
 .../quartz2/QuartUnderscoreTimerNameTest.java   |  3 +-
 .../quartz2/QuartzAddDynamicRouteTest.java      |  3 +-
 ...tzAddRoutesAfterCamelContextStartedTest.java |  3 +-
 .../component/quartz2/QuartzAutoStartTest.java  |  3 +-
 .../component/quartz2/QuartzComponentTest.java  |  3 +-
 .../component/quartz2/QuartzCronRouteTest.java  |  3 +-
 .../QuartzCronRouteWithSmallCacheTest.java      |  3 +-
 .../quartz2/QuartzEndpointConfigureTest.java    |  3 +-
 .../quartz2/QuartzJobRouteUnderscoreTest.java   |  3 +-
 .../component/quartz2/QuartzManagementTest.java | 72 ++++++++++++++++++++
 .../component/quartz2/QuartzPropertiesTest.java |  3 +-
 .../quartz2/QuartzRepeatIntervalTest.java       |  3 +-
 .../quartz2/QuartzRouteFireNowTest.java         |  2 +-
 .../quartz2/QuartzRouteRestartTest.java         |  3 +-
 .../component/quartz2/QuartzRouteTest.java      |  3 +-
 .../quartz2/QuartzSimpleRouteTest.java          |  3 +-
 .../quartz2/QuartzStartDelayedOptionTest.java   |  3 +-
 .../quartz2/QuartzStartDelayedTest.java         |  3 +-
 .../quartz2/QuartzStatefulJobRouteTest.java     |  4 +-
 .../component/quartz2/QuartzStopRouteTest.java  |  3 +-
 .../quartz2/QuartzSuspendRouteTest.java         |  3 +-
 .../quartz2/StatefulQuartzRouteTest.java        |  3 +-
 .../camel/routepolicy/quartz2/DateFactory.java  | 30 ++++++++
 .../camel/routepolicy/quartz2/SimpleDate.java   | 33 ---------
 .../camel/routepolicy/quartz2/CronPolicies.xml  | 50 +++++++-------
 .../routepolicy/quartz2/MultiplePolicies.xml    | 36 +++++-----
 .../routepolicy/quartz2/SimplePolicies.xml      | 70 ++++++++++---------
 54 files changed, 492 insertions(+), 268 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
index 0ea7a85..51fea39 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
@@ -60,6 +60,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
     private String propertiesFile;
     private int startDelayedSeconds;
     private boolean autoStartScheduler = true;
+    private boolean enableJmx = true;
 
     private static final class JobToAdd {
         private final JobDetail job;
@@ -410,6 +411,14 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
         this.autoStartScheduler = autoStartScheduler;
     }
 
+    public boolean isEnableJmx() {
+        return enableJmx;
+    }
+
+    public void setEnableJmx(boolean enableJmx) {
+        this.enableJmx = enableJmx;
+    }
+
     // Implementation methods
     // -------------------------------------------------------------------------
 
@@ -440,6 +449,11 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             // force disabling update checker (will do online check over the internet)
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
 
+            // enable jmx unless configured to not do so
+            if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
+                prop.put("org.quartz.scheduler.jmx.export", "true");
+            }
+
             answer = new StdSchedulerFactory(prop);
         } else {
             // read default props to be able to use a single scheduler per camel context
@@ -472,6 +486,11 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             // force disabling update checker (will do online check over the internet)
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
 
+            // enable jmx unless configured to not do so
+            if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
+                prop.put("org.quartz.scheduler.jmx.export", "true");
+            }
+
             answer = new StdSchedulerFactory(prop);
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/BaseQuartzTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/BaseQuartzTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/BaseQuartzTest.java
new file mode 100644
index 0000000..512d48b
--- /dev/null
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/BaseQuartzTest.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.quartz;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+
+public class BaseQuartzTest extends CamelTestSupport {
+
+    protected boolean isEnableJmx() {
+        return true;
+    }
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext context = super.createCamelContext();
+
+        QuartzComponent quartz = context.getComponent("quartz", QuartzComponent.class);
+        quartz.setEnableJmx(isEnableJmx());
+
+        return context;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartUnderscoreTimerNameTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartUnderscoreTimerNameTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartUnderscoreTimerNameTest.java
index de05229..b569319 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartUnderscoreTimerNameTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartUnderscoreTimerNameTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartUnderscoreTimerNameTest extends CamelTestSupport {
+public class QuartUnderscoreTimerNameTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRouteUnderscore() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddDynamicRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddDynamicRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddDynamicRouteTest.java
index 267203c..00bffec 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddDynamicRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddDynamicRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAddDynamicRouteTest extends CamelTestSupport {
+public class QuartzAddDynamicRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddRoutesAfterCamelContextStartedTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddRoutesAfterCamelContextStartedTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddRoutesAfterCamelContextStartedTest.java
index 9a14753..1a03af9 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddRoutesAfterCamelContextStartedTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAddRoutesAfterCamelContextStartedTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAddRoutesAfterCamelContextStartedTest extends CamelTestSupport {
+public class QuartzAddRoutesAfterCamelContextStartedTest extends BaseQuartzTest {
 
     @Test
     public void testAddRoutes() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAutoStartTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAutoStartTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAutoStartTest.java
index fab17a4..99aff2c 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAutoStartTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzAutoStartTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAutoStartTest extends CamelTestSupport {
+public class QuartzAutoStartTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzAutoStart() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzComponentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzComponentTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzComponentTest.java
index aa66416..d77dc32 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzComponentTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzComponentTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.quartz;
 
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.Scheduler;
 import org.quartz.SchedulerFactory;
@@ -25,7 +24,7 @@ import org.quartz.impl.StdSchedulerFactory;
 /**
  * @version 
  */
-public class QuartzComponentTest extends CamelTestSupport {
+public class QuartzComponentTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzComponentCustomScheduler() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
index 5ad38a5..22d2b4c 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzCronRouteTest extends CamelTestSupport {
+public class QuartzCronRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteWithSmallCacheTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteWithSmallCacheTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteWithSmallCacheTest.java
index 21cbc2e..02090dd 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteWithSmallCacheTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzCronRouteWithSmallCacheTest.java
@@ -23,7 +23,6 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
@@ -32,7 +31,7 @@ import org.junit.Test;
  * <p/>
  * We simulate this behavior with a capacity of 1 element.
  */
-public class QuartzCronRouteWithSmallCacheTest extends CamelTestSupport {
+public class QuartzCronRouteWithSmallCacheTest extends BaseQuartzTest {
 
     private final CountDownLatch latch = new CountDownLatch(3);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java
index 234a955..b338cd6 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzEndpointConfigureTest.java
@@ -17,7 +17,6 @@
 package org.apache.camel.component.quartz;
 
 import org.apache.camel.Endpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.CronTrigger;
 import org.quartz.SimpleTrigger;
@@ -26,7 +25,7 @@ import org.quartz.Trigger;
 /**
  * @version 
  */
-public class QuartzEndpointConfigureTest extends CamelTestSupport {
+public class QuartzEndpointConfigureTest extends BaseQuartzTest {
 
     @Test
     public void testConfigureGroupAndName() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzJobRouteUnderscoreTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzJobRouteUnderscoreTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzJobRouteUnderscoreTest.java
index 0094d91..70e6dff 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzJobRouteUnderscoreTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzJobRouteUnderscoreTest.java
@@ -18,14 +18,13 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.JobDetail;
 
 /**
  * @version 
  */
-public class QuartzJobRouteUnderscoreTest extends CamelTestSupport {
+public class QuartzJobRouteUnderscoreTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzManagementTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzManagementTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzManagementTest.java
new file mode 100644
index 0000000..b428fed
--- /dev/null
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzManagementTest.java
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.quartz;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
+
+public class QuartzManagementTest extends BaseQuartzTest {
+
+    @Override
+    protected boolean useJmx() {
+        return true;
+    }
+
+    @Override
+    protected boolean isEnableJmx() {
+        return true;
+    }
+
+    protected MBeanServer getMBeanServer() {
+        return context.getManagementStrategy().getManagementAgent().getMBeanServer();
+    }
+
+    @Test
+    public void testQuartzRoute() throws Exception {
+        // JMX tests dont work well on AIX CI servers (hangs them)
+        if (isPlatform("aix")) {
+            return;
+        }
+
+        getMockEndpoint("mock:result").expectedMessageCount(2);
+
+        assertMockEndpointsSatisfied();
+
+        MBeanServer mbeanServer = getMBeanServer();
+
+        String name = String.format("quartz:type=QuartzScheduler,name=DefaultQuartzScheduler-%s,instance=NON_CLUSTERED", context.getManagementName());
+
+        ObjectName on = ObjectName.getInstance(name);
+        assertTrue(mbeanServer.isRegistered(on));
+
+        Boolean started = (Boolean) mbeanServer.getAttribute(on, "Started");
+        assertEquals(true, started);
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("quartz://myGroup/myTimerName?trigger.repeatInterval=2&trigger.repeatCount=1").routeId("myRoute").to("mock:result");
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java
index e663232..4fa0705 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzPropertiesTest.java
@@ -19,14 +19,13 @@ package org.apache.camel.component.quartz;
 import java.io.InputStream;
 import java.util.Properties;
 
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.SchedulerException;
 
 /**
  * @version 
  */
-public class QuartzPropertiesTest extends CamelTestSupport {
+public class QuartzPropertiesTest extends BaseQuartzTest {
 
     private QuartzComponent quartz;
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteRestartTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteRestartTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteRestartTest.java
index aa68e74..312efdd 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteRestartTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteRestartTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzRouteRestartTest extends CamelTestSupport {
+public class QuartzRouteRestartTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteTest.java
index 88e51fa..5329e81 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzRouteTest extends CamelTestSupport {
+public class QuartzRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedOptionTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedOptionTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedOptionTest.java
index 1e65965..04ed797 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedOptionTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedOptionTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartzStartDelayedOptionTest extends CamelTestSupport {
+public class QuartzStartDelayedOptionTest extends BaseQuartzTest {
 
     @Test
     public void testStartDelayed() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedTest.java
index c9d56e5..b714c6c 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStartDelayedTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartzStartDelayedTest extends CamelTestSupport {
+public class QuartzStartDelayedTest extends BaseQuartzTest {
 
     @Test
     public void testStartDelayed() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStopRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStopRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStopRouteTest.java
index 6fd3da3..5f3d4c60 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStopRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzStopRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzStopRouteTest extends CamelTestSupport {
+public class QuartzStopRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzStop() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzSuspendRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzSuspendRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzSuspendRouteTest.java
index 3632cbc..145f9b8 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzSuspendRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/QuartzSuspendRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzSuspendRouteTest extends CamelTestSupport {
+public class QuartzSuspendRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzSuspend() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
index 19e6cc1..aecd360 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/StatefulQuartzRouteTest.java
@@ -22,13 +22,12 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class StatefulQuartzRouteTest extends CamelTestSupport {
+public class StatefulQuartzRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/DateFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/DateFactory.java b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/DateFactory.java
new file mode 100644
index 0000000..87f8e52
--- /dev/null
+++ b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/DateFactory.java
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.routepolicy.quartz;
+
+import java.util.Date;
+
+public final class DateFactory {
+
+    private DateFactory() {
+    }
+
+    public static Date createDate(int future) {
+        return new Date(System.currentTimeMillis() + future);
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleDate.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleDate.java b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleDate.java
deleted file mode 100644
index 5cf9f43..0000000
--- a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SimpleDate.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.routepolicy.quartz;
-
-import java.util.Date;
-
-public class SimpleDate extends Date {
-
-    private static final long serialVersionUID = 1L;
-
-    public SimpleDate() {
-        this(3000);
-    }
-
-    public SimpleDate(long milliseconds) {
-        super(System.currentTimeMillis() + milliseconds);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/CronPolicies.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/CronPolicies.xml b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/CronPolicies.xml
index b0ad234..8fc9e6b 100644
--- a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/CronPolicies.xml
+++ b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/CronPolicies.xml
@@ -22,31 +22,29 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="date" class="org.apache.camel.routepolicy.quartz.SimpleDate"/>
-
-    <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy"/>
-
-    <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
-    	<property name="routeStartTime" value="*/3 * * * * ?"/>
-    </bean>
-    
-    <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
-    	<property name="routeStopTime" value="*/3 * * * * ?"/>
-	</bean>
-	
-	<bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
-    	<property name="routeSuspendTime" value="*/3 * * * * ?"/>
-  	</bean>
-  	
-  	<bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
-    	<property name="routeResumeTime" value="*/3 * * * * ?"/>
- 	</bean> 
- 	
-    <routeContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
-        <route id="testRoute">
-            <from uri="direct:start"/>
-            <to uri="mock:success"/>
-        </route>
-    </routeContext>
+  <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy"/>
+
+  <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
+    <property name="routeStartTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
+    <property name="routeStopTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
+    <property name="routeSuspendTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
+    <property name="routeResumeTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <routeContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
+    <route id="testRoute">
+      <from uri="direct:start"/>
+      <to uri="mock:success"/>
+    </route>
+  </routeContext>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/MultiplePolicies.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/MultiplePolicies.xml b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/MultiplePolicies.xml
index 09b2ba3..52c1832 100644
--- a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/MultiplePolicies.xml
+++ b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/MultiplePolicies.xml
@@ -22,23 +22,25 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="date" class="org.apache.camel.routepolicy.quartz.SimpleDate"/>
+  <bean id="now" class="org.apache.camel.routepolicy.quartz.DateFactory" factory-method="createDate">
+    <constructor-arg index="0" value="3000"/>
+  </bean>
 
-    <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
-    	<property name="routeStartDate" ref="date"/>
-    	<property name="routeStartRepeatCount" value="1"/>
-    	<property name="routeStartRepeatInterval" value="3000"/>    	
-    </bean>
-    
-    <bean id="throttlePolicy" class="org.apache.camel.impl.ThrottlingInflightRoutePolicy">
-    	<property name="maxInflightExchanges" value="10"/>    	
-	</bean>
-	 	
-    <camelContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
-        <route id="testRoute" autoStartup="false" routePolicyRef="startPolicy, throttlePolicy">
-            <from uri="seda:foo?concurrentConsumers=20"/>
-            <to uri="mock:success"/>
-        </route>
-    </camelContext>
+  <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
+    <property name="routeStartDate" ref="now"/>
+    <property name="routeStartRepeatCount" value="-1"/>
+    <property name="routeStartRepeatInterval" value="3000"/>
+  </bean>
+
+  <bean id="throttlePolicy" class="org.apache.camel.impl.ThrottlingInflightRoutePolicy">
+    <property name="maxInflightExchanges" value="10"/>
+  </bean>
+
+  <camelContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
+    <route id="testRoute" autoStartup="false" routePolicyRef="startPolicy, throttlePolicy">
+      <from uri="seda:foo?concurrentConsumers=20"/>
+      <to uri="mock:success"/>
+    </route>
+  </camelContext>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SimplePolicies.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SimplePolicies.xml b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SimplePolicies.xml
index e87b0b9..f07eabd 100644
--- a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SimplePolicies.xml
+++ b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SimplePolicies.xml
@@ -22,30 +22,32 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="date" class="org.apache.camel.routepolicy.quartz.SimpleDate"/>
+    <bean id="now" class="org.apache.camel.routepolicy.quartz.DateFactory" factory-method="createDate">
+      <constructor-arg index="0" value="3000"/>
+    </bean>
 
     <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy"/>
 
     <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
-    	<property name="routeStartDate" ref="date"/>
+    	<property name="routeStartDate" ref="now"/>
     	<property name="routeStartRepeatCount" value="1"/>
     	<property name="routeStartRepeatInterval" value="3000"/>    	
     </bean>
     
     <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
-    	<property name="routeStopDate" ref="date"/>
+    	<property name="routeStopDate" ref="now"/>
     	<property name="routeStopRepeatCount" value="1"/>
     	<property name="routeStopRepeatInterval" value="3000"/>    	
 	</bean>
 	
 	<bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
-    	<property name="routeSuspendDate" ref="date"/>
+    	<property name="routeSuspendDate" ref="now"/>
     	<property name="routeSuspendRepeatCount" value="1"/>
     	<property name="routeSuspendRepeatInterval" value="3000"/>    	
   	</bean>
   	
   	<bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz.SimpleScheduledRoutePolicy">
-       	<property name="routeResumeDate" ref="date"/>
+       	<property name="routeResumeDate" ref="now"/>
     	<property name="routeResumeRepeatCount" value="1"/>
     	<property name="routeResumeRepeatInterval" value="3000"/>    	
  	</bean> 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
index 701b966..3305310 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
@@ -45,7 +45,6 @@ import org.slf4j.LoggerFactory;
  * <p>This component uses Quartz 2.x API and provide all the features from "camel-quartz". It has reused some
  * of the code, but mostly has been re-written in attempt to be more easier to maintain, and use Quartz more
  * fully.</p>
- *
  */
 public class QuartzComponent extends DefaultComponent implements StartupListener {
     private static final Logger LOG = LoggerFactory.getLogger(QuartzComponent.class);
@@ -56,6 +55,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
     private int startDelayedSeconds;
     private boolean autoStartScheduler = true;
     private boolean prefixJobNameWithEndpointId;
+    private boolean enableJmx = true;
 
     public QuartzComponent() {
     }
@@ -80,6 +80,22 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
         this.autoStartScheduler = autoStartScheduler;
     }
 
+    public boolean isPrefixJobNameWithEndpointId() {
+        return prefixJobNameWithEndpointId;
+    }
+
+    public void setPrefixJobNameWithEndpointId(boolean prefixJobNameWithEndpointId) {
+        this.prefixJobNameWithEndpointId = prefixJobNameWithEndpointId;
+    }
+
+    public boolean isEnableJmx() {
+        return enableJmx;
+    }
+
+    public void setEnableJmx(boolean enableJmx) {
+        this.enableJmx = enableJmx;
+    }
+
     public Properties getProperties() {
         return properties;
     }
@@ -113,6 +129,11 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
             prop.put("org.terracotta.quartz.skipUpdateCheck", "true");
 
+            // enable jmx unless configured to not do so
+            if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
+                prop.put("org.quartz.scheduler.jmx.export", "true");
+            }
+
             answer = new StdSchedulerFactory(prop);
         } else {
             // read default props to be able to use a single scheduler per camel context
@@ -146,6 +167,11 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
             prop.put("org.terracotta.quartz.skipUpdateCheck=true", "true");
 
+            // enable jmx unless configured to not do so
+            if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
+                prop.put("org.quartz.scheduler.jmx.export", "true");
+            }
+
             answer = new StdSchedulerFactory(prop);
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/BaseQuartzTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/BaseQuartzTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/BaseQuartzTest.java
new file mode 100644
index 0000000..178a11a
--- /dev/null
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/BaseQuartzTest.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.quartz2;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.test.junit4.CamelTestSupport;
+
+public class BaseQuartzTest extends CamelTestSupport {
+
+    protected boolean isEnableJmx() {
+        return true;
+    }
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext context = super.createCamelContext();
+
+        QuartzComponent quartz = context.getComponent("quartz2", QuartzComponent.class);
+        quartz.setEnableJmx(isEnableJmx());
+
+        return context;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartUnderscoreTimerNameTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartUnderscoreTimerNameTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartUnderscoreTimerNameTest.java
index d7d6c99..7b0c7a1 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartUnderscoreTimerNameTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartUnderscoreTimerNameTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartUnderscoreTimerNameTest extends CamelTestSupport {
+public class QuartUnderscoreTimerNameTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRouteUnderscore() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddDynamicRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddDynamicRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddDynamicRouteTest.java
index 05bb827..914a5af 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddDynamicRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddDynamicRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAddDynamicRouteTest extends CamelTestSupport {
+public class QuartzAddDynamicRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddRoutesAfterCamelContextStartedTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddRoutesAfterCamelContextStartedTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddRoutesAfterCamelContextStartedTest.java
index 1f11d23..65f33b8 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddRoutesAfterCamelContextStartedTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAddRoutesAfterCamelContextStartedTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAddRoutesAfterCamelContextStartedTest extends CamelTestSupport {
+public class QuartzAddRoutesAfterCamelContextStartedTest extends BaseQuartzTest {
 
     @Test
     public void testAddRoutes() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAutoStartTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAutoStartTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAutoStartTest.java
index e330413..a05a7d8 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAutoStartTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzAutoStartTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzAutoStartTest extends CamelTestSupport {
+public class QuartzAutoStartTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzAutoStart() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzComponentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzComponentTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzComponentTest.java
index a24b529..d3ece01 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzComponentTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzComponentTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.quartz2;
 
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.Scheduler;
 import org.quartz.SchedulerFactory;
@@ -25,7 +24,7 @@ import org.quartz.impl.StdSchedulerFactory;
 /**
  * @version 
  */
-public class QuartzComponentTest extends CamelTestSupport {
+public class QuartzComponentTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzComponentCustomScheduler() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteTest.java
index 9b2225b..34b7c85 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteTest.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Test;
@@ -30,7 +29,7 @@ import org.quartz.Trigger;
  * This test the  CronTrigger as a timer endpoint in a route.
  * @version 
  */
-public class QuartzCronRouteTest extends CamelTestSupport {
+public class QuartzCronRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteWithSmallCacheTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteWithSmallCacheTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteWithSmallCacheTest.java
index 2e2cbd0..5a0d5c1 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteWithSmallCacheTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzCronRouteWithSmallCacheTest.java
@@ -23,7 +23,6 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
@@ -32,7 +31,7 @@ import org.junit.Test;
  * <p/>
  * We simulate this behavior with a capacity of 1 element.
  */
-public class QuartzCronRouteWithSmallCacheTest extends CamelTestSupport {
+public class QuartzCronRouteWithSmallCacheTest extends BaseQuartzTest {
 
     private final CountDownLatch latch = new CountDownLatch(3);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzEndpointConfigureTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzEndpointConfigureTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzEndpointConfigureTest.java
index c2fea04..13f94ce 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzEndpointConfigureTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzEndpointConfigureTest.java
@@ -17,7 +17,6 @@
 package org.apache.camel.component.quartz2;
 
 import org.apache.camel.Endpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.CronTrigger;
 import org.quartz.JobDetail;
@@ -30,7 +29,7 @@ import org.quartz.TriggerKey;
 /**
  * @version 
  */
-public class QuartzEndpointConfigureTest extends CamelTestSupport {
+public class QuartzEndpointConfigureTest extends BaseQuartzTest {
 
     @Test
     public void testConfigureGroupAndName() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzJobRouteUnderscoreTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzJobRouteUnderscoreTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzJobRouteUnderscoreTest.java
index d2e440c..5edd99f 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzJobRouteUnderscoreTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzJobRouteUnderscoreTest.java
@@ -18,14 +18,13 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.JobDetail;
 
 /**
  * @version 
  */
-public class QuartzJobRouteUnderscoreTest extends CamelTestSupport {
+public class QuartzJobRouteUnderscoreTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzManagementTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzManagementTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzManagementTest.java
new file mode 100644
index 0000000..b65820a
--- /dev/null
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzManagementTest.java
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.quartz2;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
+
+public class QuartzManagementTest extends BaseQuartzTest {
+
+    @Override
+    protected boolean useJmx() {
+        return true;
+    }
+
+    @Override
+    protected boolean isEnableJmx() {
+        return true;
+    }
+
+    protected MBeanServer getMBeanServer() {
+        return context.getManagementStrategy().getManagementAgent().getMBeanServer();
+    }
+
+    @Test
+    public void testQuartzRoute() throws Exception {
+        // JMX tests dont work well on AIX CI servers (hangs them)
+        if (isPlatform("aix")) {
+            return;
+        }
+
+        getMockEndpoint("mock:result").expectedMessageCount(2);
+
+        assertMockEndpointsSatisfied();
+
+        MBeanServer mbeanServer = getMBeanServer();
+
+        String name = String.format("quartz:type=QuartzScheduler,name=DefaultQuartzScheduler-%s,instance=NON_CLUSTERED", context.getManagementName());
+
+        ObjectName on = ObjectName.getInstance(name);
+        assertTrue(mbeanServer.isRegistered(on));
+
+        Boolean started = (Boolean) mbeanServer.getAttribute(on, "Started");
+        assertEquals(true, started);
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("quartz2://myGroup/myTimerName?trigger.repeatInterval=2&trigger.repeatCount=1").routeId("myRoute").to("mock:result");
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzPropertiesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzPropertiesTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzPropertiesTest.java
index 3a31efa..d7bfa1c 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzPropertiesTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzPropertiesTest.java
@@ -19,12 +19,11 @@ package org.apache.camel.component.quartz2;
 import java.io.InputStream;
 import java.util.Properties;
 
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 import org.quartz.SchedulerException;
 
 
-public class QuartzPropertiesTest extends CamelTestSupport {
+public class QuartzPropertiesTest extends BaseQuartzTest {
 
     private QuartzComponent quartz;
 

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java
index c1c6d78..6c42a7d 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzRepeatIntervalTest extends CamelTestSupport {
+public class QuartzRepeatIntervalTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
index b7e4273..c45b3c4 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
@@ -21,7 +21,7 @@ import org.apache.camel.builder.RouteBuilder;
 /**
  * @version 
  */
-public class QuartzRouteFireNowTest extends QuartzRouteTest {
+public class QuartzRouteFireNowTest extends BaseQuartzTest {
     
     @Override
     protected RouteBuilder createRouteBuilder() {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteRestartTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteRestartTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteRestartTest.java
index 8931c9f..24e4d08 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteRestartTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteRestartTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzRouteRestartTest extends CamelTestSupport {
+public class QuartzRouteRestartTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteTest.java
index 573521a..fc241c8 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version 
  */
-public class QuartzRouteTest extends CamelTestSupport {
+public class QuartzRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSimpleRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSimpleRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSimpleRouteTest.java
index abaa87a..adb1113 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSimpleRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSimpleRouteTest.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Test;
@@ -30,7 +29,7 @@ import org.quartz.Trigger;
  * This not only set SimpleTrigger as a timer endpoint in a route, and also test the trigger.XXX properties setter.
  * @version 
  */
-public class QuartzSimpleRouteTest extends CamelTestSupport {
+public class QuartzSimpleRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedOptionTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedOptionTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedOptionTest.java
index a97c0f0..c85971e 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedOptionTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedOptionTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartzStartDelayedOptionTest extends CamelTestSupport {
+public class QuartzStartDelayedOptionTest extends BaseQuartzTest {
 
     @Test
     public void testStartDelayed() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedTest.java
index 80d5d5d..1a036e6 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStartDelayedTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class QuartzStartDelayedTest extends CamelTestSupport {
+public class QuartzStartDelayedTest extends BaseQuartzTest {
 
     @Test
     public void testStartDelayed() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStatefulJobRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStatefulJobRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStatefulJobRouteTest.java
index d517659..8bedbcf 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStatefulJobRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStatefulJobRouteTest.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Test;
@@ -28,9 +27,8 @@ import org.quartz.Trigger;
 
 /**
  * This test the  CronTrigger as a timer endpoint in a route.
- * @version 
  */
-public class QuartzStatefulJobRouteTest extends CamelTestSupport {
+public class QuartzStatefulJobRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzCronRoute() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStopRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStopRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStopRouteTest.java
index accb3d4..62afe1e 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStopRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzStopRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version
  */
-public class QuartzStopRouteTest extends CamelTestSupport {
+public class QuartzStopRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzSuspend() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSuspendRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSuspendRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSuspendRouteTest.java
index 8ce58bd..ebc4a16 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSuspendRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzSuspendRouteTest.java
@@ -18,13 +18,12 @@ package org.apache.camel.component.quartz2;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 /**
  * @version
  */
-public class QuartzSuspendRouteTest extends CamelTestSupport {
+public class QuartzSuspendRouteTest extends BaseQuartzTest {
 
     @Test
     public void testQuartzSuspend() throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/StatefulQuartzRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/StatefulQuartzRouteTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/StatefulQuartzRouteTest.java
index a690667..403273f 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/StatefulQuartzRouteTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/StatefulQuartzRouteTest.java
@@ -22,11 +22,10 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 
-public class StatefulQuartzRouteTest extends CamelTestSupport {
+public class StatefulQuartzRouteTest extends BaseQuartzTest {
     protected MockEndpoint resultEndpoint;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/DateFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/DateFactory.java b/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/DateFactory.java
new file mode 100644
index 0000000..dabad29
--- /dev/null
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/DateFactory.java
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.routepolicy.quartz2;
+
+import java.util.Date;
+
+public final class DateFactory {
+
+    private DateFactory() {
+    }
+
+    public static Date createDate(int future) {
+        return new Date(System.currentTimeMillis() + future);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SimpleDate.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SimpleDate.java b/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SimpleDate.java
deleted file mode 100644
index 3a50de7..0000000
--- a/components/camel-quartz2/src/test/java/org/apache/camel/routepolicy/quartz2/SimpleDate.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.routepolicy.quartz2;
-
-import java.util.Date;
-
-public class SimpleDate extends Date {
-
-    private static final long serialVersionUID = 1L;
-
-    public SimpleDate() {
-        this(3000);
-    }
-
-    public SimpleDate(long milliseconds) {
-        super(System.currentTimeMillis() + milliseconds);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/CronPolicies.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/CronPolicies.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/CronPolicies.xml
index 63a8ea7..7e403ad 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/CronPolicies.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/CronPolicies.xml
@@ -22,31 +22,29 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="date" class="org.apache.camel.routepolicy.quartz2.SimpleDate"/>
-
-    <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy"/>
-
-    <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
-    	<property name="routeStartTime" value="*/3 * * * * ?"/>
-    </bean>
-    
-    <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
-    	<property name="routeStopTime" value="*/3 * * * * ?"/>
-	</bean>
-	
-	<bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
-    	<property name="routeSuspendTime" value="*/3 * * * * ?"/>
-  	</bean>
-  	
-  	<bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
-    	<property name="routeResumeTime" value="*/3 * * * * ?"/>
- 	</bean> 
- 	
-    <routeContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
-        <route id="testRoute">
-            <from uri="direct:start"/>
-            <to uri="mock:success"/>
-        </route>
-    </routeContext>
+  <bean id="defaultPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy"/>
+
+  <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
+    <property name="routeStartTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="stopPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
+    <property name="routeStopTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="suspendPolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
+    <property name="routeSuspendTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <bean id="resumePolicy" class="org.apache.camel.routepolicy.quartz2.CronScheduledRoutePolicy">
+    <property name="routeResumeTime" value="*/3 * * * * ?"/>
+  </bean>
+
+  <routeContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
+    <route id="testRoute">
+      <from uri="direct:start"/>
+      <to uri="mock:success"/>
+    </route>
+  </routeContext>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/camel/blob/31b419c9/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/MultiplePolicies.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/MultiplePolicies.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/MultiplePolicies.xml
index c2b5aee..4018d41 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/MultiplePolicies.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/MultiplePolicies.xml
@@ -22,23 +22,25 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="date" class="org.apache.camel.routepolicy.quartz2.SimpleDate"/>
+  <bean id="now" class="org.apache.camel.routepolicy.quartz2.DateFactory" factory-method="createDate">
+    <constructor-arg index="0" value="3000"/>
+  </bean>
 
-    <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
-    	<property name="routeStartDate" ref="date"/>
-    	<property name="routeStartRepeatCount" value="1"/>
-    	<property name="routeStartRepeatInterval" value="3000"/>    	
-    </bean>
-    
-    <bean id="throttlePolicy" class="org.apache.camel.impl.ThrottlingInflightRoutePolicy">
-    	<property name="maxInflightExchanges" value="10"/>    	
-	</bean>
-	 	
-    <camelContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
-        <route id="testRoute" autoStartup="false" routePolicyRef="startPolicy, throttlePolicy">
-            <from uri="seda:foo?concurrentConsumers=20"/>
-            <to uri="mock:success"/>
-        </route>
-    </camelContext>
+  <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz2.SimpleScheduledRoutePolicy">
+    <property name="routeStartDate" ref="now"/>
+    <property name="routeStartRepeatCount" value="1"/>
+    <property name="routeStartRepeatInterval" value="3000"/>
+  </bean>
+
+  <bean id="throttlePolicy" class="org.apache.camel.impl.ThrottlingInflightRoutePolicy">
+    <property name="maxInflightExchanges" value="10"/>
+  </bean>
+
+  <camelContext id="testRouteContext" xmlns="http://camel.apache.org/schema/spring">
+    <route id="testRoute" autoStartup="false" routePolicyRef="startPolicy, throttlePolicy">
+      <from uri="seda:foo?concurrentConsumers=20"/>
+      <to uri="mock:success"/>
+    </route>
+  </camelContext>
 
 </beans>


[11/50] [abbrv] git commit: CAMEL-7025 revert the change of StaxConverterTest which should not be committed yet

Posted by ni...@apache.org.
CAMEL-7025 revert the change of StaxConverterTest which should not be committed yet


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/42b463c4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/42b463c4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/42b463c4

Branch: refs/heads/camel-gora
Commit: 42b463c42bab7f2e63925275523801ffb93da3b5
Parents: 644c1f0
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Dec 2 14:54:35 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Dec 2 14:54:35 2013 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/converter/jaxp/StaxConverterTest.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/42b463c4/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java b/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java
index 3a299af..1049332 100644
--- a/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java
+++ b/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java
@@ -58,7 +58,7 @@ public class StaxConverterTest extends ContextTestSupport {
             output = new ByteArrayOutputStream();
             // ensure UTF-8 encoding
             Exchange exchange = new DefaultExchange(context);
-            //exchange.setProperty(Exchange.CHARSET_NAME, ISO_8859_1.toString());
+            exchange.setProperty(Exchange.CHARSET_NAME, UTF_8.toString());
             writer = context.getTypeConverter().mandatoryConvertTo(XMLEventWriter.class, exchange, output);
             while (reader.hasNext()) {
                 writer.add(reader.nextEvent());
@@ -74,7 +74,6 @@ public class StaxConverterTest extends ContextTestSupport {
         assertNotNull(output);
 
         String result = new String(output.toByteArray(), UTF_8.name());
-        System.out.println(result);
         boolean equals = TEST_XML_WITH_XML_HEADER.equals(result) || TEST_XML_WITH_XML_HEADER_ISO_8859_1.equals(result);
         assertTrue("Should match header", equals);
     }
@@ -93,7 +92,7 @@ public class StaxConverterTest extends ContextTestSupport {
             output = new ByteArrayOutputStream();
             // ensure UTF-8 encoding
             Exchange exchange = new DefaultExchange(context);
-            //exchange.setProperty(Exchange.CHARSET_NAME, UTF_8.name());
+            exchange.setProperty(Exchange.CHARSET_NAME, UTF_8.name());
             writer = context.getTypeConverter().mandatoryConvertTo(XMLStreamWriter.class, exchange, output);
             // copy to writer
             while (reader.hasNext()) {


[04/50] [abbrv] git commit: Upgrade to jackson 2.3.0

Posted by ni...@apache.org.
Upgrade to jackson 2.3.0


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d2d305ee
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d2d305ee
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d2d305ee

Branch: refs/heads/camel-gora
Commit: d2d305eea678165fa660b994a5a46a3c1cadfda7
Parents: 2d885a5
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Nov 28 22:17:39 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Nov 28 22:17:39 2013 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/jackson/JacksonMarshalViewTest.java | 2 +-
 .../camel/component/jackson/SpringJacksonJsonDataFormatTest.java   | 2 +-
 parent/pom.xml                                                     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d2d305ee/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalViewTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalViewTest.java b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalViewTest.java
index 25a82b7..b4c8893 100644
--- a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalViewTest.java
+++ b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonMarshalViewTest.java
@@ -36,7 +36,7 @@ public class JacksonMarshalViewTest extends CamelTestSupport {
 
         Object marshalled = template.requestBody("direct:inPojoAgeView", in);
         String marshalledAsString = context.getTypeConverter().convertTo(String.class, marshalled);
-        assertEquals("{\"age\":30,\"height\":190}", marshalledAsString);
+        assertEquals("{\"height\":190,\"age\":30}", marshalledAsString);
 
         template.sendBody("direct:backPojoAgeView", marshalled);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/d2d305ee/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/SpringJacksonJsonDataFormatTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/SpringJacksonJsonDataFormatTest.java b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/SpringJacksonJsonDataFormatTest.java
index ab2ac06..487caa2 100644
--- a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/SpringJacksonJsonDataFormatTest.java
+++ b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/SpringJacksonJsonDataFormatTest.java
@@ -79,7 +79,7 @@ public class SpringJacksonJsonDataFormatTest extends CamelSpringTestSupport {
 
         Object marshalled = template.requestBody("direct:inAgeView", in);
         String marshalledAsString = context.getTypeConverter().convertTo(String.class, marshalled);
-        assertEquals("{\"age\":30,\"height\":190}", marshalledAsString);
+        assertEquals("{\"height\":190,\"age\":30}", marshalledAsString);
 
         template.sendBody("direct:backAgeView", marshalled);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/d2d305ee/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index a98630f..6388e74 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -193,7 +193,7 @@
     <isorelax-bundle-version>20050913_4</isorelax-bundle-version>
     <jini-version>2.1</jini-version>
     <jackson-version>1.9.12</jackson-version>
-    <jackson2-version>2.2.2</jackson2-version>
+    <jackson2-version>2.3.0</jackson2-version>
     <jackrabbit-version>2.2.12</jackrabbit-version>
     <jain-sip-ri-bundle-version>1.2.154_2</jain-sip-ri-bundle-version>
     <jasper-bundle-version>6.0.36_1</jasper-bundle-version>


[42/50] [abbrv] git commit: CAMEL-7010 Upgraded camel-http4 to use HttpClient 4.3 API

Posted by ni...@apache.org.
CAMEL-7010 Upgraded camel-http4 to use HttpClient 4.3 API


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7e65a14d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7e65a14d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7e65a14d

Branch: refs/heads/camel-gora
Commit: 7e65a14d0fb2e49282bbf51ebe463c6fff38073d
Parents: 3227252
Author: Willem Jiang <wi...@gmail.com>
Authored: Sat Dec 7 22:11:15 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sat Dec 7 22:12:29 2013 +0800

----------------------------------------------------------------------
 .../aws/swf/CamelSWFWorkflowClientTest.java     |   2 +-
 .../aws/swf/SwfComponentSpringTest.java         |   2 -
 .../camel/component/http/helper/HttpHelper.java |   2 +-
 ...BasicAuthenticationHttpClientConfigurer.java |  10 +-
 .../http4/CompositeHttpConfigurer.java          |   6 +-
 .../component/http4/HttpClientConfigurer.java   |   4 +-
 .../camel/component/http4/HttpComponent.java    | 147 +++++++------------
 .../camel/component/http4/HttpEndpoint.java     |  90 ++++++------
 .../camel/component/http4/HttpProducer.java     |  26 ++--
 .../http4/ProxyHttpClientConfigurer.java        |  13 +-
 .../http4/AdviceAndInterceptHttp4IssueTest.java |   2 +-
 .../component/http4/HttpAuthenticationTest.java |  22 +--
 .../component/http4/HttpCompressionTest.java    |  19 ++-
 .../http4/HttpProducerContentTypeTest.java      |   1 -
 .../component/http4/HttpProxyServerTest.java    |  51 ++-----
 .../camel/component/http4/HttpRedirectTest.java |   8 +-
 .../http4/HttpReferenceParameterTest.java       |   4 +-
 .../component/http4/HttpSOTimeoutTest.java      |   4 +-
 .../component/http4/HttpServerTestSupport.java  |   6 +-
 .../http4/HttpWithHttpUriHeaderTest.java        |   1 -
 .../http4/HttpsAuthenticationTest.java          |  24 ++-
 ...TwoDifferentSslContextParametersGetTest.java |   2 +
 .../apache/camel/itest/http/Http4RouteTest.java |   2 +-
 .../itest/http/Http4EndpointTest-context.xml    |  34 +----
 .../Http4MaxConnectionPerHostTest-context.xml   |  30 ----
 25 files changed, 205 insertions(+), 307 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java
index 42b53fe..69bc01f 100644
--- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java
@@ -72,7 +72,7 @@ public class CamelSWFWorkflowClientTest {
         Date closeTimestamp = new Date();
         executionInfo.setCloseTimestamp(closeTimestamp);
         executionInfo.setExecutionStatus("CLOSED");
-        executionInfo.setTagList(Collections.EMPTY_LIST);
+        executionInfo.setTagList((List<String>)Collections.EMPTY_LIST);
 
         WorkflowExecutionDetail workflowExecutionDetail = new WorkflowExecutionDetail();
         workflowExecutionDetail.setExecutionInfo(executionInfo);

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java
index 12b8437..55b8a50 100644
--- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java
@@ -18,10 +18,8 @@ package org.apache.camel.component.aws.swf;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
-import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.ProducerTemplate;
-import org.apache.camel.component.aws.sqs.SqsConstants;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.spring.CamelSpringTestSupport;
 import org.junit.Test;

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java b/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java
index 96ebeef..65b5a03 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/helper/HttpHelper.java
@@ -167,7 +167,7 @@ public final class HttpHelper {
         } else {
             CachedOutputStream cos = new CachedOutputStream(exchange);
             IOHelper.copyAndCloseInput(is, cos);
-            return cos.getStreamCache();
+            return cos.newStreamCache();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/main/java/org/apache/camel/component/http4/BasicAuthenticationHttpClientConfigurer.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/BasicAuthenticationHttpClientConfigurer.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/BasicAuthenticationHttpClientConfigurer.java
index c17df1c..8671369 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/BasicAuthenticationHttpClientConfigurer.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/BasicAuthenticationHttpClientConfigurer.java
@@ -20,8 +20,8 @@ import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
 import org.apache.http.auth.NTCredentials;
 import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.HttpClient;
-import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.HttpClientBuilder;
 
 public class BasicAuthenticationHttpClientConfigurer implements HttpClientConfigurer {
     private final String username;
@@ -36,14 +36,16 @@ public class BasicAuthenticationHttpClientConfigurer implements HttpClientConfig
         this.host = host;
     }
 
-    public void configureHttpClient(HttpClient client) {
+    public void configureHttpClient(HttpClientBuilder clientBuilder) {
         Credentials defaultcreds;
         if (domain != null) {
             defaultcreds = new NTCredentials(username, password, host, domain);
         } else {
             defaultcreds = new UsernamePasswordCredentials(username, password);
         }
-        ((DefaultHttpClient) client).getCredentialsProvider().setCredentials(AuthScope.ANY, defaultcreds);
+        BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+        credentialsProvider.setCredentials(AuthScope.ANY, defaultcreds);
+        clientBuilder.setDefaultCredentialsProvider(credentialsProvider);
     }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/main/java/org/apache/camel/component/http4/CompositeHttpConfigurer.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/CompositeHttpConfigurer.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/CompositeHttpConfigurer.java
index f96e71f..29c3d98 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/CompositeHttpConfigurer.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/CompositeHttpConfigurer.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.http4;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
 
 public class CompositeHttpConfigurer implements HttpClientConfigurer {
 
@@ -35,9 +35,9 @@ public class CompositeHttpConfigurer implements HttpClientConfigurer {
         configurers.remove(configurer);
     }
 
-    public void configureHttpClient(HttpClient client) {
+    public void configureHttpClient(HttpClientBuilder clientBuilder) {
         for (HttpClientConfigurer configurer : configurers) {
-            configurer.configureHttpClient(client);
+            configurer.configureHttpClient(clientBuilder);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpClientConfigurer.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpClientConfigurer.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpClientConfigurer.java
index e79174f..95b2672 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpClientConfigurer.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpClientConfigurer.java
@@ -16,7 +16,7 @@
  */
 package org.apache.camel.component.http4;
 
-import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
 
 /**
  * A pluggable strategy for configuring the HttpClient used by this component
@@ -30,5 +30,5 @@ public interface HttpClientConfigurer {
      *
      * @param client the client
      */
-    void configureHttpClient(HttpClient client);
+    void configureHttpClient(HttpClientBuilder clientBuilder);
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java
index 4d0d230..855f40e 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpComponent.java
@@ -16,7 +16,9 @@
  */
 package org.apache.camel.component.http4;
 
+import java.io.IOException;
 import java.net.URI;
+import java.security.GeneralSecurityException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
@@ -31,23 +33,18 @@ import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.URISupport;
 import org.apache.camel.util.UnsafeUriCharactersEncoder;
 import org.apache.camel.util.jsse.SSLContextParameters;
-import org.apache.http.auth.params.AuthParamBean;
 import org.apache.http.client.CookieStore;
-import org.apache.http.client.params.ClientParamBean;
-import org.apache.http.conn.ClientConnectionManager;
-import org.apache.http.conn.params.ConnRouteParamBean;
-import org.apache.http.conn.scheme.PlainSocketFactory;
-import org.apache.http.conn.scheme.Scheme;
-import org.apache.http.conn.scheme.SchemeRegistry;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.conn.HttpClientConnectionManager;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
 import org.apache.http.conn.ssl.BrowserCompatHostnameVerifier;
-import org.apache.http.conn.ssl.SSLSocketFactory;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
 import org.apache.http.conn.ssl.X509HostnameVerifier;
-import org.apache.http.cookie.params.CookieSpecParamBean;
-import org.apache.http.impl.conn.PoolingClientConnectionManager;
-import org.apache.http.params.BasicHttpParams;
-import org.apache.http.params.HttpConnectionParamBean;
-import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParamBean;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.protocol.HttpContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -62,7 +59,7 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
     private static final Logger LOG = LoggerFactory.getLogger(HttpComponent.class);
 
     protected HttpClientConfigurer httpClientConfigurer;
-    protected ClientConnectionManager clientConnectionManager;
+    protected HttpClientConnectionManager clientConnectionManager;
     protected HttpBinding httpBinding;
     protected HttpContext httpContext;
     protected SSLContextParameters sslContextParameters;
@@ -75,8 +72,6 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
     // It's MILLISECONDS, the default value is always keep alive
     protected long connectionTimeToLive = -1;
 
-    private volatile SSLContextParameters usedSslContextParams;
-
     /**
      * Connects the URL specified on the endpoint to the specified processor.
      *
@@ -151,11 +146,7 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
             String proxyAuthPassword = getAndRemoveParameter(parameters, "proxyAuthPassword", String.class);
             String proxyAuthDomain = getAndRemoveParameter(parameters, "proxyAuthDomain", String.class);
             String proxyAuthNtHost = getAndRemoveParameter(parameters, "proxyAuthNtHost", String.class);
-            boolean secureProxy = HttpHelper.isSecureConnection(proxyAuthScheme);
-
-            // register scheme for proxy
-            registerPort(secureProxy, x509HostnameVerifier, proxyAuthPort, sslContextParameters);
-
+            
             if (proxyAuthUsername != null && proxyAuthPassword != null) {
                 return CompositeHttpConfigurer.combineConfigurers(
                     configurer, new ProxyHttpClientConfigurer(proxyAuthHost, proxyAuthPort, proxyAuthScheme, proxyAuthUsername, proxyAuthPassword, proxyAuthDomain, proxyAuthNtHost));
@@ -171,7 +162,14 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         Map<String, Object> httpClientParameters = new HashMap<String, Object>(parameters);
         // http client can be configured from URI options
-        HttpParams clientParams = configureHttpParams(parameters);
+        HttpClientBuilder clientBuilder = HttpClientBuilder.create();
+        // allow the builder pattern
+        IntrospectionSupport.setProperties(clientBuilder, parameters, "httpClient.", true);
+        // set the Request configure this way and allow the builder pattern
+        RequestConfig.Builder requestConfigBuilder = RequestConfig.custom();
+        IntrospectionSupport.setProperties(requestConfigBuilder, parameters, "httpClient.", true);
+        clientBuilder.setDefaultRequestConfig(requestConfigBuilder.build());
+        
         // validate that we could resolve all httpClient. parameters as this component is lenient
         validateParameters(uri, parameters, "httpClient.");
         
@@ -191,6 +189,7 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
         if (x509HostnameVerifier == null) {
             x509HostnameVerifier = getX509HostnameVerifier();
         }
+        
 
         // TODO cmueller: remove the "sslContextParametersRef" look up in Camel 3.0
         SSLContextParameters sslContextParameters = resolveAndRemoveReferenceParameter(parameters, "sslContextParametersRef", SSLContextParameters.class);
@@ -200,6 +199,7 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
         if (sslContextParameters == null) {
             sslContextParameters = getSslContextParameters();
         }
+        
         String httpMethodRestrict = getAndRemoveParameter(parameters, "httpMethodRestrict", String.class);
         
         HeaderFilterStrategy headerFilterStrategy = resolveAndRemoveReferenceParameter(parameters, "headerFilterStrategy", HeaderFilterStrategy.class);
@@ -250,7 +250,11 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
         String endpointUriString = endpointUri.toString();
 
         LOG.debug("Creating endpoint uri {}", endpointUriString);
-        HttpEndpoint endpoint = new HttpEndpoint(endpointUriString, this, clientParams, clientConnectionManager, configurer);
+        HttpClientConnectionManager localConnectionManager = clientConnectionManager;
+        if (localConnectionManager == null) {
+            localConnectionManager = createConnectionManager(createConnectionRegistry(x509HostnameVerifier, sslContextParameters));
+        }
+        HttpEndpoint endpoint = new HttpEndpoint(endpointUriString, this, clientBuilder, localConnectionManager, configurer);
         if (urlRewrite != null) {
             // let CamelContext deal with the lifecycle of the url rewrite
             // this ensures its being shutdown when Camel shutdown etc.
@@ -294,9 +298,7 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
         if (endpoint.getCookieStore() == null) {
             endpoint.setCookieStore(getCookieStore());
         }
-        // register port on schema registry
-        registerPort(secure, x509HostnameVerifier, port, sslContextParameters);
-
+        
         return endpoint;
     }
    
@@ -314,86 +316,37 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
         return port;
     }
     
-    @SuppressWarnings("deprecation")
-    protected void registerPort(boolean secure, X509HostnameVerifier x509HostnameVerifier, int port, SSLContextParameters sslContextParams) throws Exception {
-        if (usedSslContextParams == null) {
-            usedSslContextParams = sslContextParams;
-        }
-
-        // we must use same SSLContextParameters for this component.
-        if (usedSslContextParams != sslContextParams) {
-            // use identity hashcode in exception message
-            Object previous = ObjectHelper.getIdentityHashCode(usedSslContextParams);
-            Object next = ObjectHelper.getIdentityHashCode(sslContextParams);
-            throw new IllegalArgumentException("Only same instance of SSLContextParameters is supported. Cannot use a different instance."
-                    + " Previous instance hashcode: " + previous + ", New instance hashcode: " + next);
-        }
-
-        SchemeRegistry registry = clientConnectionManager.getSchemeRegistry();
-        if (secure) {
-            SSLSocketFactory socketFactory;
-            if (sslContextParams == null) {
-                socketFactory = SSLSocketFactory.getSocketFactory();
-            } else {
-                socketFactory = new SSLSocketFactory(sslContextParams.createSSLContext());
-            }
-
-            socketFactory.setHostnameVerifier(x509HostnameVerifier);
-            // must register both https and https4
-            registry.register(new Scheme("https", port, socketFactory));
-            LOG.info("Registering SSL scheme https on port " + port);
-            
-            registry.register(new Scheme("https4", port, socketFactory));
-            LOG.info("Registering SSL scheme https4 on port " + port);
+    protected Registry<ConnectionSocketFactory> createConnectionRegistry(X509HostnameVerifier x509HostnameVerifier, SSLContextParameters sslContextParams)
+        throws GeneralSecurityException, IOException {
+        // create the default connection registry to use
+        RegistryBuilder<ConnectionSocketFactory> builder = RegistryBuilder.<ConnectionSocketFactory>create();
+        builder.register("http", PlainConnectionSocketFactory.getSocketFactory());
+        builder.register("http4", PlainConnectionSocketFactory.getSocketFactory());
+        if (sslContextParams != null) {
+            builder.register("https", new SSLConnectionSocketFactory(sslContextParams.createSSLContext(), x509HostnameVerifier));
+            builder.register("https4", new SSLConnectionSocketFactory(sslContextParams.createSSLContext(), x509HostnameVerifier));
         } else {
-            // must register both http and http4
-            registry.register(new Scheme("http", port, new PlainSocketFactory()));
-            LOG.info("Registering PLAIN scheme http on port " + port);
-            registry.register(new Scheme("http4", port, new PlainSocketFactory()));
-            LOG.info("Registering PLAIN scheme http4 on port " + port);
+            builder.register("https4", SSLConnectionSocketFactory.getSocketFactory());
+            builder.register("https", SSLConnectionSocketFactory.getSocketFactory());
         }
+        return builder.build();
     }
-
-    protected ClientConnectionManager createConnectionManager() {
-        SchemeRegistry schemeRegistry = new SchemeRegistry();
+    
+    protected HttpClientConnectionManager createConnectionManager(Registry<ConnectionSocketFactory> registry) {
         // setup the connection live time
-        PoolingClientConnectionManager answer = new PoolingClientConnectionManager(schemeRegistry, getConnectionTimeToLive(), TimeUnit.MILLISECONDS);
+        PoolingHttpClientConnectionManager answer = 
+            new PoolingHttpClientConnectionManager(registry, null, null, null, getConnectionTimeToLive(), TimeUnit.MILLISECONDS);
         if (getMaxTotalConnections() > 0) {
             answer.setMaxTotal(getMaxTotalConnections());
         }
         if (getConnectionsPerRoute() > 0) {
             answer.setDefaultMaxPerRoute(getConnectionsPerRoute());
         }
-        
         LOG.info("Created ClientConnectionManager " + answer);
 
         return answer;
     }
 
-    protected HttpParams configureHttpParams(Map<String, Object> parameters) throws Exception {
-        HttpParams clientParams = new BasicHttpParams();
-
-        AuthParamBean authParamBean = new AuthParamBean(clientParams);
-        IntrospectionSupport.setProperties(authParamBean, parameters, "httpClient.");
-
-        ClientParamBean clientParamBean = new ClientParamBean(clientParams);
-        IntrospectionSupport.setProperties(clientParamBean, parameters, "httpClient.");
-        
-        ConnRouteParamBean connRouteParamBean = new ConnRouteParamBean(clientParams);
-        IntrospectionSupport.setProperties(connRouteParamBean, parameters, "httpClient.");
-
-        CookieSpecParamBean cookieSpecParamBean = new CookieSpecParamBean(clientParams);
-        IntrospectionSupport.setProperties(cookieSpecParamBean, parameters, "httpClient.");
-
-        HttpConnectionParamBean httpConnectionParamBean = new HttpConnectionParamBean(clientParams);
-        IntrospectionSupport.setProperties(httpConnectionParamBean, parameters, "httpClient.");
-
-        HttpProtocolParamBean httpProtocolParamBean = new HttpProtocolParamBean(clientParams);
-        IntrospectionSupport.setProperties(httpProtocolParamBean, parameters, "httpClient.");
-
-        return clientParams;
-    }
-
     @Override
     protected boolean useIntrospectionOnEndpoint() {
         return false;
@@ -407,11 +360,11 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
         this.httpClientConfigurer = httpClientConfigurer;
     }
 
-    public ClientConnectionManager getClientConnectionManager() {
+    public HttpClientConnectionManager getClientConnectionManager() {
         return clientConnectionManager;
     }
 
-    public void setClientConnectionManager(ClientConnectionManager clientConnectionManager) {
+    public void setClientConnectionManager(HttpClientConnectionManager clientConnectionManager) {
         this.clientConnectionManager = clientConnectionManager;
     }
 
@@ -482,9 +435,6 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
     @Override
     public void doStart() throws Exception {
         super.doStart();
-        if (clientConnectionManager == null) {
-            clientConnectionManager = createConnectionManager();
-        }
     }
 
     @Override
@@ -495,7 +445,8 @@ public class HttpComponent extends HeaderFilterStrategyComponent {
             clientConnectionManager.shutdown();
             clientConnectionManager = null;
         }
-        usedSslContextParams = null;
+        
         super.doStop();
     }
+    
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
index c5086a3..2ef06b8 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
@@ -21,7 +21,6 @@ import java.net.URISyntaxException;
 
 import org.apache.camel.PollingConsumer;
 import org.apache.camel.Producer;
-import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.component.http4.helper.HttpHelper;
 import org.apache.camel.impl.DefaultPollingEndpoint;
 import org.apache.camel.spi.HeaderFilterStrategy;
@@ -30,11 +29,10 @@ import org.apache.camel.util.ObjectHelper;
 import org.apache.http.HttpHost;
 import org.apache.http.client.CookieStore;
 import org.apache.http.client.HttpClient;
-import org.apache.http.conn.ClientConnectionManager;
-import org.apache.http.conn.params.ConnRoutePNames;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.params.BasicHttpParams;
-import org.apache.http.params.HttpParams;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.conn.HttpClientConnectionManager;
+import org.apache.http.impl.client.BasicCookieStore;
+import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.protocol.HttpContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -52,9 +50,9 @@ public class HttpEndpoint extends DefaultPollingEndpoint implements HeaderFilter
     private HttpContext httpContext;
     private HttpComponent component;
     private URI httpUri;
-    private HttpParams clientParams;
     private HttpClientConfigurer httpClientConfigurer;
-    private ClientConnectionManager clientConnectionManager;
+    private HttpClientConnectionManager clientConnectionManager;
+    private HttpClientBuilder clientBuilder;
     private HttpClient httpClient;
     private boolean throwExceptionOnFailure = true;
     private boolean bridgeEndpoint;
@@ -67,8 +65,8 @@ public class HttpEndpoint extends DefaultPollingEndpoint implements HeaderFilter
     private String httpMethodRestrict;
     private UrlRewrite urlRewrite;
     private boolean clearExpiredCookies = true;
-    private CookieStore cookieStore;
-
+    private CookieStore cookieStore = new BasicCookieStore();
+    
     public HttpEndpoint() {
     }
 
@@ -76,21 +74,21 @@ public class HttpEndpoint extends DefaultPollingEndpoint implements HeaderFilter
         this(endPointURI, component, httpURI, null);
     }
 
-    public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, ClientConnectionManager clientConnectionManager) throws URISyntaxException {
-        this(endPointURI, component, httpURI, new BasicHttpParams(), clientConnectionManager, null);
+    public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, HttpClientConnectionManager clientConnectionManager) throws URISyntaxException {
+        this(endPointURI, component, httpURI, HttpClientBuilder.create(), clientConnectionManager, null);
     }
     
-    public HttpEndpoint(String endPointURI, HttpComponent component, HttpParams clientParams,
-                        ClientConnectionManager clientConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException {
-        this(endPointURI, component, null, clientParams, clientConnectionManager, clientConfigurer);
+    public HttpEndpoint(String endPointURI, HttpComponent component, HttpClientBuilder clientBuilder,
+                        HttpClientConnectionManager clientConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException {
+        this(endPointURI, component, null, clientBuilder, clientConnectionManager, clientConfigurer);
     }
 
-    public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, HttpParams clientParams,
-                        ClientConnectionManager clientConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException {
+    public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, HttpClientBuilder clientBuilder,
+                        HttpClientConnectionManager clientConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException {
         super(endPointURI, component);
         this.component = component;
         this.httpUri = httpURI;
-        this.clientParams = clientParams;
+        this.clientBuilder = clientBuilder;
         this.httpClientConfigurer = clientConfigurer;
         this.clientConnectionManager = clientConnectionManager;
     }
@@ -125,13 +123,13 @@ public class HttpEndpoint extends DefaultPollingEndpoint implements HeaderFilter
      * Producers and consumers should use the {@link #getHttpClient()} method instead.
      */
     protected HttpClient createHttpClient() {
-        ObjectHelper.notNull(clientParams, "clientParams");
+        ObjectHelper.notNull(clientBuilder, "httpClientBuilder");
         ObjectHelper.notNull(clientConnectionManager, "httpConnectionManager");
 
-        DefaultHttpClient answer = new DefaultHttpClient(clientConnectionManager, getClientParams());
-        if (cookieStore != null) {
-            answer.setCookieStore(cookieStore);
-        }
+        // setup the cookieStore
+        clientBuilder.setDefaultCookieStore(cookieStore);
+        // setup the httpConnectionManager
+        clientBuilder.setConnectionManager(clientConnectionManager);
 
         // configure http proxy from camelContext
         if (ObjectHelper.isNotEmpty(getCamelContext().getProperty("http.proxyHost")) && ObjectHelper.isNotEmpty(getCamelContext().getProperty("http.proxyPort"))) {
@@ -143,27 +141,27 @@ public class HttpEndpoint extends DefaultPollingEndpoint implements HeaderFilter
                 scheme = HttpHelper.isSecureConnection(getEndpointUri()) ? "https" : "http";
             }
             LOG.debug("CamelContext properties http.proxyHost, http.proxyPort, and http.proxyScheme detected. Using http proxy host: {} port: {} scheme: {}", new Object[]{host, port, scheme});
-            try {
-                component.registerPort(HttpHelper.isSecureConnection(scheme), component.getX509HostnameVerifier(), port, component.getSslContextParameters());
-            } catch (Exception ex) {
-                throw new RuntimeCamelException(ex);
-            }
             HttpHost proxy = new HttpHost(host, port, scheme);
-            answer.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
+            clientBuilder.setProxy(proxy);
+        }
+        
+        if (isAuthenticationPreemptive()) {
+            // setup the PreemptiveAuthInterceptor here
+            clientBuilder.addInterceptorFirst(new PreemptiveAuthInterceptor());
         }
 
         HttpClientConfigurer configurer = getHttpClientConfigurer();
         if (configurer != null) {
-            configurer.configureHttpClient(answer);
+            configurer.configureHttpClient(clientBuilder);
         }
 
         if (isBridgeEndpoint()) {
             // need to use noop cookiestore as we do not want to keep cookies in memory
-            answer.setCookieStore(new NoopCookieStore());
+            clientBuilder.setDefaultCookieStore(new NoopCookieStore());
         }
 
-        LOG.debug("Created HttpClient {}", answer);
-        return answer;
+        LOG.debug("Setup the HttpClientBuilder {}", clientBuilder);
+        return clientBuilder.build();
     }
 
     public void connect(HttpConsumer consumer) throws Exception {
@@ -182,31 +180,39 @@ public class HttpEndpoint extends DefaultPollingEndpoint implements HeaderFilter
     public boolean isSingleton() {
         return true;
     }
+    
+    @Override
+    protected void doStop() throws Exception {
+        if (component != null && component.getClientConnectionManager() != clientConnectionManager) {
+            // need to shutdown the ConnectionManager
+            clientConnectionManager.shutdown();
+        }
+    }
 
 
     // Properties
     //-------------------------------------------------------------------------
 
     /**
-     * Provide access to the client parameters used on new {@link HttpClient} instances
+     * Provide access to the http client request parameters used on new {@link RequestConfig} instances
      * used by producers or consumers of this endpoint.
      */
-    public HttpParams getClientParams() {
-        return clientParams;
+    public HttpClientBuilder getClientBuilder() {
+        return clientBuilder;
     }
 
     /**
-     * Provide access to the client parameters used on new {@link HttpClient} instances
+     * Provide access to the http client request parameters used on new {@link RequestConfig} instances
      * used by producers or consumers of this endpoint.
      */
-    public void setClientParams(HttpParams clientParams) {
-        this.clientParams = clientParams;
+    public void setClientBuilder(HttpClientBuilder clientBuilder) {
+        this.clientBuilder = clientBuilder;
     }
 
     public HttpClientConfigurer getHttpClientConfigurer() {
         return httpClientConfigurer;
     }
-
+    
     public HttpContext getHttpContext() {
         return httpContext;
     }
@@ -272,11 +278,11 @@ public class HttpEndpoint extends DefaultPollingEndpoint implements HeaderFilter
         this.httpUri = httpUri;
     }
 
-    public ClientConnectionManager getClientConnectionManager() {
+    public HttpClientConnectionManager getClientConnectionManager() {
         return clientConnectionManager;
     }
 
-    public void setClientConnectionManager(ClientConnectionManager clientConnectionManager) {
+    public void setClientConnectionManager(HttpClientConnectionManager clientConnectionManager) {
         this.clientConnectionManager = clientConnectionManager;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
index e2b09d4..dbe578f 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
@@ -62,7 +62,7 @@ import org.apache.http.entity.InputStreamEntity;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.auth.BasicScheme;
 import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.util.EntityUtils;
 import org.slf4j.Logger;
@@ -88,11 +88,9 @@ public class HttpProducer extends DefaultProducer {
 
     public void process(Exchange exchange) throws Exception {
 
-        if (getEndpoint().isClearExpiredCookies()) {
-            if (httpClient instanceof DefaultHttpClient) {
-                boolean cleared = ((DefaultHttpClient) httpClient).getCookieStore().clearExpired(new Date());
-                log.debug("Any expired cookies cleared: {}", cleared);
-            }
+        if (getEndpoint().isClearExpiredCookies() && !getEndpoint().isBridgeEndpoint()) {
+            // create the cookies before the invocation
+            getEndpoint().getCookieStore().clearExpired(new Date());
         }
 
         // if we bridge endpoint then we need to skip matching headers with the HTTP_QUERY to avoid sending
@@ -109,15 +107,11 @@ public class HttpProducer extends DefaultProducer {
             exchange.getIn().getHeaders().remove("host");
         }
         HttpRequestBase httpRequest = createMethod(exchange);
-        if (getEndpoint().isAuthenticationPreemptive()) {
-            Credentials creds = ((DefaultHttpClient) httpClient).getCredentialsProvider().getCredentials(AuthScope.ANY);
-            httpRequest.addHeader(new BasicScheme().authenticate(creds, httpRequest));
-        }
         Message in = exchange.getIn();
         String httpProtocolVersion = in.getHeader(Exchange.HTTP_PROTOCOL_VERSION, String.class);
         if (httpProtocolVersion != null) {
             // set the HTTP protocol version
-            httpRequest.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpHelper.parserHttpVersion(httpProtocolVersion));
+            httpRequest.setProtocolVersion(HttpHelper.parserHttpVersion(httpProtocolVersion));
         }
         HeaderFilterStrategy strategy = getEndpoint().getHeaderFilterStrategy();
 
@@ -255,11 +249,15 @@ public class HttpProducer extends DefaultProducer {
      * @throws IOException can be thrown
      */
     protected HttpResponse executeMethod(HttpUriRequest httpRequest) throws IOException {
+        HttpContext localContext = new BasicHttpContext();
+        if (getEndpoint().isAuthenticationPreemptive()) {
+            BasicScheme basicAuth = new BasicScheme();
+            localContext.setAttribute("preemptive-auth", basicAuth);
+        }
         if (httpContext != null) {
-            return httpClient.execute(httpRequest, httpContext);
-        } else {
-            return httpClient.execute(httpRequest);
+            localContext = new BasicHttpContext(httpContext);
         }
+        return httpClient.execute(httpRequest, localContext);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/main/java/org/apache/camel/component/http4/ProxyHttpClientConfigurer.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/ProxyHttpClientConfigurer.java b/components/camel-http4/src/main/java/org/apache/camel/component/http4/ProxyHttpClientConfigurer.java
index c7d4b78..35d9234 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/ProxyHttpClientConfigurer.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/ProxyHttpClientConfigurer.java
@@ -21,9 +21,8 @@ import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
 import org.apache.http.auth.NTCredentials;
 import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.HttpClient;
-import org.apache.http.conn.params.ConnRoutePNames;
-import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.HttpClientBuilder;
 
 /**
  * Strategy for configuring the HttpClient with a proxy
@@ -52,8 +51,8 @@ public class ProxyHttpClientConfigurer implements HttpClientConfigurer {
         this.ntHost = ntHost;
     }
 
-    public void configureHttpClient(HttpClient client) {
-        client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(host, port, scheme));
+    public void configureHttpClient(HttpClientBuilder clientBuilder) {
+        clientBuilder.setProxy(new HttpHost(host, port, scheme));
 
         if (username != null && password != null) {
             Credentials defaultcreds;
@@ -62,7 +61,9 @@ public class ProxyHttpClientConfigurer implements HttpClientConfigurer {
             } else {
                 defaultcreds = new UsernamePasswordCredentials(username, password);
             }
-            ((DefaultHttpClient) client).getCredentialsProvider().setCredentials(AuthScope.ANY, defaultcreds);
+            BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+            credentialsProvider.setCredentials(AuthScope.ANY, defaultcreds);
+            clientBuilder.setDefaultCredentialsProvider(credentialsProvider);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/AdviceAndInterceptHttp4IssueTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/AdviceAndInterceptHttp4IssueTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/AdviceAndInterceptHttp4IssueTest.java
index 82085b5..d2fb645 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/AdviceAndInterceptHttp4IssueTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/AdviceAndInterceptHttp4IssueTest.java
@@ -29,7 +29,7 @@ import org.junit.Test;
 public class AdviceAndInterceptHttp4IssueTest extends CamelTestSupport {
 
     private String simpleProvider = "http4:fakeHTTPADDRESS.com:80?throwExceptionOnFailure=false";
-    private String providerWithParameter = "http4:fakeHTTPADDRESS.com:80?throwExceptionOnFailure=false&httpClient.cookiePolicy=ignoreCookies";
+    private String providerWithParameter = "http4:fakeHTTPADDRESS.com:80?throwExceptionOnFailure=false&httpClient.cookieSpec=ignoreCookies";
     private volatile boolean messageIntercepted;
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpAuthenticationTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpAuthenticationTest.java
index f9576a8..5ca499c 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpAuthenticationTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpAuthenticationTest.java
@@ -16,17 +16,22 @@
  */
 package org.apache.camel.component.http4;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.Processor;
 import org.apache.camel.component.http4.handler.AuthenticationValidationHandler;
+import org.apache.http.HttpRequestInterceptor;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpStatus;
 import org.apache.http.localserver.LocalTestServer;
 import org.apache.http.localserver.RequestBasicAuth;
 import org.apache.http.localserver.ResponseBasicUnauthorized;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.protocol.HttpProcessor;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.ResponseContent;
 import org.junit.Test;
 
@@ -45,7 +50,6 @@ public class HttpAuthenticationTest extends BaseHttpTest {
             public void process(Exchange exchange) throws Exception {
             }
         });
-
         assertExchange(exchange);
     }
     
@@ -82,13 +86,13 @@ public class HttpAuthenticationTest extends BaseHttpTest {
     }
 
     @Override
-    protected BasicHttpProcessor getBasicHttpProcessor() {
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new RequestBasicAuth());
-
-        httpproc.addInterceptor(new ResponseContent());
-        httpproc.addInterceptor(new ResponseBasicUnauthorized());
-
+    protected HttpProcessor getBasicHttpProcessor() {
+        List<HttpRequestInterceptor> requestInterceptors = new ArrayList<HttpRequestInterceptor>();
+        requestInterceptors.add(new RequestBasicAuth());
+        List<HttpResponseInterceptor> responseInterceptors = new ArrayList<HttpResponseInterceptor>();
+        responseInterceptors.add(new ResponseContent());
+        responseInterceptors.add(new ResponseBasicUnauthorized());
+        ImmutableHttpProcessor httpproc = new ImmutableHttpProcessor(requestInterceptors, responseInterceptors);
         return httpproc;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpCompressionTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpCompressionTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpCompressionTest.java
index 4d52668..2feab44 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpCompressionTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpCompressionTest.java
@@ -19,7 +19,9 @@ package org.apache.camel.component.http4;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.zip.GZIPInputStream;
 import java.util.zip.GZIPOutputStream;
@@ -39,9 +41,11 @@ import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpStatus;
 import org.apache.http.entity.HttpEntityWrapper;
 import org.apache.http.localserver.LocalTestServer;
+import org.apache.http.localserver.ResponseBasicUnauthorized;
 import org.apache.http.message.BasicHeader;
-import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.HttpProcessor;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.util.EntityUtils;
 import org.junit.Test;
 
@@ -74,12 +78,13 @@ public class HttpCompressionTest extends BaseHttpTest {
     }
 
     @Override
-    protected BasicHttpProcessor getBasicHttpProcessor() {
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new RequestDecompressingInterceptor());
-
-        httpproc.addInterceptor(new ResponseCompressingInterceptor());
-
+    protected HttpProcessor getBasicHttpProcessor() {
+        List<HttpRequestInterceptor> requestInterceptors = new ArrayList<HttpRequestInterceptor>();
+        requestInterceptors.add(new RequestDecompressingInterceptor());
+        List<HttpResponseInterceptor> responseInterceptors = new ArrayList<HttpResponseInterceptor>();
+        responseInterceptors.add(new ResponseCompressingInterceptor());
+        responseInterceptors.add(new ResponseBasicUnauthorized());
+        ImmutableHttpProcessor httpproc = new ImmutableHttpProcessor(requestInterceptors, responseInterceptors);
         return httpproc;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProducerContentTypeTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProducerContentTypeTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProducerContentTypeTest.java
index 2c42a84..601e89b 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProducerContentTypeTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProducerContentTypeTest.java
@@ -18,7 +18,6 @@
 package org.apache.camel.component.http4;
 
 import java.io.IOException;
-import java.util.List;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java
index b92f313..1d7a449 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpProxyServerTest.java
@@ -17,7 +17,9 @@
 package org.apache.camel.component.http4;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.camel.Exchange;
@@ -39,10 +41,11 @@ import org.apache.http.HttpStatus;
 import org.apache.http.ProtocolException;
 import org.apache.http.auth.AUTH;
 import org.apache.http.client.HttpClient;
-import org.apache.http.conn.params.ConnRoutePNames;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.localserver.LocalTestServer;
-import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.ResponseContent;
 import org.junit.After;
 import org.junit.Before;
@@ -62,11 +65,13 @@ public class HttpProxyServerTest extends BaseHttpTest {
     @Before
     public void setUp() throws Exception {
         super.setUp();
-
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new RequestProxyBasicAuth());
-        httpproc.addInterceptor(new ResponseContent());
-        httpproc.addInterceptor(new ResponseProxyBasicUnauthorized());
+        
+        List<HttpRequestInterceptor> requestInterceptors = new ArrayList<HttpRequestInterceptor>();
+        requestInterceptors.add(new RequestProxyBasicAuth());
+        List<HttpResponseInterceptor> responseInterceptors = new ArrayList<HttpResponseInterceptor>();
+        responseInterceptors.add(new ResponseContent());
+        responseInterceptors.add(new ResponseProxyBasicUnauthorized());
+        ImmutableHttpProcessor httpproc = new ImmutableHttpProcessor(requestInterceptors, responseInterceptors);
 
         proxy = new LocalTestServer(httpproc, null);
         proxy.start();
@@ -86,16 +91,7 @@ public class HttpProxyServerTest extends BaseHttpTest {
     public void testDifferentHttpProxyConfigured() throws Exception {
         HttpEndpoint http1 = context.getEndpoint("http4://www.google.com?proxyAuthHost=myproxy&proxyAuthPort=1234", HttpEndpoint.class);
         HttpEndpoint http2 = context.getEndpoint("http4://www.google.com?test=parameter&proxyAuthHost=myotherproxy&proxyAuthPort=2345", HttpEndpoint.class);
-
-        HttpClient client1 = http1.createHttpClient();
-        HttpHost proxy1 = (HttpHost)client1.getParams().getParameter(ConnRoutePNames.DEFAULT_PROXY);
-        assertEquals("myproxy", proxy1.getHostName());
-        assertEquals(1234, proxy1.getPort());
-        
-        HttpClient client2 = http2.createHttpClient();
-        HttpHost proxy2 = (HttpHost)client2.getParams().getParameter(ConnRoutePNames.DEFAULT_PROXY);
-        assertEquals("myotherproxy", proxy2.getHostName());
-        assertEquals(2345, proxy2.getPort());
+        // HttpClientBuilder doesn't support get the configuration here
         
         //As the endpointUri is recreated, so the parameter could be in different place, so we use the URISupport.normalizeUri
         assertEquals("Get a wrong endpoint uri of http1", "http4://www.google.com?proxyAuthHost=myproxy&proxyAuthPort=1234", URISupport.normalizeUri(http1.getEndpointUri()));
@@ -104,25 +100,6 @@ public class HttpProxyServerTest extends BaseHttpTest {
         assertEquals("Should get the same EndpointKey", http1.getEndpointKey(), http2.getEndpointKey());
     }
     
-    @Test
-    public void testhttpGetProxyScheme() throws Exception {
-        context.getProperties().put("http.proxyHost", "myProxy");
-        context.getProperties().put("http.proxyPort", "1234");
-        context.getProperties().put("http.proxyScheme", "http");
-        try {
-            HttpEndpoint http1 = context.getEndpoint("https4://www.google.com", HttpEndpoint.class);
-            
-            HttpClient client1 = http1.createHttpClient();
-            HttpHost proxy1 = (HttpHost)client1.getParams().getParameter(ConnRoutePNames.DEFAULT_PROXY);
-            assertEquals("myProxy", proxy1.getHostName());
-            assertEquals(1234, proxy1.getPort());
-            assertEquals("http", proxy1.getSchemeName());
-        } finally {
-            context.getProperties().remove("http.proxyHost");
-            context.getProperties().remove("http.proxyPort");
-            context.getProperties().remove("http.proxyScheme");
-        }
-    }
 
     @Test
     public void httpGetWithProxyAndWithoutUser() throws Exception {
@@ -217,7 +194,7 @@ public class HttpProxyServerTest extends BaseHttpTest {
     private int getProxyPort() {
         return proxy.getServiceAddress().getPort();
     }
-
+    
     class RequestProxyBasicAuth implements HttpRequestInterceptor {
         public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException {
             String auth = null;

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpRedirectTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpRedirectTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpRedirectTest.java
index 5c2a9b5..1251e13 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpRedirectTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpRedirectTest.java
@@ -40,8 +40,8 @@ public class HttpRedirectTest extends BaseHttpTest {
         localServer.register("/test", new RedirectHandler(HttpStatus.SC_MOVED_PERMANENTLY));
 
         String uri = "http4://" + getHostName() + ":" + getPort()
-                + "/test?httpClient.handleRedirects=false&httpClient.soTimeout=60000&httpClient.connectionTimeout=60000"
-                + "&httpClient.staleCheckingEnabled=false";
+                + "/test?httpClient.redirectsEnabled=false&httpClient.socketTimeout=60000&httpClient.connectTimeout=60000"
+                + "&httpClient.staleConnectionCheckEnabled=false";
         Exchange out = template.request(uri, new Processor() {
             public void process(Exchange exchange) throws Exception {
                 // no data
@@ -62,8 +62,8 @@ public class HttpRedirectTest extends BaseHttpTest {
         localServer.register("/someplaceelse", new BasicValidationHandler("GET", null, null, "Bye World"));
 
         String uri = "http4://" + getHostName() + ":" + getPort()
-                + "/test?httpClient.soTimeout=60000&httpClient.connectionTimeout=60000"
-                + "&httpClient.staleCheckingEnabled=false";
+                + "/test?httpClient.socketTimeout=60000&httpClient.connectTimeout=60000"
+                + "&httpClient.staleConnectionCheckEnabled=false";
         Exchange out = template.request(uri, new Processor() {
             public void process(Exchange exchange) throws Exception {
                 // no data

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpReferenceParameterTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpReferenceParameterTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpReferenceParameterTest.java
index 2baaa24..10781f1 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpReferenceParameterTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpReferenceParameterTest.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.http4;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.HttpContext;
 import org.junit.Test;
@@ -94,7 +94,7 @@ public class HttpReferenceParameterTest extends CamelTestSupport {
 
     private static class TestClientConfigurer implements HttpClientConfigurer {
 
-        public void configureHttpClient(HttpClient client) {
+        public void configureHttpClient(HttpClientBuilder clientBuilder) {
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpSOTimeoutTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpSOTimeoutTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpSOTimeoutTest.java
index a315409..f2b17b0 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpSOTimeoutTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpSOTimeoutTest.java
@@ -30,7 +30,7 @@ public class HttpSOTimeoutTest extends BaseHttpTest {
 
     @Test
     public void httpGet() throws Exception {
-        Exchange exchange = template.request("http4://" + getHostName() + ":" + getPort() + "?httpClient.soTimeout=5000", new Processor() {
+        Exchange exchange = template.request("http4://" + getHostName() + ":" + getPort() + "?httpClient.SocketTimeout=5000", new Processor() {
             public void process(Exchange exchange) throws Exception {
             }
         });
@@ -40,7 +40,7 @@ public class HttpSOTimeoutTest extends BaseHttpTest {
 
     @Test
     public void httpGetShouldThrowASocketTimeoutException() throws Exception {
-        Exchange reply = template.request("http4://" + getHostName() + ":" + getPort() + "?httpClient.soTimeout=1000", new Processor() {
+        Exchange reply = template.request("http4://" + getHostName() + ":" + getPort() + "?httpClient.SocketTimeout=1000", new Processor() {
             public void process(Exchange exchange) throws Exception {
             }
         });

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpServerTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpServerTestSupport.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpServerTestSupport.java
index aaf08df..4cec5d1 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpServerTestSupport.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpServerTestSupport.java
@@ -22,8 +22,8 @@ import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.http.ConnectionReuseStrategy;
 import org.apache.http.HttpResponseFactory;
 import org.apache.http.localserver.LocalTestServer;
-import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.HttpExpectationVerifier;
+import org.apache.http.protocol.HttpProcessor;
 import org.junit.After;
 import org.junit.Before;
 
@@ -68,9 +68,9 @@ public abstract class HttpServerTestSupport extends CamelTestSupport {
      * Returns the org.apache.http.protocol.BasicHttpProcessor which should be
      * used by the server.
      *
-     * @return basicHttpProcessor
+     * @return HttpProcessor
      */
-    protected BasicHttpProcessor getBasicHttpProcessor() {
+    protected HttpProcessor getBasicHttpProcessor() {
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpWithHttpUriHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpWithHttpUriHeaderTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpWithHttpUriHeaderTest.java
index 4f5d791..45c27de 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpWithHttpUriHeaderTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpWithHttpUriHeaderTest.java
@@ -36,7 +36,6 @@ public class HttpWithHttpUriHeaderTest extends BaseHttpTest {
                 exchange.getIn().setHeader(Exchange.HTTP_URI, "http4://" + getHostName() + ":" + getPort() + "/");
             }
         });
-
         assertExchange(exchange);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsAuthenticationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsAuthenticationTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsAuthenticationTest.java
index 1648177..abe552d 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsAuthenticationTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsAuthenticationTest.java
@@ -16,14 +16,21 @@
  */
 package org.apache.camel.component.http4;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.component.http4.handler.AuthenticationValidationHandler;
 import org.apache.camel.impl.JndiRegistry;
+import org.apache.http.HttpRequestInterceptor;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
 import org.apache.http.localserver.RequestBasicAuth;
 import org.apache.http.localserver.ResponseBasicUnauthorized;
-import org.apache.http.protocol.BasicHttpProcessor;
+
+import org.apache.http.protocol.HttpProcessor;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.ResponseContent;
 import org.junit.Test;
 
@@ -57,13 +64,14 @@ public class HttpsAuthenticationTest extends BaseHttpsTest {
     }
 
     @Override
-    protected BasicHttpProcessor getBasicHttpProcessor() {
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new RequestBasicAuth());
-
-        httpproc.addInterceptor(new ResponseContent());
-        httpproc.addInterceptor(new ResponseBasicUnauthorized());
-
+    protected HttpProcessor getBasicHttpProcessor() {
+        List<HttpRequestInterceptor> requestInterceptors = new ArrayList<HttpRequestInterceptor>();
+        requestInterceptors.add(new RequestBasicAuth());
+        List<HttpResponseInterceptor> responseInterceptors = new ArrayList<HttpResponseInterceptor>();
+        responseInterceptors.add(new ResponseContent());
+        responseInterceptors.add(new ResponseBasicUnauthorized());
+        ImmutableHttpProcessor httpproc = new ImmutableHttpProcessor(requestInterceptors, responseInterceptors);
+       
         return httpproc;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsTwoDifferentSslContextParametersGetTest.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsTwoDifferentSslContextParametersGetTest.java b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsTwoDifferentSslContextParametersGetTest.java
index 43c7a24..c98ef31 100644
--- a/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsTwoDifferentSslContextParametersGetTest.java
+++ b/components/camel-http4/src/test/java/org/apache/camel/component/http4/HttpsTwoDifferentSslContextParametersGetTest.java
@@ -21,8 +21,10 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.util.jsse.SSLContextParameters;
 import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
+import org.junit.Ignore;
 import org.junit.Test;
 
+@Ignore("Now we support to set sslContextParameters on different endpoints")
 public class HttpsTwoDifferentSslContextParametersGetTest extends BaseHttpsTest {
     
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/tests/camel-itest/src/test/java/org/apache/camel/itest/http/Http4RouteTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/http/Http4RouteTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/http/Http4RouteTest.java
index c4160a9..e6d35a4 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/http/Http4RouteTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/http/Http4RouteTest.java
@@ -30,7 +30,7 @@ public class Http4RouteTest extends CamelTestSupport {
     @Test
     public void sendHttpGetRequestTest() {
         String response = template.requestBody("http4://localhost:" + port 
-                         + "/test?aa=bb&httpClient.soTimeout=10000&httpClient.connectionTimeout=10000"
+                         + "/test?aa=bb&httpClient.socketTimeout=10000&httpClient.connectTimeout=10000"
                          + "&bridgeEndpoint=true&throwExceptionOnFailure=false" , null, String.class);
         assertEquals("aa=bb", response);
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/Http4EndpointTest-context.xml
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/Http4EndpointTest-context.xml b/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/Http4EndpointTest-context.xml
index f9abedd..66bce44 100644
--- a/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/Http4EndpointTest-context.xml
+++ b/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/Http4EndpointTest-context.xml
@@ -28,38 +28,16 @@
     
     <bean id="httpEndpoint" class="org.apache.camel.component.http4.HttpEndpoint">
         <property name="httpUri" value="http://127.0.0.1:${HttpTestServer.Port}/"/>
-        <property name="clientParams" ref="clientParams"/>
-        <property name="clientConnectionManager" ref="clientConnectionManager"/>
+        <property name="clientBuilder" ref="clientBuilder"/>
+        <property name="clientConnectionManager" ref="myManager"/>
     </bean>
-
-    <bean id="clientParams" class="org.apache.http.params.BasicHttpParams" />
-    
-    <bean id="clientConnectionManager" class="org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager">
-        <constructor-arg ref="clientParams"/>
-        <constructor-arg ref="schemeRegistry"/>
-    </bean>
-    
-    <bean id="plainSocketFactory" class="org.apache.http.conn.scheme.PlainSocketFactory" factory-method="getSocketFactory" />
     
-    <bean id="http" class="org.apache.http.conn.scheme.Scheme">
-    	<constructor-arg value="http" />
-    	<constructor-arg>
-    		<bean class="org.apache.http.conn.scheme.PlainSocketFactory" factory-method="getSocketFactory" />
-    	</constructor-arg>
-    	<constructor-arg value="80" />
-    </bean>
+    <bean id="myManager" class="org.apache.http.impl.conn.PoolingHttpClientConnectionManager"/>
+
+    <!-- You can set the client configuration by setting up the builder class -->
+    <bean id="clientBuilder" class="org.apache.http.impl.client.HttpClientBuilder" />
     
-    <bean id="schemeRegistry" class="org.apache.http.conn.scheme.SchemeRegistry" />
     
-    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-    	<property name="targetObject" ref="schemeRegistry"/>
-		<property name="targetMethod" value="register"/>
-    	<property name="arguments">
-    		<list>
-    			<ref bean="http"/>
-    		</list>
-    	</property>
-    </bean>
     <!-- END SNIPPET: e1 -->
 
     <!-- START SNIPPET: e2 -->

http://git-wip-us.apache.org/repos/asf/camel/blob/7e65a14d/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/Http4MaxConnectionPerHostTest-context.xml
----------------------------------------------------------------------
diff --git a/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/Http4MaxConnectionPerHostTest-context.xml b/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/Http4MaxConnectionPerHostTest-context.xml
index e2e97a6..1287de6 100644
--- a/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/Http4MaxConnectionPerHostTest-context.xml
+++ b/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/Http4MaxConnectionPerHostTest-context.xml
@@ -27,39 +27,9 @@
     <bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent"/>
     <bean id="httpComponent" class="org.apache.camel.component.http4.HttpComponent">
         <property name="camelContext" ref="camel"/>
-        <property name="clientConnectionManager" ref="clientConnectionManager"/>
         <property name="connectionsPerRoute" value="5" />
     </bean>
 
-    <bean id="clientConnectionManager" class="org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager">
-        <constructor-arg ref="clientParams"/>
-        <constructor-arg ref="schemeRegistry"/>
-    </bean>
-
-    <bean id="clientParams" class="org.apache.http.params.BasicHttpParams" />
-    
-    <bean id="plainSocketFactory" class="org.apache.http.conn.scheme.PlainSocketFactory" factory-method="getSocketFactory" />
-    
-    <bean id="http" class="org.apache.http.conn.scheme.Scheme">
-    	<constructor-arg value="http" />
-    	<constructor-arg>
-    		<bean class="org.apache.http.conn.scheme.PlainSocketFactory" factory-method="getSocketFactory" />
-    	</constructor-arg>
-    	<constructor-arg value="80" />
-    </bean>
-    
-    <bean id="schemeRegistry" class="org.apache.http.conn.scheme.SchemeRegistry" />
-    
-    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-    	<property name="targetObject" ref="schemeRegistry"/>
-		<property name="targetMethod" value="register"/>
-    	<property name="arguments">
-    		<list>
-    			<ref bean="http"/>
-    		</list>
-    	</property>
-    </bean>
-
     <!-- END SNIPPET: e1 -->
 
     <!-- START SNIPPET: e2 -->


[45/50] [abbrv] git commit: moved a bindy test into the right directory so that this test is executed

Posted by ni...@apache.org.
moved a bindy test into the right directory so that this test is executed


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f68954cd
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f68954cd
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f68954cd

Branch: refs/heads/camel-gora
Commit: f68954cde6ecae2e5b991fa2556120343c5e7b84
Parents: 8f32615
Author: cmueller <cm...@apache.org>
Authored: Sat Dec 7 21:38:43 2013 +0100
Committer: cmueller <cm...@apache.org>
Committed: Sat Dec 7 21:38:43 2013 +0100

----------------------------------------------------------------------
 .../csv/BindySimpleCsvAutospanLineTest.java     | 78 --------------------
 .../simple/spanLastRecord/SpanLastRecord.java   | 45 -----------
 .../csv/BindySimpleCsvAutospanLineTest.java     | 78 ++++++++++++++++++++
 .../simple/spanLastRecord/SpanLastRecord.java   | 61 +++++++++++++++
 4 files changed, 139 insertions(+), 123 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f68954cd/components/camel-bindy/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvAutospanLineTest.java
----------------------------------------------------------------------
diff --git a/components/camel-bindy/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvAutospanLineTest.java b/components/camel-bindy/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvAutospanLineTest.java
deleted file mode 100644
index 0df3f6d..0000000
--- a/components/camel-bindy/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvAutospanLineTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.dataformat.bindy.csv;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.dataformat.bindy.model.simple.spanLastRecord.SpanLastRecord;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.camel.util.CastUtils;
-import org.junit.Test;
-
-public class BindySimpleCsvAutospanLineTest extends CamelTestSupport {
-
-    @Test
-    public void testUnmarshalNoNeedToSpanLine() throws Exception {
-        final MockEndpoint mock = getMockEndpoint("mock:unmarshal");
-        mock.expectedMessageCount(1);
-
-        template.sendBody("direct:unmarshal", "1,hei,kommentar");
-
-        assertMockEndpointsSatisfied();
-
-        final List<Map<?, SpanLastRecord>> rows = CastUtils.cast(mock.getReceivedExchanges().get(0).getIn().getBody(List.class));
-        final SpanLastRecord order = rows.get(0).get(SpanLastRecord.class.getName());
-
-        assertEquals(1, order.getRecordId());
-        assertEquals("hei", order.getName());
-        assertEquals("kommentar", order.getComment());
-    }
-
-    @Test
-    public void testUnmarshalSpanningLine() throws Exception {
-        final MockEndpoint mock = getMockEndpoint("mock:unmarshal");
-        mock.expectedMessageCount(1);
-
-        template.sendBody("direct:unmarshal", "1,hei,kommentar,test,noe,hei");
-
-        assertMockEndpointsSatisfied();
-
-        final List<Map<?, SpanLastRecord>> rows = CastUtils.cast(mock.getReceivedExchanges().get(0).getIn().getBody(List.class));
-        final SpanLastRecord order = rows.get(0).get(SpanLastRecord.class.getName());
-
-        assertEquals(1, order.getRecordId());
-        assertEquals("hei", order.getName());
-        assertEquals("kommentar,test,noe,hei", order.getComment());
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                final BindyCsvDataFormat bindy = new BindyCsvDataFormat("org.apache.camel.dataformat.bindy.model.simple.spanLastRecord");
-
-                from("direct:unmarshal")
-                        .unmarshal(bindy)
-                        .to("mock:unmarshal");
-            }
-        };
-    }
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/f68954cd/components/camel-bindy/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/spanLastRecord/SpanLastRecord.java
----------------------------------------------------------------------
diff --git a/components/camel-bindy/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/spanLastRecord/SpanLastRecord.java b/components/camel-bindy/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/spanLastRecord/SpanLastRecord.java
deleted file mode 100644
index bcb01ee..0000000
--- a/components/camel-bindy/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/spanLastRecord/SpanLastRecord.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.apache.camel.dataformat.bindy.model.simple.spanLastRecord;
-
-import org.apache.camel.dataformat.bindy.annotation.CsvRecord;
-import org.apache.camel.dataformat.bindy.annotation.DataField;
-
-@CsvRecord(separator = ",", autospanLine = true)
-public class SpanLastRecord {
-
-    @DataField(pos = 1)
-    private int recordId;
-    @DataField(pos = 2)
-    private String name;
-    @DataField(pos = 3)
-    private String comment;
-
-    public int getRecordId() {
-        return recordId;
-    }
-
-    public void setRecordId(final int recordId) {
-        this.recordId = recordId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(final String name) {
-        this.name = name;
-    }
-
-    public String getComment() {
-        return comment;
-    }
-
-    public void setComment(final String comment) {
-        this.comment = comment;
-    }
-
-    @Override
-    public String toString() {
-        return "SpanLastRecord [recordId=" + recordId + ", name=" + name + ", comment=" + comment + "]";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/f68954cd/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvAutospanLineTest.java
----------------------------------------------------------------------
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvAutospanLineTest.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvAutospanLineTest.java
new file mode 100644
index 0000000..0df3f6d
--- /dev/null
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySimpleCsvAutospanLineTest.java
@@ -0,0 +1,78 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.csv;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.dataformat.bindy.model.simple.spanLastRecord.SpanLastRecord;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.camel.util.CastUtils;
+import org.junit.Test;
+
+public class BindySimpleCsvAutospanLineTest extends CamelTestSupport {
+
+    @Test
+    public void testUnmarshalNoNeedToSpanLine() throws Exception {
+        final MockEndpoint mock = getMockEndpoint("mock:unmarshal");
+        mock.expectedMessageCount(1);
+
+        template.sendBody("direct:unmarshal", "1,hei,kommentar");
+
+        assertMockEndpointsSatisfied();
+
+        final List<Map<?, SpanLastRecord>> rows = CastUtils.cast(mock.getReceivedExchanges().get(0).getIn().getBody(List.class));
+        final SpanLastRecord order = rows.get(0).get(SpanLastRecord.class.getName());
+
+        assertEquals(1, order.getRecordId());
+        assertEquals("hei", order.getName());
+        assertEquals("kommentar", order.getComment());
+    }
+
+    @Test
+    public void testUnmarshalSpanningLine() throws Exception {
+        final MockEndpoint mock = getMockEndpoint("mock:unmarshal");
+        mock.expectedMessageCount(1);
+
+        template.sendBody("direct:unmarshal", "1,hei,kommentar,test,noe,hei");
+
+        assertMockEndpointsSatisfied();
+
+        final List<Map<?, SpanLastRecord>> rows = CastUtils.cast(mock.getReceivedExchanges().get(0).getIn().getBody(List.class));
+        final SpanLastRecord order = rows.get(0).get(SpanLastRecord.class.getName());
+
+        assertEquals(1, order.getRecordId());
+        assertEquals("hei", order.getName());
+        assertEquals("kommentar,test,noe,hei", order.getComment());
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                final BindyCsvDataFormat bindy = new BindyCsvDataFormat("org.apache.camel.dataformat.bindy.model.simple.spanLastRecord");
+
+                from("direct:unmarshal")
+                        .unmarshal(bindy)
+                        .to("mock:unmarshal");
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/f68954cd/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/spanLastRecord/SpanLastRecord.java
----------------------------------------------------------------------
diff --git a/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/spanLastRecord/SpanLastRecord.java b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/spanLastRecord/SpanLastRecord.java
new file mode 100644
index 0000000..64ce3c5
--- /dev/null
+++ b/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/spanLastRecord/SpanLastRecord.java
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.bindy.model.simple.spanLastRecord;
+
+import org.apache.camel.dataformat.bindy.annotation.CsvRecord;
+import org.apache.camel.dataformat.bindy.annotation.DataField;
+
+@CsvRecord(separator = ",", autospanLine = true)
+public class SpanLastRecord {
+
+    @DataField(pos = 1)
+    private int recordId;
+    @DataField(pos = 2)
+    private String name;
+    @DataField(pos = 3)
+    private String comment;
+
+    public int getRecordId() {
+        return recordId;
+    }
+
+    public void setRecordId(final int recordId) {
+        this.recordId = recordId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(final String comment) {
+        this.comment = comment;
+    }
+
+    @Override
+    public String toString() {
+        return "SpanLastRecord [recordId=" + recordId + ", name=" + name + ", comment=" + comment + "]";
+    }
+
+}


[48/50] [abbrv] git commit: Fixed the CS errors of camel-gora

Posted by ni...@apache.org.
Fixed the CS errors of camel-gora


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/84b80994
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/84b80994
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/84b80994

Branch: refs/heads/camel-gora
Commit: 84b8099455c1cb2abc52b812892431b92b9f0576
Parents: 8ad60f0
Author: Willem Jiang <wi...@gmail.com>
Authored: Tue Nov 19 14:35:45 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Dec 9 10:07:07 2013 +0800

----------------------------------------------------------------------
 components/camel-gora/pom.xml                   |  2 +-
 .../camel/component/gora/GoraComponent.java     | 20 ++++------
 .../camel/component/gora/GoraConfiguration.java | 12 ++----
 .../camel/component/gora/GoraConsumer.java      | 20 ++++------
 .../camel/component/gora/GoraEndpoint.java      | 10 ++---
 .../camel/component/gora/GoraProducer.java      | 25 ++++++------
 .../camel/component/gora/utils/GoraUtils.java   | 40 ++++++++-----------
 .../component/gora/GoraConfigurationTest.java   | 15 ++++---
 .../camel/component/gora/GoraConsumerTest.java  | 14 ++-----
 .../camel/component/gora/GoraProducerTest.java  | 41 ++++++++------------
 .../camel/component/gora/GoraTestSupport.java   |  1 -
 .../component/gora/utils/GoraUtilsTest.java     |  8 ++--
 12 files changed, 86 insertions(+), 122 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-gora/pom.xml b/components/camel-gora/pom.xml
index f2318ff..0f9aef1 100644
--- a/components/camel-gora/pom.xml
+++ b/components/camel-gora/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.camel</groupId>
         <artifactId>components</artifactId>
-        <version>2.12-SNAPSHOT</version>
+        <version>2.13-SNAPSHOT</version>
     </parent>
 
     <artifactId>camel-gora</artifactId>

http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java
index 03f2573..0a162fd 100644
--- a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java
@@ -17,33 +17,29 @@
 
 package org.apache.camel.component.gora;
 
-import org.apache.camel.CamelContext;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Properties;
+
 import org.apache.camel.Endpoint;
 import org.apache.camel.impl.DefaultComponent;
-
 import org.apache.gora.persistency.Persistent;
 import org.apache.gora.store.DataStore;
 import org.apache.gora.store.DataStoreFactory;
 import org.apache.hadoop.conf.Configuration;
 
-import java.io.IOException;
-import java.util.Map;
-import java.util.Properties;
-
 import static org.apache.camel.component.gora.GoraConstants.GORA_DEFAULT_DATASTORE_KEY;
 
-
 /**
  * Camel-Gora {@link Endpoint}.
  *
- * @author ipolyzos
  */
 public class GoraComponent extends DefaultComponent {
 
     /**
      * GORA datastore
      */
-    private DataStore<Object,? extends Persistent> dataStore;
+    private DataStore<Object, Persistent> dataStore;
 
     /**
      * GORA properties
@@ -87,10 +83,10 @@ public class GoraComponent extends DefaultComponent {
 
         try {
 
-           init(config);
+            init(config);
         } catch (IOException ex) {
 
-           throw new RuntimeException(ex);
+            throw new RuntimeException(ex);
         }
 
         return new GoraEndpoint(uri, this, config, dataStore);
@@ -101,7 +97,7 @@ public class GoraComponent extends DefaultComponent {
      *
      * @return DataStore
      */
-    public DataStore getDataStore() {
+    public DataStore<Object, Persistent> getDataStore() {
 
         return dataStore;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConfiguration.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConfiguration.java
index 3deabee..5456522 100644
--- a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConfiguration.java
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConfiguration.java
@@ -27,7 +27,6 @@ import static com.google.common.base.Strings.isNullOrEmpty;
 /**
  * Gora Configuration.
  *
- * @author ipolyzos
  */
 public class GoraConfiguration {
 
@@ -148,8 +147,7 @@ public class GoraConfiguration {
      */
     public void setKeyClass(final String keyClass) {
 
-        if (isNullOrEmpty(keyClass)){
-
+        if (isNullOrEmpty(keyClass)) {
             throw new IllegalArgumentException("Key class could not be null or empty!");
         }
 
@@ -173,8 +171,7 @@ public class GoraConfiguration {
      */
     public void setValueClass(final String valueClass) {
 
-        if (isNullOrEmpty(valueClass)){
-
+        if (isNullOrEmpty(valueClass)) {
             throw new IllegalArgumentException("Value class  could not be null or empty!");
         }
 
@@ -199,8 +196,7 @@ public class GoraConfiguration {
     public void setDataStoreClass(String dataStoreClass) {
 
 
-        if (isNullOrEmpty(dataStoreClass)){
-
+        if (isNullOrEmpty(dataStoreClass)) {
             throw new IllegalArgumentException("DataStore class could not be null or empty!");
         }
 
@@ -470,7 +466,7 @@ public class GoraConfiguration {
      */
     public void setHadoopConfiguration(Configuration hadoopConfiguration) {
 
-        checkNotNull(hadoopConfiguration,"Hadoop Configuration could not be null!");
+        checkNotNull(hadoopConfiguration, "Hadoop Configuration could not be null!");
         this.hadoopConfiguration = hadoopConfiguration;
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConsumer.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConsumer.java
index 51983a4..24c2e22 100644
--- a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConsumer.java
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraConsumer.java
@@ -17,27 +17,25 @@
 
 package org.apache.camel.component.gora;
 
+import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.ExecutorService;
+
 import org.apache.camel.Consumer;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.component.gora.utils.GoraUtils;
 import org.apache.camel.impl.ScheduledPollConsumer;
-import org.apache.camel.util.ObjectHelper;
+import org.apache.gora.persistency.Persistent;
 import org.apache.gora.query.Query;
 import org.apache.gora.query.Result;
 import org.apache.gora.store.DataStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.lang.reflect.InvocationTargetException;
-import java.util.Date;
-import java.util.concurrent.ExecutorService;
-
 /**
  * Implementation of Camel-Gora {@link Consumer}.
  *
- * @author ipolyzos
  */
 public class GoraConsumer extends ScheduledPollConsumer {
 
@@ -49,7 +47,7 @@ public class GoraConsumer extends ScheduledPollConsumer {
     /**
      * GORA datastore
      */
-    private final DataStore dataStore;
+    private final DataStore<Object, Persistent> dataStore;
 
     /**
      * Camel-Gora endpoint configuration
@@ -83,7 +81,7 @@ public class GoraConsumer extends ScheduledPollConsumer {
     public GoraConsumer(final Endpoint endpoint,
                         final Processor processor,
                         final GoraConfiguration configuration,
-                        final DataStore dataStore) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
+                        final DataStore<Object, Persistent> dataStore) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
 
         super(endpoint, processor);
 
@@ -102,11 +100,9 @@ public class GoraConsumer extends ScheduledPollConsumer {
         final Exchange exchange = this.getEndpoint().createExchange();
 
         // compute time (aprox) since last update
-        if(firstRun){
-
+        if (firstRun) {
             this.query.setStartTime(System.currentTimeMillis());
-        }else{
-
+        } else {
             this.query.setStartTime(System.currentTimeMillis() - getDelay());
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java
index 2674013..df5c628 100644
--- a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraEndpoint.java
@@ -21,6 +21,7 @@ import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.gora.persistency.Persistent;
 import org.apache.gora.store.DataStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -40,7 +41,7 @@ public class GoraEndpoint extends DefaultEndpoint {
     /**
      * Gora DataStore
      */
-    private final DataStore dataStore;
+    private final DataStore<Object, Persistent> dataStore;
 
     /**
      * Camel-Gora Endpoint Configuratopn
@@ -58,7 +59,7 @@ public class GoraEndpoint extends DefaultEndpoint {
     public GoraEndpoint(final String uri,
                         final GoraComponent goraComponent,
                         final GoraConfiguration config,
-                        final DataStore dataStore) {
+                        final DataStore<Object, Persistent> dataStore) {
 
         super(uri, goraComponent);
         this.configuration = config;
@@ -79,9 +80,8 @@ public class GoraEndpoint extends DefaultEndpoint {
      */
     @Override
     public Consumer createConsumer(final Processor processor) throws Exception {
-
-        //throw new UnsupportedOperationException("Not supported");
-        return new GoraConsumer(this,processor ,this.configuration, this.dataStore);
+        
+        return new GoraConsumer(this, processor, this.configuration, this.dataStore);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraProducer.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraProducer.java
index d395fc6..7e25fd5 100644
--- a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraProducer.java
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraProducer.java
@@ -17,22 +17,25 @@
 
 package org.apache.camel.component.gora;
 
+import java.util.Map;
+
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.ServicePoolAware;
 import org.apache.camel.impl.DefaultProducer;
+import org.apache.gora.persistency.Persistent;
 import org.apache.gora.store.DataStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Map;
+import static org.apache.camel.component.gora.utils.GoraUtils.constractQueryFromPropertiesMap;
+import static org.apache.camel.component.gora.utils.GoraUtils.getKeyFromExchange;
+import static org.apache.camel.component.gora.utils.GoraUtils.getValueFromExchange;
 
-import static org.apache.camel.component.gora.utils.GoraUtils.*;
 
 /**
  * Camel-Gora {@link DefaultProducer}.
  *
- * @author ipolyzos
  */
 public class GoraProducer extends DefaultProducer implements ServicePoolAware {
 
@@ -49,7 +52,7 @@ public class GoraProducer extends DefaultProducer implements ServicePoolAware {
     /**
      * GORA datastore
      */
-    private final DataStore dataStore;
+    private final DataStore<Object, Persistent> dataStore;
 
     /**
      * Constructor
@@ -60,7 +63,7 @@ public class GoraProducer extends DefaultProducer implements ServicePoolAware {
      */
     public GoraProducer(final Endpoint endpoint,
                         final GoraConfiguration configuration,
-                        final DataStore dataStore) {
+                        final DataStore<Object, Persistent> dataStore) {
 
         super(endpoint);
         this.dataStore = dataStore;
@@ -93,12 +96,12 @@ public class GoraProducer extends DefaultProducer implements ServicePoolAware {
             result = dataStore.delete(getKeyFromExchange(exchange));
         } else if (GoraOperation.QUERY.value.equalsIgnoreCase(operation)) {
 
-            final Map<String,Object> props = exchange.getIn().getHeaders();
-            result = constractQueryFromPropertiesMap(props,dataStore,this.configuration).execute();
+            final Map<String, Object> props = exchange.getIn().getHeaders();
+            result = constractQueryFromPropertiesMap(props, dataStore, this.configuration).execute();
         } else if (GoraOperation.DELETE_BY_QUERY.value.equalsIgnoreCase(operation)) {
 
-            final Map<String,Object> props = exchange.getIn().getHeaders();
-            result = dataStore.deleteByQuery(constractQueryFromPropertiesMap(props,dataStore,this.configuration));
+            final Map<String, Object> props = exchange.getIn().getHeaders();
+            result = dataStore.deleteByQuery(constractQueryFromPropertiesMap(props, dataStore, this.configuration));
         } else if (GoraOperation.GET_SCHEMA_NAME.value.equalsIgnoreCase(operation)) {
 
             result = dataStore.getSchemaName();
@@ -111,7 +114,7 @@ public class GoraProducer extends DefaultProducer implements ServicePoolAware {
         } else if (GoraOperation.SCHEMA_EXIST.value.equalsIgnoreCase(operation)) {
 
             result = dataStore.schemaExists();
-        }else {
+        } else {
 
             throw new RuntimeException("Unknown operation!");
         }
@@ -121,7 +124,7 @@ public class GoraProducer extends DefaultProducer implements ServicePoolAware {
            therefore a temporary solution is calling flush
            on every action
         */
-        if (configuration.isFlushOnEveryOperation()){
+        if (configuration.isFlushOnEveryOperation()) {
             dataStore.flush();
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/src/main/java/org/apache/camel/component/gora/utils/GoraUtils.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/utils/GoraUtils.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/utils/GoraUtils.java
index bec9de4..58c4cf6 100644
--- a/components/camel-gora/src/main/java/org/apache/camel/component/gora/utils/GoraUtils.java
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/utils/GoraUtils.java
@@ -17,7 +17,9 @@
 
 package org.apache.camel.component.gora.utils;
 
-import com.google.common.base.Objects;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Map;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.component.gora.GoraAttribute;
 import org.apache.camel.component.gora.GoraConfiguration;
@@ -25,25 +27,16 @@ import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.gora.persistency.Persistent;
 import org.apache.gora.query.Query;
 import org.apache.gora.store.DataStore;
-import org.apache.gora.store.DataStoreFactory;
-import org.apache.gora.util.GoraException;
-import org.apache.gora.util.IOUtils;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
 
-import static com.google.common.base.Preconditions.*;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 /**
  * GoraUtil class contain utility methods for the
  * camel component.
  *
- * @author ipolyzos
  */
-public class GoraUtils {
-
-
-
+public final class GoraUtils {
+    
     /**
      * Private Constructor to prevent
      * instantiation of the class.
@@ -67,11 +60,10 @@ public class GoraUtils {
      * @throws NoSuchMethodException
      * @throws InvocationTargetException
      */
-    public static Query<?, ? extends Persistent> constractQueryFromConfiguration(final DataStore dataStore,
-                                                                                 final GoraConfiguration conf) throws ClassNotFoundException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
-
+    public static Query<Object, Persistent> constractQueryFromConfiguration(final DataStore<Object, Persistent> dataStore, final GoraConfiguration conf)
+        throws ClassNotFoundException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
 
-        final Query query = dataStore.newQuery();
+        final Query<Object , Persistent> query = dataStore.newQuery();
 
         if (configurationExist(GoraAttribute.GORA_QUERY_START_TIME, conf)) {
             query.setStartTime(getAttributeAsLong(GoraAttribute.GORA_QUERY_START_TIME, conf));
@@ -124,12 +116,12 @@ public class GoraUtils {
      * @return
      * @throws ClassNotFoundException
      */
-    public static Query<?, ? extends Persistent> constractQueryFromPropertiesMap(final Map<String, ?> propertiesMap,
-                                                                                 final DataStore dataStore,
+    public static Query<Object, Persistent> constractQueryFromPropertiesMap(final Map<String, ?> propertiesMap,
+                                                                                 final DataStore<Object, Persistent> dataStore,
                                                                                  final GoraConfiguration conf) throws ClassNotFoundException {
 
 
-        final Query query = dataStore.newQuery();
+        final Query<Object, Persistent> query = dataStore.newQuery();
 
         if (propertyExist(GoraAttribute.GORA_QUERY_START_TIME, propertiesMap)) {
             query.setStartTime(getPropertyAsLong(GoraAttribute.GORA_QUERY_START_TIME, propertiesMap));
@@ -145,8 +137,8 @@ public class GoraUtils {
 
         if (propertyExist(GoraAttribute.GORA_QUERY_TIME_RANGE_FROM, propertiesMap)
                 && propertyExist(GoraAttribute.GORA_QUERY_TIME_RANGE_TO, propertiesMap)) {
-                    query.setTimeRange(getPropertyAsLong(GoraAttribute.GORA_QUERY_TIME_RANGE_FROM, propertiesMap),
-                    getPropertyAsLong(GoraAttribute.GORA_QUERY_TIME_RANGE_TO, propertiesMap));
+            query.setTimeRange(getPropertyAsLong(GoraAttribute.GORA_QUERY_TIME_RANGE_FROM, propertiesMap),
+                               getPropertyAsLong(GoraAttribute.GORA_QUERY_TIME_RANGE_TO, propertiesMap));
         }
 
         if (propertyExist(GoraAttribute.GORA_QUERY_TIMESTAMP, propertiesMap)) {
@@ -186,7 +178,7 @@ public class GoraUtils {
     protected static boolean configurationExist(final GoraAttribute attr,
                                                 final GoraConfiguration conf) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
 
-        return (PropertyUtils.getSimpleProperty(conf, attr.value) != null);
+        return PropertyUtils.getSimpleProperty(conf, attr.value) != null;
     }
 
     /**
@@ -249,7 +241,7 @@ public class GoraUtils {
     protected static Long getAttributeAsLong(final GoraAttribute attr,
                                            final GoraConfiguration conf) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
 
-        return Long.parseLong(getAttributeAsString(attr,conf));
+        return Long.parseLong(getAttributeAsString(attr, conf));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConfigurationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConfigurationTest.java b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConfigurationTest.java
index dcfd548..ef20e31 100644
--- a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConfigurationTest.java
+++ b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConfigurationTest.java
@@ -22,55 +22,54 @@ import org.junit.Test;
 /**
  * GORA Configuration Tests
  *
- * @author ipolyzos
  */
 public class GoraConfigurationTest {
 
 
     @Test(expected = IllegalArgumentException.class)
-    public void setKeyClassClassShouldThrowExceptionIfNull(){
+    public void setKeyClassClassShouldThrowExceptionIfNull() {
 
         final GoraConfiguration conf = new GoraConfiguration();
         conf.setValueClass(null);
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void setKeyClassShouldThrowExceptionIfEmpty(){
+    public void setKeyClassShouldThrowExceptionIfEmpty() {
 
         final GoraConfiguration conf = new GoraConfiguration();
         conf.setValueClass("");
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void setValueClassClassShouldThrowExceptionIfNull(){
+    public void setValueClassClassShouldThrowExceptionIfNull() {
 
         final GoraConfiguration conf = new GoraConfiguration();
         conf.setValueClass(null);
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void setValueClassClassShouldThrowExceptionIfEmpty(){
+    public void setValueClassClassShouldThrowExceptionIfEmpty() {
 
         final GoraConfiguration conf = new GoraConfiguration();
         conf.setValueClass("");
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void setDataStoreClassShouldThrowExceptionIfNull(){
+    public void setDataStoreClassShouldThrowExceptionIfNull() {
 
         final GoraConfiguration conf = new GoraConfiguration();
         conf.setDataStoreClass(null);
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void setDataStoreClassShouldThrowExceptionIfEmpty(){
+    public void setDataStoreClassShouldThrowExceptionIfEmpty() {
 
         final GoraConfiguration conf = new GoraConfiguration();
         conf.setDataStoreClass("");
     }
 
     @Test(expected = NullPointerException.class)
-    public void setHadoopConfigurationShouldThrowExceptionIfNull(){
+    public void setHadoopConfigurationShouldThrowExceptionIfNull() {
 
         final GoraConfiguration conf = new GoraConfiguration();
         conf.setHadoopConfiguration(null);

http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConsumerTest.java b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConsumerTest.java
index 605591c..f2d22b0 100644
--- a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConsumerTest.java
+++ b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraConsumerTest.java
@@ -17,25 +17,23 @@
 
 package org.apache.camel.component.gora;
 
+import java.lang.reflect.InvocationTargetException;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Message;
 import org.apache.camel.Processor;
-import org.apache.camel.component.gora.utils.GoraUtils;
 import org.apache.gora.query.Query;
 import org.apache.gora.store.DataStore;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.lang.reflect.InvocationTargetException;
-
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 /**
  * GORA Consumer Tests
  *
- * @author ipolyzos
  */
 public class GoraConsumerTest extends GoraTestSupport {
 
@@ -68,11 +66,7 @@ public class GoraConsumerTest extends GoraTestSupport {
      * Mock Processor
      */
     private Processor mockGoraProcessor;
-
-    /**
-     * Mock GoraUtils
-     */
-    private GoraUtils mockGoraUtils;
+    
 
     @Before
     public void setUp()  {
@@ -83,7 +77,7 @@ public class GoraConsumerTest extends GoraTestSupport {
         mockGoraConfiguration = mock(GoraConfiguration.class);
         mockCamelMessage = mock(Message.class);
         mockDatastore = mock(DataStore.class);
-        mockGoraUtils = mock(GoraUtils.class);
+        
 
         //setup default conditions
         when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);

http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraProducerTest.java b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraProducerTest.java
index 1bf4df8..4012e82 100644
--- a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraProducerTest.java
+++ b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraProducerTest.java
@@ -17,45 +17,36 @@
 
 package org.apache.camel.component.gora;
 
+import java.util.Map;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Message;
 import org.apache.camel.component.gora.utils.GoraUtils;
 import org.apache.gora.persistency.Persistent;
-import org.apache.gora.persistency.StateManager;
 import org.apache.gora.query.Query;
 import org.apache.gora.query.impl.QueryBase;
 import org.apache.gora.store.DataStore;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.internal.verification.VerificationModeFactory;
-import org.mockito.stubbing.OngoingStubbing;
-import org.mockito.verification.VerificationMode;
-import org.powermock.api.mockito.PowerMockito;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import java.util.*;
-
-
 import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.atMost;
 import static org.mockito.Mockito.verify;
 import static org.mockito.internal.verification.VerificationModeFactory.times;
-import static org.powermock.api.mockito.PowerMockito.mockStatic;
 import static org.powermock.api.mockito.PowerMockito.mock;
-import static org.powermock.api.mockito.PowerMockito.when;
+import static org.powermock.api.mockito.PowerMockito.mockStatic;
 import static org.powermock.api.mockito.PowerMockito.verifyStatic;
+import static org.powermock.api.mockito.PowerMockito.when;
 
 /**
  * GORA Producer Tests
  *
  * TODO: <b>NOTE:</b> Query methods does not yet has tests
  *
- * @author ipolyzos
  */
 @RunWith(PowerMockRunner.class)
 @PrepareForTest(GoraUtils.class)
@@ -104,7 +95,7 @@ public class GoraProducerTest extends GoraTestSupport {
     @Test(expected = RuntimeException.class)
     public void processShouldThrowExceptionIfOperationIsNull() throws Exception {
 
-        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint, mockGoraConfiguration, mockDatastore);
         producer.process(mockCamelExchange);
     }
 
@@ -115,7 +106,7 @@ public class GoraProducerTest extends GoraTestSupport {
         when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
         when(mockCamelMessage.getHeader(GoraAttribute.GORA_OPERATION.value)).thenReturn("dah");
 
-        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint, mockGoraConfiguration, mockDatastore);
         producer.process(mockCamelExchange);
 
         verify(mockCamelExchange, atMost(1)).getIn();
@@ -137,14 +128,14 @@ public class GoraProducerTest extends GoraTestSupport {
         final Message outMessage = mock(Message.class);
         when(mockCamelExchange.getOut()).thenReturn(outMessage);
 
-        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint, mockGoraConfiguration, mockDatastore);
         producer.process(mockCamelExchange);
 
         verify(mockCamelExchange, atLeastOnce()).getIn();
         verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_OPERATION.value);
         verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_KEY.value);
         verify(mockCamelMessage, atLeastOnce()).getBody(Persistent.class);
-        verify(mockDatastore, atMost(1)).put(sampleKey,sampleValue);
+        verify(mockDatastore, atMost(1)).put(sampleKey, sampleValue);
     }
 
     @Test
@@ -159,7 +150,7 @@ public class GoraProducerTest extends GoraTestSupport {
         final Message outMessage = mock(Message.class);
         when(mockCamelExchange.getOut()).thenReturn(outMessage);
 
-        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint, mockGoraConfiguration, mockDatastore);
         producer.process(mockCamelExchange);
 
         verify(mockCamelExchange, atLeastOnce()).getIn();
@@ -180,7 +171,7 @@ public class GoraProducerTest extends GoraTestSupport {
         final Message outMessage = mock(Message.class);
         when(mockCamelExchange.getOut()).thenReturn(outMessage);
 
-        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint, mockGoraConfiguration, mockDatastore);
         producer.process(mockCamelExchange);
 
         verify(mockCamelExchange, atLeastOnce()).getIn();
@@ -198,7 +189,7 @@ public class GoraProducerTest extends GoraTestSupport {
         final Message outMessage = mock(Message.class);
         when(mockCamelExchange.getOut()).thenReturn(outMessage);
 
-        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint, mockGoraConfiguration, mockDatastore);
         producer.process(mockCamelExchange);
 
         verify(mockCamelExchange, atLeastOnce()).getIn();
@@ -215,7 +206,7 @@ public class GoraProducerTest extends GoraTestSupport {
         final Message outMessage = mock(Message.class);
         when(mockCamelExchange.getOut()).thenReturn(outMessage);
 
-        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint, mockGoraConfiguration, mockDatastore);
         producer.process(mockCamelExchange);
 
         verify(mockCamelExchange, atLeastOnce()).getIn();
@@ -233,7 +224,7 @@ public class GoraProducerTest extends GoraTestSupport {
         final Message outMessage = mock(Message.class);
         when(mockCamelExchange.getOut()).thenReturn(outMessage);
 
-        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint, mockGoraConfiguration, mockDatastore);
         producer.process(mockCamelExchange);
 
         verify(mockCamelExchange, atLeastOnce()).getIn();
@@ -251,7 +242,7 @@ public class GoraProducerTest extends GoraTestSupport {
         final Message outMessage = mock(Message.class);
         when(mockCamelExchange.getOut()).thenReturn(outMessage);
 
-        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint, mockGoraConfiguration, mockDatastore);
         producer.process(mockCamelExchange);
 
         verify(mockCamelExchange, atLeastOnce()).getIn();
@@ -276,7 +267,7 @@ public class GoraProducerTest extends GoraTestSupport {
         final Query mockQuery = mock(QueryBase.class);
         when(GoraUtils.constractQueryFromPropertiesMap(mockProperties, mockDatastore, mockGoraConfiguration)).thenReturn(mockQuery);
 
-        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint, mockGoraConfiguration, mockDatastore);
         producer.process(mockCamelExchange);
 
         verify(mockCamelExchange, atLeastOnce()).getIn();
@@ -302,7 +293,7 @@ public class GoraProducerTest extends GoraTestSupport {
         final Query mockQuery = mock(QueryBase.class);
         when(GoraUtils.constractQueryFromPropertiesMap(mockProperties, mockDatastore, mockGoraConfiguration)).thenReturn(mockQuery);
 
-        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint, mockGoraConfiguration, mockDatastore);
         producer.process(mockCamelExchange);
 
         verify(mockCamelExchange, atLeastOnce()).getIn();

http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraTestSupport.java b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraTestSupport.java
index 939763d..3d11e80 100644
--- a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraTestSupport.java
+++ b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraTestSupport.java
@@ -22,7 +22,6 @@ import org.apache.camel.test.junit4.CamelTestSupport;
 /**
  * GORA Test Support
  *
- * @author ipolyzos
  */
 public class GoraTestSupport extends CamelTestSupport {
     //TODO

http://git-wip-us.apache.org/repos/asf/camel/blob/84b80994/components/camel-gora/src/test/java/org/apache/camel/component/gora/utils/GoraUtilsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/test/java/org/apache/camel/component/gora/utils/GoraUtilsTest.java b/components/camel-gora/src/test/java/org/apache/camel/component/gora/utils/GoraUtilsTest.java
index c2c4ecef..56ecfb4 100644
--- a/components/camel-gora/src/test/java/org/apache/camel/component/gora/utils/GoraUtilsTest.java
+++ b/components/camel-gora/src/test/java/org/apache/camel/component/gora/utils/GoraUtilsTest.java
@@ -22,28 +22,26 @@ import org.apache.camel.component.gora.GoraConfiguration;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 /**
  * GORA Utils Tests
  *
- * @author ipolyzos
  */
 public class GoraUtilsTest {
 
     @Test
     public void configurationExistShouldSucceedtIfMethodExist() throws Exception {
 
-       final GoraConfiguration conf = new GoraConfiguration();
-       assertTrue(GoraUtils.configurationExist(GoraAttribute.GORA_QUERY_LIMIT,conf));
+        final GoraConfiguration conf = new GoraConfiguration();
+        assertTrue(GoraUtils.configurationExist(GoraAttribute.GORA_QUERY_LIMIT, conf));
     }
 
     @Test(expected = NoSuchMethodException.class)
     public void configurationExistShouldThrowExceptionIfMethodDoesNotExist() throws Exception {
 
         final GoraConfiguration conf = new GoraConfiguration();
-        GoraUtils.configurationExist(GoraAttribute.GORA_KEY,conf);
+        GoraUtils.configurationExist(GoraAttribute.GORA_KEY, conf);
     }
 
     @Test


[23/50] [abbrv] git commit: Ensure quartz2 does not do online update check. The key for quartz2 is different in their docs.

Posted by ni...@apache.org.
Ensure quartz2 does not do online update check. The key for quartz2 is different in their docs.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/125d751c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/125d751c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/125d751c

Branch: refs/heads/camel-gora
Commit: 125d751c0f1f66a75121e83d65fb0a7699c1b419
Parents: ea88253
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Dec 2 21:59:15 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Dec 3 10:49:50 2013 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/component/quartz2/QuartzComponent.java   | 2 ++
 .../component/quartz2/SpringQuartzConsumerClusteredAppOne.xml      | 1 +
 .../component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml      | 1 +
 .../component/quartz2/SpringQuartzPersistentStoreRestartTest.xml   | 2 +-
 .../camel/component/quartz2/SpringQuartzPersistentStoreTest.xml    | 1 +
 .../camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml      | 1 +
 .../camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml      | 1 +
 7 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/125d751c/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
index d3e5e18..701b966 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
@@ -111,6 +111,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
 
             // force disabling update checker (will do online check over the internet)
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
+            prop.put("org.terracotta.quartz.skipUpdateCheck", "true");
 
             answer = new StdSchedulerFactory(prop);
         } else {
@@ -143,6 +144,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
 
             // force disabling update checker (will do online check over the internet)
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
+            prop.put("org.terracotta.quartz.skipUpdateCheck=true", "true");
 
             answer = new StdSchedulerFactory(prop);
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/125d751c/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppOne.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppOne.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppOne.xml
index 6d6a224..1b52b5d 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppOne.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppOne.xml
@@ -51,6 +51,7 @@
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">app-one</prop>
         <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">true</prop>
         <prop key="org.quartz.jobStore.clusterCheckinInterval">5000</prop>

http://git-wip-us.apache.org/repos/asf/camel/blob/125d751c/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml
index cef6baf..f1273a4 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml
@@ -49,6 +49,7 @@
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">app-two</prop>
         <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">true</prop>
         <prop key="org.quartz.jobStore.clusterCheckinInterval">5000</prop>

http://git-wip-us.apache.org/repos/asf/camel/blob/125d751c/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartTest.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartTest.xml
index 6f498aa..097cece 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartTest.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartTest.xml
@@ -48,7 +48,7 @@
       <props>
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">AUTO</prop>
-        <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">false</prop>
       </props>

http://git-wip-us.apache.org/repos/asf/camel/blob/125d751c/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreTest.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreTest.xml
index 851f3c5..871f182 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreTest.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreTest.xml
@@ -49,6 +49,7 @@
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">AUTO</prop>
         <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">false</prop>
       </props>

http://git-wip-us.apache.org/repos/asf/camel/blob/125d751c/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml
index d48d982..3c230d8 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml
@@ -49,6 +49,7 @@
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">app-one</prop>
         <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">true</prop>
         <prop key="org.quartz.jobStore.clusterCheckinInterval">5000</prop>

http://git-wip-us.apache.org/repos/asf/camel/blob/125d751c/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml
index 6b8406e..a01dde6 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml
@@ -49,6 +49,7 @@
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">app-two</prop>
         <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">true</prop>
         <prop key="org.quartz.jobStore.clusterCheckinInterval">5000</prop>


[26/50] [abbrv] git commit: CAMEL-7030: quartz components now register the quartz scheduler in JMX by default, unless configured not to do so by end user.

Posted by ni...@apache.org.
CAMEL-7030: quartz components now register the quartz scheduler in JMX by default, unless configured not to do so by end user.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/126c312c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/126c312c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/126c312c

Branch: refs/heads/camel-gora
Commit: 126c312c207a72f3712859208f16fdd46883543d
Parents: 31b419c
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Dec 3 11:16:40 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Dec 3 11:16:40 2013 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/component/quartz/QuartzComponent.java    | 2 ++
 .../java/org/apache/camel/component/quartz2/QuartzComponent.java   | 2 ++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/126c312c/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
index 51fea39..acfafbb 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
@@ -451,6 +451,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
 
             // enable jmx unless configured to not do so
             if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
+                LOG.info("Setting org.quartz.scheduler.jmx.export=true to ensure QuartzScheduler(s) will be enlisted in JMX.");
                 prop.put("org.quartz.scheduler.jmx.export", "true");
             }
 
@@ -489,6 +490,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             // enable jmx unless configured to not do so
             if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
                 prop.put("org.quartz.scheduler.jmx.export", "true");
+                LOG.info("Setting org.quartz.scheduler.jmx.export=true to ensure QuartzScheduler(s) will be enlisted in JMX.");
             }
 
             answer = new StdSchedulerFactory(prop);

http://git-wip-us.apache.org/repos/asf/camel/blob/126c312c/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
index 3305310..5d5c308 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
@@ -132,6 +132,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             // enable jmx unless configured to not do so
             if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
                 prop.put("org.quartz.scheduler.jmx.export", "true");
+                LOG.info("Setting org.quartz.scheduler.jmx.export=true to ensure QuartzScheduler(s) will be enlisted in JMX.");
             }
 
             answer = new StdSchedulerFactory(prop);
@@ -170,6 +171,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             // enable jmx unless configured to not do so
             if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
                 prop.put("org.quartz.scheduler.jmx.export", "true");
+                LOG.info("Setting org.quartz.scheduler.jmx.export=true to ensure QuartzScheduler(s) will be enlisted in JMX.");
             }
 
             answer = new StdSchedulerFactory(prop);


[19/50] [abbrv] git commit: Upgraded to SSHD 0.9.0.

Posted by ni...@apache.org.
Upgraded to SSHD 0.9.0.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2d2db653
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2d2db653
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2d2db653

Branch: refs/heads/camel-gora
Commit: 2d2db653d455ef001001f094bd28d56b9aeb5765
Parents: 7bf03d0
Author: Babak Vahdat <bv...@apache.org>
Authored: Mon Dec 2 20:59:53 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Mon Dec 2 20:59:53 2013 +0100

----------------------------------------------------------------------
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2d2db653/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 930739b..a5645ac 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -390,7 +390,7 @@
     <spring-ws-version>2.1.4.RELEASE</spring-ws-version>
     <spymemcached-bundle-version>2.5_2</spymemcached-bundle-version> <!-- FIXME cmueller: not in sync! -->
     <spymemcached-version>2.8.4</spymemcached-version>
-    <sshd-version>0.8.0</sshd-version>
+    <sshd-version>0.9.0</sshd-version>
     <stompjms-version>1.18</stompjms-version>
     <stax-api-version>1.0.1</stax-api-version>
     <stax2-api-bundle-version>3.1.1</stax2-api-bundle-version>


[08/50] [abbrv] git commit: Removed the asm2-bundle-version Maven property & it's usage. Also synced the currently used asm version with it's SMX counterpart.

Posted by ni...@apache.org.
Removed the asm2-bundle-version Maven property & it's usage. Also synced the currently used asm version with it's SMX counterpart.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bd560027
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bd560027
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bd560027

Branch: refs/heads/camel-gora
Commit: bd5600276d0a9f0046223bc424c78d090e628f27
Parents: 5520035
Author: Babak Vahdat <bv...@apache.org>
Authored: Sat Nov 30 18:09:51 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Sat Nov 30 18:09:51 2013 +0100

----------------------------------------------------------------------
 parent/pom.xml                                           | 5 ++---
 platforms/karaf/features/src/main/resources/features.xml | 1 -
 2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/bd560027/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 6388e74..e17806f 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -51,9 +51,8 @@
     <aries-util-version>1.1.0</aries-util-version>
     <arquillian-junit-container-version>1.0.0.CR7</arquillian-junit-container-version>
     <arquillian-weld-ee-embedded-version>1.0.0.CR3</arquillian-weld-ee-embedded-version>
-    <asm-bundle-version>3.3_2</asm-bundle-version>
-    <asm-version>3.1</asm-version>
-    <asm2-bundle-version>2.2.3_5</asm2-bundle-version>
+    <asm-bundle-version>3.3.1_1</asm-bundle-version>
+    <asm-version>3.3.1</asm-version>
     <aspectj-version>1.6.2</aspectj-version>
     <atomikos-transactions-version>3.8.0</atomikos-transactions-version>
     <avalon-bundle-version>4.3.1_1</avalon-bundle-version>

http://git-wip-us.apache.org/repos/asf/camel/blob/bd560027/platforms/karaf/features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml
index e8c6c43..ec254c1 100644
--- a/platforms/karaf/features/src/main/resources/features.xml
+++ b/platforms/karaf/features/src/main/resources/features.xml
@@ -905,7 +905,6 @@
   <feature name='camel-script' version='${project.version}' resolver='(obr)' start-level='50'>
     <feature version='${project.version}'>camel-core</feature>
     <bundle dependency='true'>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/${servicemix-specs-version}</bundle>
-    <bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.asm/${asm2-bundle-version}</bundle>
     <bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/${antlr-bundle-version}</bundle>
     <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.rhino/${rhino-bundle-version}</bundle>
     <bundle>mvn:org.codehaus.groovy/groovy-all/${groovy-version}</bundle>


[29/50] [abbrv] git commit: [CAMEL-7035] Check both symbolic name and bundle version when registering CamelContext in the OSGi service registry.

Posted by ni...@apache.org.
[CAMEL-7035] Check both symbolic name and bundle version when registering CamelContext in the OSGi service registry.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/963b1c3c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/963b1c3c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/963b1c3c

Branch: refs/heads/camel-gora
Commit: 963b1c3c964cfe521ff28455dca2e931d6396ac4
Parents: a2e6342
Author: Ioannis Canellos <io...@apache.org>
Authored: Tue Dec 3 18:43:38 2013 +0200
Committer: Ioannis Canellos <io...@apache.org>
Committed: Tue Dec 3 18:43:38 2013 +0200

----------------------------------------------------------------------
 .../apache/camel/core/osgi/OsgiCamelContextPublisher.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/963b1c3c/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
----------------------------------------------------------------------
diff --git a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
index 909c43f..dd45c19 100644
--- a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
+++ b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
@@ -93,11 +93,15 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
 
     public ServiceRegistration registerCamelContext(CamelContext camelContext) throws InvalidSyntaxException {
         // avoid registering the same service again
-        ServiceReference[] refs = bundleContext.getServiceReferences(CamelContext.class.getName(), "(camel.context.symbolicname=" + bundleContext.getBundle().getSymbolicName() + ")");
+        String symbolicName = bundleContext.getBundle().getSymbolicName();
+        Version bundleVersion = getBundleVersion(bundleContext.getBundle());
+        ServiceReference[] refs = bundleContext.getServiceReferences(CamelContext.class.getName(),
+                "(&(" + CONTEXT_SYMBOLIC_NAME_PROPERTY + "=" + symbolicName + ")(" + CONTEXT_VERSION_PROPERTY + "=" + bundleVersion + "))");
+
         if (refs == null) {
             Dictionary<String, Object > props = new Hashtable<String, Object>();
-            props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, bundleContext.getBundle().getSymbolicName());
-            props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(bundleContext.getBundle()));
+            props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, symbolicName);
+            props.put(CONTEXT_VERSION_PROPERTY, bundleVersion);
             props.put(CONTEXT_NAME_PROPERTY, camelContext.getName());
 
             if (log.isDebugEnabled()) {


[21/50] [abbrv] git commit: CAMEL-7031 Let RabbitMQ producer use the default exchange

Posted by ni...@apache.org.
CAMEL-7031 Let RabbitMQ producer use the default exchange


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4f7ffe9a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4f7ffe9a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4f7ffe9a

Branch: refs/heads/camel-gora
Commit: 4f7ffe9ad780a4eac86eb6cb7c10922814a2d885
Parents: f7beff7
Author: Willem Jiang <wi...@gmail.com>
Authored: Tue Dec 3 10:42:17 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Tue Dec 3 10:42:31 2013 +0800

----------------------------------------------------------------------
 .../camel/component/rabbitmq/RabbitMQProducer.java       | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4f7ffe9a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java
index 3331a7d..9e22886 100644
--- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java
+++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java
@@ -84,15 +84,14 @@ public class RabbitMQProducer extends DefaultProducer {
         if (exchangeName == null || getEndpoint().isBridgeEndpoint()) {
             exchangeName = getEndpoint().getExchangeName();
         }
-        if (ObjectHelper.isEmpty(exchangeName)) {
-            throw new IllegalArgumentException("ExchangeName is not provided in the endpoint: " + getEndpoint());
-        }
-
-        String key = exchange.getIn().getHeader(RabbitMQConstants.ROUTING_KEY, "", String.class);
+        String key = exchange.getIn().getHeader(RabbitMQConstants.ROUTING_KEY, null, String.class);
         // we just need to make sure RoutingKey option take effect
-        if (key.trim().length() == 0) {
+        if (key == null) {
             key = getEndpoint().getRoutingKey() == null ? "" : getEndpoint().getRoutingKey();
         }
+        if (ObjectHelper.isEmpty(key) && ObjectHelper.isEmpty(exchangeName)) {
+            throw new IllegalArgumentException("ExchangeName and RoutingKey is not provided in the endpoint: " + getEndpoint());
+        }
         byte[] messageBodyBytes = exchange.getIn().getMandatoryBody(byte[].class);
         AMQP.BasicProperties.Builder properties = buildProperties(exchange);
 


[09/50] [abbrv] git commit: Upgraded the scalatest & scala-maven-plugin versions being used by camel-scala.

Posted by ni...@apache.org.
Upgraded the scalatest & scala-maven-plugin versions being used by camel-scala.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/08a6f456
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/08a6f456
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/08a6f456

Branch: refs/heads/camel-gora
Commit: 08a6f456b97b24cc49d4b95c0da576795c3402ec
Parents: bd56002
Author: Babak Vahdat <bv...@apache.org>
Authored: Sat Nov 30 18:30:54 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Sat Nov 30 18:30:54 2013 +0100

----------------------------------------------------------------------
 parent/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/08a6f456/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index e17806f..92edad8 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -350,8 +350,8 @@
     <saxon-bundle-version>9.5.1-1_1</saxon-bundle-version>
     <saxon-version>9.5.1-2</saxon-version>
     <scala-version>2.10.3</scala-version>
-    <scala-maven-plugin-version>3.1.2</scala-maven-plugin-version>
-    <scalatest-version>2.0.M5b</scalatest-version>
+    <scala-maven-plugin-version>3.1.6</scala-maven-plugin-version>
+    <scalatest-version>2.0</scalatest-version>
     <scribe-version>1.3.5</scribe-version>
     <scriptengines-version>1.1</scriptengines-version>
     <serp-bundle-version>1.14.1_1</serp-bundle-version>


[07/50] [abbrv] git commit: CAMEL-7023: Added hawtio goal to camel maven plugin.

Posted by ni...@apache.org.
CAMEL-7023: Added hawtio goal to camel maven plugin.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5520035b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5520035b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5520035b

Branch: refs/heads/camel-gora
Commit: 5520035be29cb842d27e0bf2b77ed0c1a4cc17eb
Parents: 799f95c
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Nov 29 16:46:05 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Nov 29 16:46:05 2013 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/maven/HawtioMojo.java |  2 +-
 .../src/main/java/org/apache/camel/maven/RunMojo.java    | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5520035b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java
index 1c8f697..b7b6159 100644
--- a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java
+++ b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java
@@ -43,7 +43,7 @@ public class HawtioMojo extends RunMojo {
     }
 
     @Override
-    void beforeBootstrapCamel() throws Exception {
+    protected void beforeBootstrapCamel() throws Exception {
         getLog().info("Starting hawtio ...");
         Method hawtioMain = Thread.currentThread().getContextClassLoader().loadClass("io.hawt.app.App")
                 .getMethod("main", new Class[] {String[].class});

http://git-wip-us.apache.org/repos/asf/camel/blob/5520035b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
index bb2fdcb..edf46fc 100644
--- a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
+++ b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
@@ -488,6 +488,8 @@ public class RunMojo extends AbstractExecMojo {
                         main.setAccessible(true);
                     }
                     main.invoke(main, new Object[] {arguments});
+
+                    afterBootstrapCamel();
                 } catch (Exception e) { // just pass it on
                     // let it be printed so end users can see the exception on the console
                     getLog().error("*************************************");
@@ -540,7 +542,14 @@ public class RunMojo extends AbstractExecMojo {
     /**
      * Allows plugin extensions to do custom logic before bootstrapping Camel.
      */
-    void beforeBootstrapCamel() throws Exception {
+    protected void beforeBootstrapCamel() throws Exception {
+        // noop
+    }
+
+    /**
+     * Allows plugin extensions to do custom logic after bootstrapping Camel.
+     */
+    protected void afterBootstrapCamel() throws Exception {
         // noop
     }
 


[40/50] [abbrv] git commit: CAMEL-7045: Fixed backlog tracer dump traced message to match node or route id.

Posted by ni...@apache.org.
CAMEL-7045: Fixed backlog tracer dump traced message to match node or route id.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/278761b2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/278761b2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/278761b2

Branch: refs/heads/camel-gora
Commit: 278761b29be3ea98cc1a4d85c5c7cf11cdea29ba
Parents: d43c34b
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Dec 6 11:00:07 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Dec 6 11:02:01 2013 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/processor/interceptor/BacklogTracer.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/278761b2/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogTracer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogTracer.java b/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogTracer.java
index 3c85755..cd825e5 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogTracer.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogTracer.java
@@ -268,7 +268,7 @@ public class BacklogTracer extends ServiceSupport implements InterceptStrategy {
         List<BacklogTracerEventMessage> answer = new ArrayList<BacklogTracerEventMessage>();
         if (nodeId != null) {
             for (DefaultBacklogTracerEventMessage message : queue) {
-                if (nodeId.equals(message.getToNode())) {
+                if (nodeId.equals(message.getToNode()) || nodeId.equals(message.getRouteId())) {
                     answer.add(message);
                 }
             }


[49/50] [abbrv] git commit: CAMEL-4817 fixed some log issue of camel-gora

Posted by ni...@apache.org.
CAMEL-4817 fixed some log issue of camel-gora


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4e7783b1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4e7783b1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4e7783b1

Branch: refs/heads/camel-gora
Commit: 4e7783b10bcd2c8f11a6abd713cbe881b6179761
Parents: 84b8099
Author: Willem Jiang <wi...@gmail.com>
Authored: Tue Nov 19 15:09:15 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Dec 9 10:07:08 2013 +0800

----------------------------------------------------------------------
 components/camel-gora/pom.xml | 50 ++++++++++++--------------------------
 1 file changed, 16 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4e7783b1/components/camel-gora/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-gora/pom.xml b/components/camel-gora/pom.xml
index 0f9aef1..e05920e 100644
--- a/components/camel-gora/pom.xml
+++ b/components/camel-gora/pom.xml
@@ -35,14 +35,6 @@
     </description>
 
     <properties>
-        <!--
-          General
-        -->
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-
-        <!--
-            OSGi
-        -->
         <camel.osgi.export.pkg>
             org.apache.camel.component.gora.*
         </camel.osgi.export.pkg>
@@ -73,32 +65,29 @@
         <commons-beanutils.version>1.8.3</commons-beanutils.version>
 
     </properties>
-
+    
     <build>
-        <defaultGoal>install</defaultGoal>
-        <resources>
-            <resource>
-                <directory>src/main/resources</directory>
-                <filtering>true</filtering>
-            </resource>
-        </resources>
-        <testResources>
-            <testResource>
-                <directory>src/test/resources</directory>
-                <filtering>true</filtering>
-            </testResource>
-        </testResources>
+        <plugins>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <systemPropertyVariables>
+                       <org.slf4j.simpleLogger.defaultLogLevel>
+                         warn
+                       </org.slf4j.simpleLogger.defaultLogLevel>
+                    </systemPropertyVariables>
+                </configuration>
+            </plugin>
+        </plugins>
     </build>
-
+    
     <dependencies>
         <!-- logging  -->
         <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>
-        <dependency>
+            <!-- Using slf4j-log4j-12 will get some warning -->
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-simple</artifactId>
+            <scope>test</scope>
         </dependency>
 
         <!-- testing -->
@@ -198,11 +187,4 @@
         </dependency>
     </dependencies>
 
-    <licenses>
-        <license>
-            <name>Apache 2.0 License</name>
-            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
-        </license>
-    </licenses>
-
 </project>


[02/50] [abbrv] git commit: Enabled two Karaf component tests.

Posted by ni...@apache.org.
Enabled two Karaf component tests.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/08dd7f5f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/08dd7f5f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/08dd7f5f

Branch: refs/heads/camel-gora
Commit: 08dd7f5f763ca0f38b673fa8e9d7f106b48e540f
Parents: 16b988e
Author: Babak Vahdat <bv...@apache.org>
Authored: Thu Nov 28 19:24:47 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Thu Nov 28 19:24:47 2013 +0100

----------------------------------------------------------------------
 .../src/test/java/org/apache/camel/itest/karaf/CamelDnsTest.java   | 2 --
 .../test/java/org/apache/camel/itest/karaf/CamelJasyptTest.java    | 2 --
 2 files changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/08dd7f5f/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelDnsTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelDnsTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelDnsTest.java
index e78da3c..baddf02 100644
--- a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelDnsTest.java
+++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelDnsTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.itest.karaf;
 
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Option;
@@ -24,7 +23,6 @@ import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 
 @RunWith(JUnit4TestRunner.class)
-@Ignore("People need to edit etc/jre.properties in Karaf/SMX to export: sun.net.spi.nameservice")
 public class CamelDnsTest extends AbstractFeatureTest {
 
     public static final String COMPONENT = extractName(CamelDnsTest.class);

http://git-wip-us.apache.org/repos/asf/camel/blob/08dd7f5f/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJasyptTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJasyptTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJasyptTest.java
index f04880a..7f71df8 100644
--- a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJasyptTest.java
+++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelJasyptTest.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.itest.karaf;
 
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Option;
@@ -24,7 +23,6 @@ import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 
 @RunWith(JUnit4TestRunner.class)
-@Ignore("Does not work on JDK 1.5")
 public class CamelJasyptTest extends AbstractFeatureTest {
 
     public static final String COMPONENT = extractName(CamelJasyptTest.class);


[12/50] [abbrv] git commit: CAMEL-7023: Polished code with thanks to Babak for suggestions.

Posted by ni...@apache.org.
CAMEL-7023: Polished code with thanks to Babak for suggestions.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b048537a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b048537a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b048537a

Branch: refs/heads/camel-gora
Commit: b048537a518c5ff8f5373813bb76b7813e5784a5
Parents: 42b463c
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Dec 2 09:01:57 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Dec 2 09:01:57 2013 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/maven/HawtioMojo.java  | 10 +++-------
 .../src/main/java/org/apache/camel/maven/RunMojo.java     | 10 +++-------
 2 files changed, 6 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b048537a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java
index b7b6159..57e509e 100644
--- a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java
+++ b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java
@@ -45,14 +45,10 @@ public class HawtioMojo extends RunMojo {
     @Override
     protected void beforeBootstrapCamel() throws Exception {
         getLog().info("Starting hawtio ...");
-        Method hawtioMain = Thread.currentThread().getContextClassLoader().loadClass("io.hawt.app.App")
-                .getMethod("main", new Class[] {String[].class});
-        if (!hawtioMain.isAccessible()) {
-            getLog().debug("Setting accessibility to true in order to invoke main().");
-            hawtioMain.setAccessible(true);
-        }
+        Method hawtioMain = Thread.currentThread().getContextClassLoader()
+                .loadClass("io.hawt.app.App").getMethod("main", String[].class);
         String[] args = new String[]{"--port", "" + port, "--join", "false"};
-        hawtioMain.invoke(hawtioMain, new Object[]{args});
+        hawtioMain.invoke(null, new Object[]{args});
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/b048537a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
index edf46fc..0474059 100644
--- a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
+++ b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/RunMojo.java
@@ -481,13 +481,9 @@ public class RunMojo extends AbstractExecMojo {
                     beforeBootstrapCamel();
 
                     getLog().info("Starting Camel ...");
-                    Method main = Thread.currentThread().getContextClassLoader().loadClass(mainClass)
-                        .getMethod("main", new Class[] {String[].class});
-                    if (!main.isAccessible()) {
-                        getLog().debug("Setting accessibility to true in order to invoke main().");
-                        main.setAccessible(true);
-                    }
-                    main.invoke(main, new Object[] {arguments});
+                    Method main = Thread.currentThread().getContextClassLoader()
+                            .loadClass(mainClass).getMethod("main", String[].class);
+                    main.invoke(null, new Object[]{arguments});
 
                     afterBootstrapCamel();
                 } catch (Exception e) { // just pass it on


[22/50] [abbrv] git commit: CAMEL-7032 Align the netty version across the camel components

Posted by ni...@apache.org.
CAMEL-7032 Align the netty version across the camel components


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ea882531
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ea882531
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ea882531

Branch: refs/heads/camel-gora
Commit: ea882531c5e07197321e42b9245adbd48002255a
Parents: 4f7ffe9
Author: Willem Jiang <wi...@gmail.com>
Authored: Tue Dec 3 15:18:12 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Tue Dec 3 15:18:12 2013 +0800

----------------------------------------------------------------------
 components/camel-zookeeper/pom.xml | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ea882531/components/camel-zookeeper/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-zookeeper/pom.xml b/components/camel-zookeeper/pom.xml
index 6f09d48..fea0cf5 100644
--- a/components/camel-zookeeper/pom.xml
+++ b/components/camel-zookeeper/pom.xml
@@ -44,6 +44,18 @@
     <dependency>
       <groupId>org.apache.zookeeper</groupId>
       <artifactId>zookeeper</artifactId>
+      <!-- Just exclude the old version of netty to avoid netty version conflict-->
+      <exclusions>
+        <exclusion>
+           <groupId>org.jboss.netty</groupId>
+           <artifactId>netty</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty</artifactId>
+      <version>${netty3-version}</version>
     </dependency>
 
     <!-- test dependencies -->


[38/50] [abbrv] git commit: CAMEL-7038: Polished the Javadoc.

Posted by ni...@apache.org.
CAMEL-7038: Polished the Javadoc.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/298889a9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/298889a9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/298889a9

Branch: refs/heads/camel-gora
Commit: 298889a9d5da35d25b6dd63ca2d2e05ba371a874
Parents: 4e4cb68
Author: Babak Vahdat <bv...@apache.org>
Authored: Wed Dec 4 17:52:06 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Wed Dec 4 17:52:06 2013 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/guice/maven/EmbeddedMojo.java     | 9 ++++-----
 .../src/main/java/org/apache/camel/guice/maven/RunMojo.java | 9 ++++-----
 2 files changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/298889a9/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
index e3c7b3c..68a7c5a 100644
--- a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
+++ b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
@@ -75,11 +75,10 @@ public class EmbeddedMojo extends AbstractExecMojo {
     protected boolean dotAggregationEnabled;
 
     /**
-     * Allows to provide a custom properties file to initialize a
-     * {@link javax.naming.InitialContext} object with. As an example this
-     * argument can be be passed when making use of the GuiceyFruit JNDI
-     * Provider where the properties file name is something else other than the
-     * default {@code jndi.properties}
+     * Allows to provide a custom properties file on the classpath to initialize
+     * a {@link javax.naming.InitialContext} object with. This corresponds to
+     * the {@link org.apache.camel.guice.Main#setJndiProperties(String)} API
+     * method
      * 
      * @parameter property="jndiProperties"
      */

http://git-wip-us.apache.org/repos/asf/camel/blob/298889a9/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
index c953003..4d1979f 100644
--- a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
+++ b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
@@ -108,11 +108,10 @@ public class RunMojo extends AbstractExecMojo {
     protected boolean dotEnabled;
 
     /**
-     * Allows to provide a custom properties file to initialize a
-     * {@link javax.naming.InitialContext} object with. As an example this
-     * argument can be be passed when making use of the GuiceyFruit JNDI
-     * Provider where the properties file name is something else other than the
-     * default {@code jndi.properties}
+     * Allows to provide a custom properties file on the classpath to initialize
+     * a {@link javax.naming.InitialContext} object with. This corresponds to
+     * the {@link org.apache.camel.guice.Main#setJndiProperties(String)} API
+     * method
      * 
      * @parameter property="jndiProperties"
      */


[03/50] [abbrv] git commit: Upgrade to Groovy 2.2.1

Posted by ni...@apache.org.
Upgrade to Groovy 2.2.1


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2d885a57
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2d885a57
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2d885a57

Branch: refs/heads/camel-gora
Commit: 2d885a57893fb217d97bf09d3c50b709009081be
Parents: 08dd7f5
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Nov 28 22:05:25 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Nov 28 22:05:25 2013 +0100

----------------------------------------------------------------------
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2d885a57/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index ed0c32f..a98630f 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -163,7 +163,7 @@
     <google-gdata-bundle-version>1.41.1_1</google-gdata-bundle-version>
     <!-- camel-cdi doesn't work with Guava 15.0.0 at present -->
     <google-guava-version>14.0.1</google-guava-version>
-    <groovy-version>2.1.9</groovy-version>
+    <groovy-version>2.2.1</groovy-version>
     <gson-version>2.2.4</gson-version>
     <guice-bundle-version>3.0_1</guice-bundle-version>
     <guice-version>3.0</guice-version>


[46/50] [abbrv] CAMEL-4817 Added camel-gora component with thanks to Ioannis

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraProducerTest.java b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraProducerTest.java
new file mode 100644
index 0000000..1bf4df8
--- /dev/null
+++ b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraProducerTest.java
@@ -0,0 +1,314 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Message;
+import org.apache.camel.component.gora.utils.GoraUtils;
+import org.apache.gora.persistency.Persistent;
+import org.apache.gora.persistency.StateManager;
+import org.apache.gora.query.Query;
+import org.apache.gora.query.impl.QueryBase;
+import org.apache.gora.store.DataStore;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.internal.verification.VerificationModeFactory;
+import org.mockito.stubbing.OngoingStubbing;
+import org.mockito.verification.VerificationMode;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import java.util.*;
+
+
+import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.atMost;
+import static org.mockito.Mockito.verify;
+import static org.mockito.internal.verification.VerificationModeFactory.times;
+import static org.powermock.api.mockito.PowerMockito.mockStatic;
+import static org.powermock.api.mockito.PowerMockito.mock;
+import static org.powermock.api.mockito.PowerMockito.when;
+import static org.powermock.api.mockito.PowerMockito.verifyStatic;
+
+/**
+ * GORA Producer Tests
+ *
+ * TODO: <b>NOTE:</b> Query methods does not yet has tests
+ *
+ * @author ipolyzos
+ */
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(GoraUtils.class)
+public class GoraProducerTest extends GoraTestSupport {
+
+    /**
+     * Mock CamelExchange
+     */
+    private Exchange mockCamelExchange;
+
+    /**
+     * Mock Gora Endpoint
+     */
+    private GoraEndpoint mockGoraEndpoint;
+
+    /**
+     * Mock Gora Configuration
+     */
+    private GoraConfiguration mockGoraConfiguration;
+
+    /**
+     * Mock Camel Message
+     */
+    private Message mockCamelMessage;
+
+    /**
+     * Mock Gora DataStore
+     */
+    private DataStore mockDatastore;
+
+    @Before
+    public void setUp()  {
+
+        //setup mocks
+        mockCamelExchange = mock(Exchange.class);
+        mockGoraEndpoint = mock(GoraEndpoint.class);
+        mockGoraConfiguration = mock(GoraConfiguration.class);
+        mockCamelMessage = mock(Message.class);
+        mockDatastore = mock(DataStore.class);
+
+        //setup default conditions
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelExchange.getPattern()).thenReturn(ExchangePattern.InOnly);
+    }
+
+    @Test(expected = RuntimeException.class)
+    public void processShouldThrowExceptionIfOperationIsNull() throws Exception {
+
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        producer.process(mockCamelExchange);
+    }
+
+    @Test(expected = RuntimeException.class)
+    public void shouldThrowExceptionIfOperationIsUnknown() throws Exception {
+
+
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_OPERATION.value)).thenReturn("dah");
+
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        producer.process(mockCamelExchange);
+
+        verify(mockCamelExchange, atMost(1)).getIn();
+        verify(mockCamelMessage, atMost(1)).getHeader(GoraAttribute.GORA_OPERATION.value);
+    }
+
+    @Test
+    public void shouldInvokeDastorePut() throws Exception {
+
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_OPERATION.value)).thenReturn("PUT");
+
+        final Long sampleKey = new Long(2);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_KEY.value)).thenReturn(sampleKey);
+
+        final Persistent sampleValue = mock(Persistent.class);
+        when(mockCamelMessage.getBody(Persistent.class)).thenReturn(sampleValue);
+
+        final Message outMessage = mock(Message.class);
+        when(mockCamelExchange.getOut()).thenReturn(outMessage);
+
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        producer.process(mockCamelExchange);
+
+        verify(mockCamelExchange, atLeastOnce()).getIn();
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_OPERATION.value);
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_KEY.value);
+        verify(mockCamelMessage, atLeastOnce()).getBody(Persistent.class);
+        verify(mockDatastore, atMost(1)).put(sampleKey,sampleValue);
+    }
+
+    @Test
+    public void shouldInvokeDastoreGet() throws Exception {
+
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_OPERATION.value)).thenReturn("get");
+
+        final Long sampleKey = new Long(2);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_KEY.value)).thenReturn(sampleKey);
+
+        final Message outMessage = mock(Message.class);
+        when(mockCamelExchange.getOut()).thenReturn(outMessage);
+
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        producer.process(mockCamelExchange);
+
+        verify(mockCamelExchange, atLeastOnce()).getIn();
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_OPERATION.value);
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_KEY.value);
+        verify(mockDatastore, atMost(1)).get(sampleKey);
+    }
+
+    @Test
+    public void shouldInvokeDatastoreDelete() throws Exception {
+
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_OPERATION.value)).thenReturn("dEletE");
+
+        final Long sampleKey = new Long(2);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_KEY.value)).thenReturn(sampleKey);
+
+        final Message outMessage = mock(Message.class);
+        when(mockCamelExchange.getOut()).thenReturn(outMessage);
+
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        producer.process(mockCamelExchange);
+
+        verify(mockCamelExchange, atLeastOnce()).getIn();
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_OPERATION.value);
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_KEY.value);
+        verify(mockDatastore, atMost(1)).delete(sampleKey);
+    }
+
+    @Test
+    public void shouldInvokeDastoreSchemaExists() throws Exception {
+
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_OPERATION.value)).thenReturn("schemaExists");
+
+        final Message outMessage = mock(Message.class);
+        when(mockCamelExchange.getOut()).thenReturn(outMessage);
+
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        producer.process(mockCamelExchange);
+
+        verify(mockCamelExchange, atLeastOnce()).getIn();
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_OPERATION.value);
+        verify(mockDatastore, atMost(1)).schemaExists();
+    }
+
+    @Test
+    public void shouldInvokeDastoreCreateSchema() throws Exception {
+
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_OPERATION.value)).thenReturn("createSchema");
+
+        final Message outMessage = mock(Message.class);
+        when(mockCamelExchange.getOut()).thenReturn(outMessage);
+
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        producer.process(mockCamelExchange);
+
+        verify(mockCamelExchange, atLeastOnce()).getIn();
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_OPERATION.value);
+        verify(mockDatastore, atMost(1)).createSchema();
+    }
+
+    @Test
+    public void shouldInvokeDastoreGetSchemaName() throws Exception {
+
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_OPERATION.value)).thenReturn("GetSchemANamE");
+
+
+        final Message outMessage = mock(Message.class);
+        when(mockCamelExchange.getOut()).thenReturn(outMessage);
+
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        producer.process(mockCamelExchange);
+
+        verify(mockCamelExchange, atLeastOnce()).getIn();
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_OPERATION.value);
+        verify(mockDatastore, atMost(1)).getSchemaName();
+    }
+
+    @Test
+    public void shouldInvokeDatastoreDeleteSchema() throws Exception {
+
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_OPERATION.value)).thenReturn("DeleteSChEmA");
+
+
+        final Message outMessage = mock(Message.class);
+        when(mockCamelExchange.getOut()).thenReturn(outMessage);
+
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        producer.process(mockCamelExchange);
+
+        verify(mockCamelExchange, atLeastOnce()).getIn();
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_OPERATION.value);
+        verify(mockDatastore, atMost(1)).deleteSchema();
+    }
+
+    @Test
+    public void shouldInvokeDatastoreQuery() throws Exception {
+
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_OPERATION.value)).thenReturn("query");
+
+        final Map<String, Object> mockProperties = mock(Map.class);
+        when(mockCamelMessage.getHeaders()).thenReturn(mockProperties);
+
+        final Message outMessage = mock(Message.class);
+        when(mockCamelExchange.getOut()).thenReturn(outMessage);
+
+        mockStatic(GoraUtils.class);
+
+        final Query mockQuery = mock(QueryBase.class);
+        when(GoraUtils.constractQueryFromPropertiesMap(mockProperties, mockDatastore, mockGoraConfiguration)).thenReturn(mockQuery);
+
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        producer.process(mockCamelExchange);
+
+        verify(mockCamelExchange, atLeastOnce()).getIn();
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_OPERATION.value);
+        verify(mockQuery, atLeastOnce()).execute();
+        verifyStatic(times(1));
+    }
+
+    @Test
+    public void shouldInvokeDatastoreDeleteByQuery() throws Exception {
+
+        when(mockCamelExchange.getIn()).thenReturn(mockCamelMessage);
+        when(mockCamelMessage.getHeader(GoraAttribute.GORA_OPERATION.value)).thenReturn("deleteByQuery");
+
+        final Map<String, Object> mockProperties = mock(Map.class);
+        when(mockCamelMessage.getHeaders()).thenReturn(mockProperties);
+
+        final Message outMessage = mock(Message.class);
+        when(mockCamelExchange.getOut()).thenReturn(outMessage);
+
+        mockStatic(GoraUtils.class);
+
+        final Query mockQuery = mock(QueryBase.class);
+        when(GoraUtils.constractQueryFromPropertiesMap(mockProperties, mockDatastore, mockGoraConfiguration)).thenReturn(mockQuery);
+
+        final GoraProducer producer = new GoraProducer(mockGoraEndpoint,mockGoraConfiguration,mockDatastore);
+        producer.process(mockCamelExchange);
+
+        verify(mockCamelExchange, atLeastOnce()).getIn();
+        verify(mockCamelMessage, atLeastOnce()).getHeader(GoraAttribute.GORA_OPERATION.value);
+        verify(mockDatastore, atMost(1)).deleteByQuery(mockQuery);
+        verifyStatic(times(1));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraTestSupport.java b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraTestSupport.java
new file mode 100644
index 0000000..939763d
--- /dev/null
+++ b/components/camel-gora/src/test/java/org/apache/camel/component/gora/GoraTestSupport.java
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora;
+
+import org.apache.camel.test.junit4.CamelTestSupport;
+
+/**
+ * GORA Test Support
+ *
+ * @author ipolyzos
+ */
+public class GoraTestSupport extends CamelTestSupport {
+    //TODO
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8ad60f0f/components/camel-gora/src/test/java/org/apache/camel/component/gora/utils/GoraUtilsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/test/java/org/apache/camel/component/gora/utils/GoraUtilsTest.java b/components/camel-gora/src/test/java/org/apache/camel/component/gora/utils/GoraUtilsTest.java
new file mode 100644
index 0000000..c2c4ecef
--- /dev/null
+++ b/components/camel-gora/src/test/java/org/apache/camel/component/gora/utils/GoraUtilsTest.java
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.gora.utils;
+
+import org.apache.camel.component.gora.GoraAttribute;
+import org.apache.camel.component.gora.GoraConfiguration;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * GORA Utils Tests
+ *
+ * @author ipolyzos
+ */
+public class GoraUtilsTest {
+
+    @Test
+    public void configurationExistShouldSucceedtIfMethodExist() throws Exception {
+
+       final GoraConfiguration conf = new GoraConfiguration();
+       assertTrue(GoraUtils.configurationExist(GoraAttribute.GORA_QUERY_LIMIT,conf));
+    }
+
+    @Test(expected = NoSuchMethodException.class)
+    public void configurationExistShouldThrowExceptionIfMethodDoesNotExist() throws Exception {
+
+        final GoraConfiguration conf = new GoraConfiguration();
+        GoraUtils.configurationExist(GoraAttribute.GORA_KEY,conf);
+    }
+
+    @Test
+    public void getAttributeAsLongShouldSReturnTheCorrectValue() throws Exception {
+
+        final GoraConfiguration conf = new GoraConfiguration();
+        conf.setLimit(3L);
+        assertEquals(new Long(3), GoraUtils.getAttributeAsLong(GoraAttribute.GORA_QUERY_LIMIT, conf));
+    }
+}


[41/50] [abbrv] git commit: CAMEL-7044 Ignoring the rabbitmq.ROUTING_KEY when bridgeEndpoint option is true

Posted by ni...@apache.org.
CAMEL-7044 Ignoring the rabbitmq.ROUTING_KEY when bridgeEndpoint option is true


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/32272522
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/32272522
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/32272522

Branch: refs/heads/camel-gora
Commit: 3227252208d35e89bad74ff5095421ce2de85ffa
Parents: 278761b
Author: Willem Jiang <wi...@gmail.com>
Authored: Fri Dec 6 10:11:44 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sat Dec 7 22:12:29 2013 +0800

----------------------------------------------------------------------
 .../org/apache/camel/component/rabbitmq/RabbitMQProducer.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/32272522/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java
index 9e22886..7763423 100644
--- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java
+++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQProducer.java
@@ -85,8 +85,8 @@ public class RabbitMQProducer extends DefaultProducer {
             exchangeName = getEndpoint().getExchangeName();
         }
         String key = exchange.getIn().getHeader(RabbitMQConstants.ROUTING_KEY, null, String.class);
-        // we just need to make sure RoutingKey option take effect
-        if (key == null) {
+        // we just need to make sure RoutingKey option take effect if it is not BridgeEndpoint
+        if (key == null || getEndpoint().isBridgeEndpoint()) {
             key = getEndpoint().getRoutingKey() == null ? "" : getEndpoint().getRoutingKey();
         }
         if (ObjectHelper.isEmpty(key) && ObjectHelper.isEmpty(exchangeName)) {


[20/50] [abbrv] git commit: CAMEL-7029: Fixed quartz2 simple trigger default value for repeat counter to work as expected.

Posted by ni...@apache.org.
CAMEL-7029: Fixed quartz2 simple trigger default value for repeat counter to work as expected.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f7beff79
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f7beff79
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f7beff79

Branch: refs/heads/camel-gora
Commit: f7beff794377bd7500fc44a0d559b0e2209f8eb9
Parents: 2d2db65
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Dec 2 21:43:05 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Dec 2 21:44:20 2013 +0100

----------------------------------------------------------------------
 .../camel/component/quartz2/QuartzEndpoint.java | 25 ++++++----
 .../quartz2/QuartzRepeatIntervalTest.java       | 49 ++++++++++++++++++++
 .../quartz2/QuartzRouteFireNowTest.java         |  4 +-
 3 files changed, 69 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f7beff79/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzEndpoint.java b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzEndpoint.java
index 891ee83..de94beb 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzEndpoint.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzEndpoint.java
@@ -256,7 +256,7 @@ public class QuartzEndpoint extends DefaultEndpoint {
         JobDataMap jobDataMap = jobDetail.getJobDataMap();
         String camelContextName = getCamelContext().getManagementName();
         String endpointUri = getEndpointUri();
-        LOG.debug("Adding camelContextName={}, endpintUri={} into job data map.", camelContextName, endpointUri);
+        LOG.debug("Adding camelContextName={}, endpointUri={} into job data map.", camelContextName, endpointUri);
         jobDataMap.put(QuartzConstants.QUARTZ_CAMEL_CONTEXT_NAME, camelContextName);
         jobDataMap.put(QuartzConstants.QUARTZ_ENDPOINT_URI, endpointUri);
     }
@@ -276,18 +276,27 @@ public class QuartzEndpoint extends DefaultEndpoint {
                     .build();
         } else {
             LOG.debug("Creating SimpleTrigger.");
+            int repeat = SimpleTrigger.REPEAT_INDEFINITELY;
+            String repeatString = (String) triggerParameters.get("repeatCount");
+            if (repeatString != null) {
+                repeat = Integer.valueOf(repeatString);
+            }
+
+            // default use 1 sec interval
+            long interval = 1000;
+            String intervalString = (String) triggerParameters.get("repeatInterval");
+            if (intervalString != null) {
+                interval = Long.valueOf(intervalString);
+            }
+
             TriggerBuilder<SimpleTrigger> triggerBuilder = TriggerBuilder.newTrigger()
                     .withIdentity(triggerKey)
                     .startAt(startTime)
-                    .withSchedule(simpleSchedule().withMisfireHandlingInstructionFireNow());
+                    .withSchedule(simpleSchedule().withMisfireHandlingInstructionFireNow()
+                            .withRepeatCount(repeat).withIntervalInMilliseconds(interval));
 
-            // Enable trigger to fire now by setting startTime in the past.
             if (fireNow) {
-                String intervalString = (String) triggerParameters.get("repeatInterval");
-                if (intervalString != null) {
-                    long interval = Long.valueOf(intervalString);
-                    triggerBuilder.startAt(new Date(System.currentTimeMillis() - interval));
-                }
+                triggerBuilder.startNow();
             }
 
             result = triggerBuilder.build();

http://git-wip-us.apache.org/repos/asf/camel/blob/f7beff79/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java
new file mode 100644
index 0000000..c1c6d78
--- /dev/null
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRepeatIntervalTest.java
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.quartz2;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+/**
+ * @version 
+ */
+public class QuartzRepeatIntervalTest extends CamelTestSupport {
+    protected MockEndpoint resultEndpoint;
+
+    @Test
+    public void testRepeatInterval() throws Exception {
+        resultEndpoint = getMockEndpoint("mock:result");
+        resultEndpoint.expectedMinimumMessageCount(5);
+
+        // lets test the receive worked
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("quartz2://myGroup/myTimerName?trigger.repeatInterval=50").routeId("myRoute")
+                        .to("log:result")
+                        .to("mock:result");
+            }
+        };
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/f7beff79/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
index f6d1c63..b7e4273 100644
--- a/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
+++ b/components/camel-quartz2/src/test/java/org/apache/camel/component/quartz2/QuartzRouteFireNowTest.java
@@ -28,7 +28,9 @@ public class QuartzRouteFireNowTest extends QuartzRouteTest {
         return new RouteBuilder() {
             public void configure() {
                 // START SNIPPET: example
-                from("quartz2://myGroup/myTimerName?fireNow=true&trigger.repeatInterval=25000&trigger.repeatCount=2").to("mock:result");
+                from("quartz2://myGroup/myTimerName?fireNow=true&trigger.repeatInterval=2000&trigger.repeatCount=2")
+                        .to("log:quartz")
+                        .to("mock:result");
                 // END SNIPPET: example
             }
         };


[31/50] [abbrv] New component for Amazon Simple Workflow Service

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java
new file mode 100644
index 0000000..42b53fe
--- /dev/null
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java
@@ -0,0 +1,143 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient;
+import com.amazonaws.services.simpleworkflow.flow.DynamicWorkflowClientExternal;
+import com.amazonaws.services.simpleworkflow.flow.DynamicWorkflowClientExternalImpl;
+import com.amazonaws.services.simpleworkflow.model.DescribeWorkflowExecutionRequest;
+import com.amazonaws.services.simpleworkflow.model.WorkflowExecution;
+import com.amazonaws.services.simpleworkflow.model.WorkflowExecutionDetail;
+import com.amazonaws.services.simpleworkflow.model.WorkflowExecutionInfo;
+import org.junit.Before;
+import org.junit.Test;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class CamelSWFWorkflowClientTest {
+
+    private SWFConfiguration configuration;
+    private AmazonSimpleWorkflowClient swClient;
+    private SWFEndpoint endpoint;
+    private CamelSWFWorkflowClient camelSWFWorkflowClient;
+    private DynamicWorkflowClientExternal clientExternal;
+
+    @Before
+    public void setUp() throws Exception {
+        configuration = new SWFConfiguration();
+        configuration.setDomainName("testDomain");
+        swClient = mock(AmazonSimpleWorkflowClient.class);
+        configuration.setAmazonSWClient(swClient);
+        configuration.setStartWorkflowOptionsParameters(Collections.<String, Object>emptyMap());
+
+        endpoint = new SWFEndpoint();
+        endpoint.setConfiguration(configuration);
+        clientExternal = mock(DynamicWorkflowClientExternalImpl.class);
+
+        camelSWFWorkflowClient = new CamelSWFWorkflowClient(endpoint, configuration) {
+            @Override
+            DynamicWorkflowClientExternal getDynamicWorkflowClient(String workflowId, String runId) {
+                return clientExternal;
+            }
+        };
+    }
+
+    @Test
+    public void testDescribeWorkflowInstance() throws Exception {
+        WorkflowExecutionInfo executionInfo = new WorkflowExecutionInfo();
+        executionInfo.setCloseStatus("COMPLETED");
+        Date closeTimestamp = new Date();
+        executionInfo.setCloseTimestamp(closeTimestamp);
+        executionInfo.setExecutionStatus("CLOSED");
+        executionInfo.setTagList(Collections.EMPTY_LIST);
+
+        WorkflowExecutionDetail workflowExecutionDetail = new WorkflowExecutionDetail();
+        workflowExecutionDetail.setExecutionInfo(executionInfo);
+
+        when(swClient.describeWorkflowExecution(any(DescribeWorkflowExecutionRequest.class))).thenReturn(workflowExecutionDetail);
+        Map<String, Object> description = camelSWFWorkflowClient.describeWorkflowInstance("123", "run1");
+
+        DescribeWorkflowExecutionRequest describeRequest = new DescribeWorkflowExecutionRequest();
+        describeRequest.setDomain(configuration.getDomainName());
+        describeRequest.setExecution(new WorkflowExecution().withWorkflowId("123").withRunId("run1"));
+
+
+        verify(swClient).describeWorkflowExecution(describeRequest);
+        assertThat((String) description.get("closeStatus"), is("COMPLETED"));
+        assertThat((Date) description.get("closeTimestamp"), is(closeTimestamp));
+        assertThat((String) description.get("executionStatus"), is("CLOSED"));
+        assertThat((List) description.get("tagList"), is(Collections.EMPTY_LIST));
+        assertThat((WorkflowExecutionDetail) description.get("executionDetail"), is(workflowExecutionDetail));
+    }
+
+    @Test
+    public void testSignalWorkflowExecution() throws Exception {
+
+        camelSWFWorkflowClient.signalWorkflowExecution("123", "run1", "signalMethod", "Hi");
+        verify(clientExternal).signalWorkflowExecution("signalMethod", new Object[] {"Hi"});
+    }
+
+    @Test
+    public void testGetWorkflowExecutionState() throws Throwable {
+
+        Class<String> stateType = String.class;
+        when(clientExternal.getWorkflowExecutionState(stateType)).thenReturn("some state");
+        String state = (String) camelSWFWorkflowClient.getWorkflowExecutionState("123", "run1", stateType);
+
+        verify(clientExternal).getWorkflowExecutionState(stateType);
+        assertThat(state, is("some state"));
+    }
+
+    @Test
+    public void testRequestCancelWorkflowExecution() throws Throwable {
+        camelSWFWorkflowClient.requestCancelWorkflowExecution("123", "run1");
+
+        verify(clientExternal).requestCancelWorkflowExecution();
+    }
+
+    @Test
+    public void testTerminateWorkflowExecution() throws Throwable {
+        camelSWFWorkflowClient.terminateWorkflowExecution("123", "run1", "reason", "details", null);
+
+        verify(clientExternal).terminateWorkflowExecution("reason", "details", null);
+    }
+
+    @Test
+    public void testStartWorkflowExecution() throws Throwable {
+
+        WorkflowExecution workflowExecution = new WorkflowExecution();
+        workflowExecution.setWorkflowId("123");
+        workflowExecution.setRunId("run1");
+        when(clientExternal.getWorkflowExecution()).thenReturn(workflowExecution);
+
+
+        String[] ids = camelSWFWorkflowClient.startWorkflowExecution(null, null, "eventName", "version", null);
+
+        verify(clientExternal).startWorkflowExecution(new Object[]{null});
+        assertThat("123", is(ids[0]));
+        assertThat("run1", is(ids[1]));
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowConsumerTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowConsumerTest.java
new file mode 100644
index 0000000..2159fb8
--- /dev/null
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowConsumerTest.java
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import com.amazonaws.services.simpleworkflow.model.DecisionTask;
+import com.amazonaws.services.simpleworkflow.model.PollForDecisionTaskRequest;
+import org.apache.camel.Exchange;
+import org.apache.camel.Predicate;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class CamelSWFWorkflowConsumerTest extends CamelSWFTestSupport {
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+
+            public void configure() throws Exception {
+                from("aws-swf://workflow?" + options)
+                        .to("mock:result");
+            }
+        };
+    }
+
+    @Override
+    public boolean isUseAdviceWith() {
+        return true;
+    }
+
+    @Test
+    public void receivesDecisionTask() throws Exception {
+        result.expectedMessageCount(1);
+        result.expectedMessagesMatches(new Predicate() {
+            public boolean matches(Exchange exchange) {
+                return exchange.getIn().getHeader(SWFConstants.ACTION) != null;
+            }
+        });
+
+        DecisionTask decisionTask = new DecisionTask();
+        decisionTask.setTaskToken("token");
+        when(amazonSWClient.pollForDecisionTask(any(PollForDecisionTaskRequest.class))).thenReturn(decisionTask);
+
+        context.start();
+
+        assertMockEndpointsSatisfied();
+        verify(amazonSWClient, atLeastOnce()).pollForDecisionTask(any(PollForDecisionTaskRequest.class));
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowProducerTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowProducerTest.java
new file mode 100644
index 0000000..f394792
--- /dev/null
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowProducerTest.java
@@ -0,0 +1,60 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import com.amazonaws.services.simpleworkflow.model.Run;
+import com.amazonaws.services.simpleworkflow.model.StartWorkflowExecutionRequest;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.when;
+
+public class CamelSWFWorkflowProducerTest extends CamelSWFTestSupport {
+
+    @Test
+    public void sendInOnly() throws Exception {
+
+        result.expectedMessageCount(1);
+        when(amazonSWClient.startWorkflowExecution(any(StartWorkflowExecutionRequest.class))).thenReturn(new Run().withRunId("run1"));
+
+        template.send("direct:start", new Processor() {
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody("This is my message text.");
+            }
+        });
+
+        assertMockEndpointsSatisfied();
+        
+        Exchange resultExchange = result.getExchanges().get(0);
+        assertEquals("This is my message text.", resultExchange.getIn().getBody());
+
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+
+            public void configure() throws Exception {
+                from("direct:start")
+                    .to("aws-swf://workflow?" + options)
+                    .to("mock:result");
+            }
+        };
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java
new file mode 100644
index 0000000..12b8437
--- /dev/null
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Processor;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.aws.sqs.SqsConstants;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.spring.CamelSpringTestSupport;
+import org.junit.Test;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class SwfComponentSpringTest extends CamelSpringTestSupport {
+    
+    @EndpointInject(uri = "direct:start")
+    private ProducerTemplate template;
+    
+    @EndpointInject(uri = "mock:result")
+    private MockEndpoint result;
+    
+    @Test
+    public void sendInOut() throws Exception {
+        result.expectedMessageCount(1);
+        
+        template.send("direct:start", new Processor() {
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(SWFConstants.WORKFLOW_ID, "123");
+            }
+        });
+        
+        assertMockEndpointsSatisfied();
+        
+        Exchange resultExchange = result.getExchanges().get(0);
+        assertNotNull(resultExchange.getIn().getHeader(SWFConstants.WORKFLOW_ID));
+        assertNotNull(resultExchange.getIn().getHeader(SWFConstants.RUN_ID));
+    }
+
+    @Override
+    protected ClassPathXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/component/aws/swf/SwfComponentSpringTest-context.xml");
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/integration/CamelSWFEndToEndTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/integration/CamelSWFEndToEndTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/integration/CamelSWFEndToEndTest.java
new file mode 100644
index 0000000..1a9fdf1
--- /dev/null
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/integration/CamelSWFEndToEndTest.java
@@ -0,0 +1,90 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf.integration;
+
+import org.apache.camel.EndpointInject;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.aws.swf.SWFConstants;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import static org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied;
+
+@Ignore("Must be manually tested. Provide your own accessKey and secretKey and also create a SWF domain in advance")
+public class CamelSWFEndToEndTest extends CamelTestSupport {
+    protected String options =
+            "accessKey=XXX"
+                    + "&secretKey=YYY"
+                    + "&domainName=ZZZ"
+                    + "&activityList=swf-alist"
+                    + "&workflowList=swf-wlist"
+                    + "&clientConfiguration.endpoint=swf.eu-west-1.amazonaws.com"
+                    + "&version=1.0";
+
+    @EndpointInject(uri = "mock:starter")
+    private MockEndpoint starter;
+
+    @EndpointInject(uri = "mock:decider")
+    private MockEndpoint decider;
+
+    @EndpointInject(uri = "mock:worker")
+    private MockEndpoint worker;
+
+    @Test
+    public void consumerReceivedPreAndPostEntryCreatedEventNotifications() throws Exception {
+        starter.expectedMessageCount(1);
+        decider.expectedMinimumMessageCount(1);
+        worker.expectedMessageCount(2);
+
+        template.requestBody("direct:start", "Hello world!");
+
+        assertIsSatisfied(context);
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() {
+
+                from("aws-swf://activity?" + options + "&eventName=processActivities")
+                        .log("FOUND ACTIVITY TASK ${body}")
+                        .setBody(constant("1"))
+                        .to("mock:worker");
+
+                from("aws-swf://workflow?" + options + "&eventName=processWorkflows")
+                        .log("FOUND WORKFLOW TASK ${body}")
+
+                        .filter(header(SWFConstants.ACTION).isEqualTo(SWFConstants.EXECUTE_ACTION))
+
+                        .to("aws-swf://activity?" + options + "&eventName=processActivities")
+
+                        .setBody(constant("Message two"))
+                        .to("aws-swf://activity?" + options + "&eventName=processActivities")
+
+                        .log("SENT ACTIVITY TASK ${body}")
+                        .to("mock:decider");
+
+                from("direct:start")
+                        .to("aws-swf://workflow?" + options + "&eventName=processWorkflows")
+                        .log("SENT WORKFLOW TASK ${body}")
+                        .to("mock:starter");
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/test/resources/org/apache/camel/component/aws/swf/SwfComponentSpringTest-context.xml
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/resources/org/apache/camel/component/aws/swf/SwfComponentSpringTest-context.xml b/components/camel-aws/src/test/resources/org/apache/camel/component/aws/swf/SwfComponentSpringTest-context.xml
new file mode 100644
index 0000000..4b02072
--- /dev/null
+++ b/components/camel-aws/src/test/resources/org/apache/camel/component/aws/swf/SwfComponentSpringTest-context.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version
+  2.0 (the "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+  applicable law or agreed to in writing, software distributed under
+  the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
+  OR CONDITIONS OF ANY KIND, either express or implied. See the
+  License for the specific language governing permissions and
+  limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+    http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
+
+    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
+        <route>
+            <from uri="direct:start"/>
+            <to uri="aws-swf://workflow?amazonSWClient=#amazonSWClient&amp;accessKey=key&amp;secretKey=secret&amp;domainName=testDomain&amp;version=1.0&amp;eventName=testEvent"/>
+            <to uri="mock:result"/>
+        </route>
+    </camelContext>
+
+    <bean id="amazonSWClient" class="org.apache.camel.component.aws.swf.AmazonSWFClientMock"/>
+</beans>
\ No newline at end of file


[34/50] [abbrv] git commit: CAMEL-7037: Fixed the NPE when using the embedded or the run goal of guice-maven-plugin.

Posted by ni...@apache.org.
CAMEL-7037: Fixed the NPE when using the embedded or the run goal of guice-maven-plugin.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ae1a9563
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ae1a9563
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ae1a9563

Branch: refs/heads/camel-gora
Commit: ae1a956360cc863f8fc6d1b815c455163c2ed970
Parents: f5dafb1
Author: Babak Vahdat <bv...@apache.org>
Authored: Wed Dec 4 12:34:56 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Wed Dec 4 12:34:56 2013 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/guice/maven/EmbeddedMojo.java  |  4 ++--
 .../main/java/org/apache/camel/guice/maven/RunMojo.java  | 11 ++++++++---
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ae1a9563/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
index 36d743e..ced1a95 100644
--- a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
+++ b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
@@ -45,8 +45,8 @@ public class EmbeddedMojo extends AbstractExecMojo {
      * A value <= 0 will run forever.
      * Adding a s indicates seconds - eg "5s" means 5 seconds.
      *
-     * @parameter property="-1"
-     * @readonly
+     * @parameter property="camel.duration"
+     *            default-value="-1"
      */
     protected String duration;
 

http://git-wip-us.apache.org/repos/asf/camel/blob/ae1a9563/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
index 82e60b7..2b3d83c 100644
--- a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
+++ b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
@@ -85,8 +85,8 @@ public class RunMojo extends AbstractExecMojo {
      * milliseconds. A value <= 0 will run forever.
      * Adding a s indicates seconds - eg "5s" means 5 seconds.
      *
-     * @parameter property="-1"
-     *
+     * @parameter property="camel.duration"
+     *            default-value="-1"
      */
     protected String duration;
 
@@ -370,6 +370,11 @@ public class RunMojo extends AbstractExecMojo {
                                         .getMethod("main", String[].class);
                     main.invoke(null, new Object[] {arguments});
                 } catch (Exception e) { // just pass it on
+                    // let it be printed so end users can see the exception on the console
+                    getLog().error("*************************************");
+                    getLog().error("Error occurred while running main from: " + mainClass);
+                    getLog().error(e);
+                    getLog().error("*************************************");
                     Thread.currentThread().getThreadGroup().uncaughtException(Thread.currentThread(), e);
                 }
             }
@@ -395,7 +400,7 @@ public class RunMojo extends AbstractExecMojo {
             try {
                 threadGroup.destroy();
             } catch (IllegalThreadStateException e) {
-                getLog().warn("Couldn't destroy threadgroup " + threadGroup, e);
+                getLog().warn("Couldn't destroy thread group " + threadGroup, e);
             }
         }
 


[16/50] [abbrv] git commit: CAMEL-7028: Fixed the NPE when using the embedded goal of camel-maven-plugin.

Posted by ni...@apache.org.
CAMEL-7028: Fixed the NPE when using the embedded goal of camel-maven-plugin.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fa48ad8e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fa48ad8e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fa48ad8e

Branch: refs/heads/camel-gora
Commit: fa48ad8e4cb3a850f2ff40ff184c2f096d8507ea
Parents: 3ad2ccb
Author: Babak Vahdat <bv...@apache.org>
Authored: Mon Dec 2 12:31:50 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Mon Dec 2 12:31:50 2013 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/maven/EmbeddedMojo.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/fa48ad8e/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
index e70b880..d2ab154 100644
--- a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
+++ b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
@@ -46,8 +46,8 @@ public class EmbeddedMojo extends AbstractExecMojo {
      * A value <= 0 will run forever. 
      * Adding a s indicates seconds - eg "5s" means 5 seconds.
      *
-     * @parameter property="-1"
-     * @readonly
+     * @parameter property="camel.duration"
+     *            default-value="-1"
      */
     protected String duration;
     


[37/50] [abbrv] git commit: CAMEL-7038: Polished.

Posted by ni...@apache.org.
CAMEL-7038: Polished.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4e4cb68e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4e4cb68e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4e4cb68e

Branch: refs/heads/camel-gora
Commit: 4e4cb68ece9115ec6ce7c6b61e693aa257d10119
Parents: 33d7c49
Author: Babak Vahdat <bv...@apache.org>
Authored: Wed Dec 4 13:35:44 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Wed Dec 4 13:35:44 2013 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/camel/guice/maven/EmbeddedMojo.java    | 5 +++--
 .../src/main/java/org/apache/camel/guice/maven/RunMojo.java     | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4e4cb68e/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
index a120f9a..e3c7b3c 100644
--- a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
+++ b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
@@ -76,9 +76,10 @@ public class EmbeddedMojo extends AbstractExecMojo {
 
     /**
      * Allows to provide a custom properties file to initialize a
-     * {@link javax.naming.InitialContext} object with. As an exmaple this
+     * {@link javax.naming.InitialContext} object with. As an example this
      * argument can be be passed when making use of the GuiceyFruit JNDI
-     * Provider
+     * Provider where the properties file name is something else other than the
+     * default {@code jndi.properties}
      * 
      * @parameter property="jndiProperties"
      */

http://git-wip-us.apache.org/repos/asf/camel/blob/4e4cb68e/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
index eae01f0..c953003 100644
--- a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
+++ b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
@@ -109,9 +109,10 @@ public class RunMojo extends AbstractExecMojo {
 
     /**
      * Allows to provide a custom properties file to initialize a
-     * {@link javax.naming.InitialContext} object with. As an exmaple this
+     * {@link javax.naming.InitialContext} object with. As an example this
      * argument can be be passed when making use of the GuiceyFruit JNDI
-     * Provider
+     * Provider where the properties file name is something else other than the
+     * default {@code jndi.properties}
      * 
      * @parameter property="jndiProperties"
      */


[28/50] [abbrv] git commit: Corrected the tiny typo for skipping the online update check of Quartz2.

Posted by ni...@apache.org.
Corrected the tiny typo for skipping the online update check of Quartz2.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a2e63425
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a2e63425
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a2e63425

Branch: refs/heads/camel-gora
Commit: a2e6342580214f8e3b15b83560d1f7cfc6b6a635
Parents: b26df9f
Author: Babak Vahdat <bv...@apache.org>
Authored: Tue Dec 3 12:37:11 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Tue Dec 3 12:37:11 2013 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/component/quartz2/QuartzComponent.java  | 2 +-
 .../component/quartz2/SpringQuartzConsumerClusteredAppOne.xml     | 2 +-
 .../component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml     | 2 +-
 .../component/quartz2/SpringQuartzPersistentStoreRestartTest.xml  | 3 ++-
 .../camel/component/quartz2/SpringQuartzPersistentStoreTest.xml   | 2 +-
 .../camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml     | 2 +-
 .../camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml     | 2 +-
 7 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a2e63425/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
index cfaf801..a7eded9 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
@@ -163,7 +163,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
 
             // force disabling update checker (will do online check over the internet)
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
-            prop.put("org.terracotta.quartz.skipUpdateCheck=true", "true");
+            prop.put("org.terracotta.quartz.skipUpdateCheck", "true");
 
             // enable jmx unless configured to not do so
             if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {

http://git-wip-us.apache.org/repos/asf/camel/blob/a2e63425/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppOne.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppOne.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppOne.xml
index 1b52b5d..3b06927 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppOne.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppOne.xml
@@ -51,7 +51,7 @@
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">app-one</prop>
         <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
-        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">true</prop>
         <prop key="org.quartz.jobStore.clusterCheckinInterval">5000</prop>

http://git-wip-us.apache.org/repos/asf/camel/blob/a2e63425/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml
index f1273a4..287546c 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzConsumerClusteredAppTwo.xml
@@ -49,7 +49,7 @@
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">app-two</prop>
         <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
-        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">true</prop>
         <prop key="org.quartz.jobStore.clusterCheckinInterval">5000</prop>

http://git-wip-us.apache.org/repos/asf/camel/blob/a2e63425/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartTest.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartTest.xml
index 097cece..410968d 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartTest.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreRestartTest.xml
@@ -48,7 +48,8 @@
       <props>
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">AUTO</prop>
-        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
+        <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">false</prop>
       </props>

http://git-wip-us.apache.org/repos/asf/camel/blob/a2e63425/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreTest.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreTest.xml
index 871f182..e5605b9 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreTest.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/component/quartz2/SpringQuartzPersistentStoreTest.xml
@@ -49,7 +49,7 @@
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">AUTO</prop>
         <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
-        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">false</prop>
       </props>

http://git-wip-us.apache.org/repos/asf/camel/blob/a2e63425/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml
index 3c230d8..c75f049 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppOne.xml
@@ -49,7 +49,7 @@
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">app-one</prop>
         <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
-        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">true</prop>
         <prop key="org.quartz.jobStore.clusterCheckinInterval">5000</prop>

http://git-wip-us.apache.org/repos/asf/camel/blob/a2e63425/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml
index a01dde6..ac60919 100644
--- a/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml
+++ b/components/camel-quartz2/src/test/resources/org/apache/camel/routepolicy/quartz2/SpringQuartzClusteredAppTwo.xml
@@ -49,7 +49,7 @@
         <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
         <prop key="org.quartz.scheduler.instanceId">app-two</prop>
         <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
-        <prop key="org.terracotta.quartz.skipUpdateCheck=true">true</prop>
+        <prop key="org.terracotta.quartz.skipUpdateCheck">true</prop>
         <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
         <prop key="org.quartz.jobStore.isClustered">true</prop>
         <prop key="org.quartz.jobStore.clusterCheckinInterval">5000</prop>


[39/50] [abbrv] git commit: CAMEL-7041: Upgraded to jclouds 1.6.3

Posted by ni...@apache.org.
CAMEL-7041: Upgraded to jclouds 1.6.3

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d43c34bc
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d43c34bc
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d43c34bc

Branch: refs/heads/camel-gora
Commit: d43c34bcac8057e893582fe338507cb6770bcfd0
Parents: 298889a
Author: Babak Vahdat <bv...@apache.org>
Authored: Thu Dec 5 11:18:36 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Thu Dec 5 11:18:36 2013 +0100

----------------------------------------------------------------------
 .../apache/camel/component/jclouds/JcloudsBlobStoreConsumer.java   | 2 +-
 .../org/apache/camel/component/jclouds/JcloudsComputeProducer.java | 1 -
 parent/pom.xml                                                     | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d43c34bc/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreConsumer.java b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreConsumer.java
index b16a608..b702b19 100644
--- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreConsumer.java
+++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsBlobStoreConsumer.java
@@ -81,7 +81,7 @@ public class JcloudsBlobStoreConsumer extends ScheduledBatchPollingConsumer {
                         Exchange exchange = endpoint.createExchange();
                         CachedOutputStream cos = new CachedOutputStream(exchange);
                         IOHelper.copy(body, cos);
-                        exchange.getIn().setBody(cos.getStreamCache());
+                        exchange.getIn().setBody(cos.newStreamCache());
                         exchange.setProperty(JcloudsConstants.BLOB_NAME, blobName);
                         queue.add(exchange);
                     }

http://git-wip-us.apache.org/repos/asf/camel/blob/d43c34bc/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsComputeProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsComputeProducer.java b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsComputeProducer.java
index 139e29f..3d630d4 100644
--- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsComputeProducer.java
+++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsComputeProducer.java
@@ -107,7 +107,6 @@ public class JcloudsComputeProducer extends JcloudsProducer {
     /**
      * Runs a script on the target node.
      */
-    @SuppressWarnings("deprecation")
     protected void runScriptOnNode(Exchange exchange) throws CamelException {
         String script = exchange.getIn().getBody(String.class);
         String nodeId = getNodeId(exchange);

http://git-wip-us.apache.org/repos/asf/camel/blob/d43c34bc/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 62cc115..02c7d60 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -210,7 +210,7 @@
     <jboss-javaee-6-version>1.0.0.Final</jboss-javaee-6-version>
     <jboss-logging-version>3.1.3.GA</jboss-logging-version>
     <jboss-marshalling-version>1.3.18.GA</jboss-marshalling-version>
-    <jclouds-version>1.6.2-incubating</jclouds-version>
+    <jclouds-version>1.6.3</jclouds-version>
     <!-- jclouds must use this guava version -->
     <jclouds-google-guava-version>14.0.1</jclouds-google-guava-version>
     <jcr-version>2.0</jcr-version>


[43/50] [abbrv] git commit: CAMEL-7010 reverted the changes which should not be committed

Posted by ni...@apache.org.
CAMEL-7010 reverted the changes which should not be committed


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4a6f1a2e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4a6f1a2e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4a6f1a2e

Branch: refs/heads/camel-gora
Commit: 4a6f1a2e771656b49ea51357cb2bc14ab68eb722
Parents: 7e65a14
Author: Willem Jiang <wi...@gmail.com>
Authored: Sat Dec 7 22:43:32 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sat Dec 7 22:43:32 2013 +0800

----------------------------------------------------------------------
 .../apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java | 2 +-
 .../org/apache/camel/component/aws/swf/SwfComponentSpringTest.java | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4a6f1a2e/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java
index 69bc01f..42b53fe 100644
--- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClientTest.java
@@ -72,7 +72,7 @@ public class CamelSWFWorkflowClientTest {
         Date closeTimestamp = new Date();
         executionInfo.setCloseTimestamp(closeTimestamp);
         executionInfo.setExecutionStatus("CLOSED");
-        executionInfo.setTagList((List<String>)Collections.EMPTY_LIST);
+        executionInfo.setTagList(Collections.EMPTY_LIST);
 
         WorkflowExecutionDetail workflowExecutionDetail = new WorkflowExecutionDetail();
         workflowExecutionDetail.setExecutionInfo(executionInfo);

http://git-wip-us.apache.org/repos/asf/camel/blob/4a6f1a2e/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java
index 55b8a50..12b8437 100644
--- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/SwfComponentSpringTest.java
@@ -18,8 +18,10 @@ package org.apache.camel.component.aws.swf;
 
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.aws.sqs.SqsConstants;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.spring.CamelSpringTestSupport;
 import org.junit.Test;


[35/50] [abbrv] git commit: CAMEL-7038: Provide an option for the JNDI properties file by the Guice Maven Plugin.

Posted by ni...@apache.org.
CAMEL-7038: Provide an option for the JNDI properties file by the Guice Maven Plugin.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4ca36215
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4ca36215
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4ca36215

Branch: refs/heads/camel-gora
Commit: 4ca362155eaced0453c1220affb86d896037ebb1
Parents: ae1a956
Author: Babak Vahdat <bv...@apache.org>
Authored: Wed Dec 4 13:18:04 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Wed Dec 4 13:18:04 2013 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/camel/guice/Main.java  | 11 ++++++++--
 examples/camel-example-guice-jms/README.txt     |  6 +++++
 examples/camel-example-guice-jms/pom.xml        | 11 ++++++++++
 .../apache/camel/guice/maven/EmbeddedMojo.java  | 23 ++++++++++++++++++++
 .../org/apache/camel/guice/maven/RunMojo.java   | 14 ++++++++++++
 5 files changed, 63 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4ca36215/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java b/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
index 76af353..1d6d375 100644
--- a/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
+++ b/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.guice;
 
+import java.io.BufferedInputStream;
 import java.net.URL;
 import java.util.LinkedList;
 import java.util.Map;
@@ -32,12 +33,12 @@ import com.google.common.collect.Maps;
 import com.google.inject.Binding;
 import com.google.inject.Injector;
 import com.google.inject.Key;
-
 import org.apache.camel.CamelContext;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.guice.inject.Injectors;
 import org.apache.camel.main.MainSupport;
 import org.apache.camel.model.Constants;
+import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.view.ModelFileGenerator;
 
@@ -107,7 +108,13 @@ public class Main extends MainSupport {
         }
         if (jndiPropertiesUrl != null) {
             Properties properties = new Properties();
-            properties.load(jndiPropertiesUrl.openStream());
+            BufferedInputStream bis = null;
+            try {
+                bis = IOHelper.buffered(jndiPropertiesUrl.openStream());
+                properties.load(bis);
+            } finally {
+                IOHelper.close(bis);
+            }
             context = new InitialContext(properties);
         } else {
             context = new InitialContext();

http://git-wip-us.apache.org/repos/asf/camel/blob/4ca36215/examples/camel-example-guice-jms/README.txt
----------------------------------------------------------------------
diff --git a/examples/camel-example-guice-jms/README.txt b/examples/camel-example-guice-jms/README.txt
index b6228ca..fb378f3 100644
--- a/examples/camel-example-guice-jms/README.txt
+++ b/examples/camel-example-guice-jms/README.txt
@@ -13,6 +13,12 @@ You will need to compile this example first:
 To run the example type
   mvn exec:java
 
+Alternatively to run the example you can also make use of the Guice Maven
+Plugin provided by Camel, so you can instead type
+  mvn guice:run
+
+See the POM of this example about how to make use of this Maven Plugin
+
 You can see the routing rules by looking at the java code in the
 src/main/java directory and the guicejndi.properties file lives in
 src/main/resources/guicejndi.properties

http://git-wip-us.apache.org/repos/asf/camel/blob/4ca36215/examples/camel-example-guice-jms/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-guice-jms/pom.xml b/examples/camel-example-guice-jms/pom.xml
index 20c00da..7342686 100644
--- a/examples/camel-example-guice-jms/pom.xml
+++ b/examples/camel-example-guice-jms/pom.xml
@@ -128,6 +128,17 @@
                     </arguments>
                 </configuration>
             </plugin>
+
+            <!-- Allows the example to be run via 'mvn guice:run' -->
+            <plugin>
+                <groupId>org.apache.camel</groupId>
+                <artifactId>guice-maven-plugin</artifactId>
+                <version>${project.version}</version>
+                <configuration>
+                    <duration>5s</duration>
+                    <jndiProperties>/guicejndi.properties</jndiProperties>
+              </configuration>
+            </plugin>        
         </plugins>
 
     </build>

http://git-wip-us.apache.org/repos/asf/camel/blob/4ca36215/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
index ced1a95..a120f9a 100644
--- a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
+++ b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/EmbeddedMojo.java
@@ -75,6 +75,16 @@ public class EmbeddedMojo extends AbstractExecMojo {
     protected boolean dotAggregationEnabled;
 
     /**
+     * Allows to provide a custom properties file to initialize a
+     * {@link javax.naming.InitialContext} object with. As an exmaple this
+     * argument can be be passed when making use of the GuiceyFruit JNDI
+     * Provider
+     * 
+     * @parameter property="jndiProperties"
+     */
+    protected String jndiProperties;
+
+    /**
      * Project classpath.
      *
      * @parameter property="project.testClasspathElements"
@@ -176,6 +186,14 @@ public class EmbeddedMojo extends AbstractExecMojo {
         this.mainClass = mainClass;
     }
 
+    public String getJndiProperties() {
+        return jndiProperties;
+    }
+
+    public void setJndiProperties(String jndiProperties) {
+        this.jndiProperties = jndiProperties;
+    }
+
     // Implementation methods
     //-------------------------------------------------------------------------
 
@@ -212,6 +230,11 @@ public class EmbeddedMojo extends AbstractExecMojo {
         args.add("-duration");
         args.add(getDuration());
 
+        if (getJndiProperties() != null) {
+            args.add("-j");
+            args.add(getJndiProperties());
+        }
+
         return args.toArray(new String[0]);
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/4ca36215/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
index 2b3d83c..eae01f0 100644
--- a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
+++ b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
@@ -108,6 +108,16 @@ public class RunMojo extends AbstractExecMojo {
     protected boolean dotEnabled;
 
     /**
+     * Allows to provide a custom properties file to initialize a
+     * {@link javax.naming.InitialContext} object with. As an exmaple this
+     * argument can be be passed when making use of the GuiceyFruit JNDI
+     * Provider
+     * 
+     * @parameter property="jndiProperties"
+     */
+    protected String jndiProperties;
+
+    /**
      * @component
      */
     private ArtifactResolver artifactResolver;
@@ -328,6 +338,10 @@ public class RunMojo extends AbstractExecMojo {
             args.add("-o");
             args.add(dotDir);
         }
+        if (jndiProperties != null) {
+            args.add("-j");
+            args.add(jndiProperties);
+        }
         if (debug) {
             args.add("-x");
         }


[10/50] [abbrv] git commit: CAMEL-7025 fixed the NPE of StaxConverter

Posted by ni...@apache.org.
CAMEL-7025 fixed the NPE of StaxConverter


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/644c1f0a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/644c1f0a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/644c1f0a

Branch: refs/heads/camel-gora
Commit: 644c1f0ab894fbd8c33050cd354a38bbb7acac2a
Parents: 08a6f45
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Dec 2 14:38:20 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Dec 2 14:38:20 2013 +0800

----------------------------------------------------------------------
 .../apache/camel/converter/jaxp/StaxConverter.java    | 14 ++++++++++++--
 .../camel/converter/jaxp/StaxConverterTest.java       |  6 +++---
 2 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/644c1f0a/camel-core/src/main/java/org/apache/camel/converter/jaxp/StaxConverter.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/converter/jaxp/StaxConverter.java b/camel-core/src/main/java/org/apache/camel/converter/jaxp/StaxConverter.java
index 5469df5..ca16a11 100644
--- a/camel-core/src/main/java/org/apache/camel/converter/jaxp/StaxConverter.java
+++ b/camel-core/src/main/java/org/apache/camel/converter/jaxp/StaxConverter.java
@@ -167,7 +167,12 @@ public class StaxConverter {
     public XMLStreamReader createXMLStreamReader(InputStream in, Exchange exchange) throws XMLStreamException {
         XMLInputFactory factory = getInputFactory();
         try {
-            return factory.createXMLStreamReader(IOHelper.buffered(in), IOHelper.getCharsetName(exchange, false));
+            String charsetName = IOHelper.getCharsetName(exchange, false);
+            if (charsetName == null) {
+                return factory.createXMLStreamReader(IOHelper.buffered(in));
+            } else {
+                return factory.createXMLStreamReader(IOHelper.buffered(in), charsetName);
+            }
         } finally {
             returnXMLInputFactory(factory);
         }
@@ -236,7 +241,12 @@ public class StaxConverter {
     public XMLEventReader createXMLEventReader(InputStream in, Exchange exchange) throws XMLStreamException {
         XMLInputFactory factory = getInputFactory();
         try {
-            return factory.createXMLEventReader(IOHelper.buffered(in), IOHelper.getCharsetName(exchange, false));
+            String charsetName = IOHelper.getCharsetName(exchange, false);
+            if (charsetName == null) {
+                return factory.createXMLEventReader(IOHelper.buffered(in));
+            } else {
+                return factory.createXMLEventReader(IOHelper.buffered(in), charsetName);
+            }
         } finally {
             returnXMLInputFactory(factory);
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/644c1f0a/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java b/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java
index 5fe411b..3a299af 100644
--- a/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java
+++ b/camel-core/src/test/java/org/apache/camel/converter/jaxp/StaxConverterTest.java
@@ -58,7 +58,7 @@ public class StaxConverterTest extends ContextTestSupport {
             output = new ByteArrayOutputStream();
             // ensure UTF-8 encoding
             Exchange exchange = new DefaultExchange(context);
-            exchange.setProperty(Exchange.CHARSET_NAME, UTF_8.name());
+            //exchange.setProperty(Exchange.CHARSET_NAME, ISO_8859_1.toString());
             writer = context.getTypeConverter().mandatoryConvertTo(XMLEventWriter.class, exchange, output);
             while (reader.hasNext()) {
                 writer.add(reader.nextEvent());
@@ -74,7 +74,7 @@ public class StaxConverterTest extends ContextTestSupport {
         assertNotNull(output);
 
         String result = new String(output.toByteArray(), UTF_8.name());
-
+        System.out.println(result);
         boolean equals = TEST_XML_WITH_XML_HEADER.equals(result) || TEST_XML_WITH_XML_HEADER_ISO_8859_1.equals(result);
         assertTrue("Should match header", equals);
     }
@@ -93,7 +93,7 @@ public class StaxConverterTest extends ContextTestSupport {
             output = new ByteArrayOutputStream();
             // ensure UTF-8 encoding
             Exchange exchange = new DefaultExchange(context);
-            exchange.setProperty(Exchange.CHARSET_NAME, UTF_8.name());
+            //exchange.setProperty(Exchange.CHARSET_NAME, UTF_8.name());
             writer = context.getTypeConverter().mandatoryConvertTo(XMLStreamWriter.class, exchange, output);
             // copy to writer
             while (reader.hasNext()) {


[30/50] [abbrv] git commit: CAMEL-7023: Remove hawtio maven plugin.

Posted by ni...@apache.org.
CAMEL-7023: Remove hawtio maven plugin.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/88a5104f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/88a5104f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/88a5104f

Branch: refs/heads/camel-gora
Commit: 88a5104f25bb4d504e6e0b74a3474e27620cedd1
Parents: 963b1c3
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Dec 3 19:05:32 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Dec 3 19:06:50 2013 +0100

----------------------------------------------------------------------
 parent/pom.xml                                  |  1 -
 tooling/maven/camel-maven-plugin/pom.xml        |  7 ---
 .../java/org/apache/camel/maven/HawtioMojo.java | 54 --------------------
 3 files changed, 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/88a5104f/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index a5645ac..62cc115 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -173,7 +173,6 @@
     <hawtbuf-version>1.9</hawtbuf-version>
     <hawtdb-version>1.6</hawtdb-version>
     <hawtdispatch-version>1.18</hawtdispatch-version>
-    <hawtio-version>1.2.0</hawtio-version>
     <hazelcast-version>3.0.2</hazelcast-version>
     <hbase-version>0.94.10</hbase-version>
     <hbase-bundle-version>0.94.6_1</hbase-bundle-version>

http://git-wip-us.apache.org/repos/asf/camel/blob/88a5104f/tooling/maven/camel-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-maven-plugin/pom.xml b/tooling/maven/camel-maven-plugin/pom.xml
index d4d160b..ebd7b78 100644
--- a/tooling/maven/camel-maven-plugin/pom.xml
+++ b/tooling/maven/camel-maven-plugin/pom.xml
@@ -53,13 +53,6 @@
       <artifactId>camel-cdi</artifactId>
     </dependency>
 
-    <!--for the hawtio goal -->
-    <dependency>
-      <groupId>io.hawt</groupId>
-      <artifactId>hawtio-app</artifactId>
-      <version>${hawtio-version}</version>
-    </dependency>
-
     <dependency>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>exec-maven-plugin</artifactId>

http://git-wip-us.apache.org/repos/asf/camel/blob/88a5104f/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java b/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java
deleted file mode 100644
index 57e509e..0000000
--- a/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/HawtioMojo.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.maven;
-
-import java.lang.reflect.Method;
-
-/**
- * Runs a CamelContext using any Spring or Blueprint XML configuration files found in
- * <code>META-INF/spring/*.xml</code>, and <code>OSGI-INF/blueprint/*.xml</code>,
- * and <code>camel-*.xml</code> and starting up the context together with
- * <a href="http://hawt.io/">hawtio</a> as web console.
- *
- * @goal hawtio
- * @requiresDependencyResolution compile+runtime
- * @execute phase="test-compile"
- */
-public class HawtioMojo extends RunMojo {
-
-    /**
-     * The port number to use for the hawtio web console.
-     *
-     * @parameter property="camel.port"
-     *            default-value="8080"
-     */
-    private int port = 8080;
-
-    public HawtioMojo() {
-        extendedPluginDependencyArtifactId = "hawtio-app";
-    }
-
-    @Override
-    protected void beforeBootstrapCamel() throws Exception {
-        getLog().info("Starting hawtio ...");
-        Method hawtioMain = Thread.currentThread().getContextClassLoader()
-                .loadClass("io.hawt.app.App").getMethod("main", String[].class);
-        String[] args = new String[]{"--port", "" + port, "--join", "false"};
-        hawtioMain.invoke(null, new Object[]{args});
-    }
-
-}


[06/50] [abbrv] git commit: CAMEL-7026: camel-jms - Allow a message to control the request timeout using a header

Posted by ni...@apache.org.
CAMEL-7026: camel-jms - Allow a message to control the request timeout using a header


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/799f95cb
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/799f95cb
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/799f95cb

Branch: refs/heads/camel-gora
Commit: 799f95cbb616a44184a327b4a59870bd5c4c399f
Parents: 46b5128
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Nov 29 14:38:20 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Nov 29 14:39:24 2013 +0100

----------------------------------------------------------------------
 .../camel/component/jms/JmsConstants.java       |   1 +
 .../apache/camel/component/jms/JmsProducer.java |  14 ++-
 .../camel/component/jms/reply/ReplyManager.java |   4 +-
 .../JmsInOutIndividualRequestTimeoutTest.java   | 105 +++++++++++++++++++
 4 files changed, 118 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/799f95cb/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConstants.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConstants.java
index e96a817..a4f7b23 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConstants.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConstants.java
@@ -25,6 +25,7 @@ public final class JmsConstants {
     public static final String JMS_DESTINATION_NAME = "CamelJmsDestinationName";
     public static final String JMS_MESSAGE_TYPE = "CamelJmsMessageType";
     public static final String JMS_DELIVERY_MODE = "CamelJmsDeliveryMode";
+    public static final String JMS_REQUEST_TIMEOUT = "CamelJmsRequestTimeout";
 
     private JmsConstants() {
         // utility class

http://git-wip-us.apache.org/repos/asf/camel/blob/799f95cb/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
index 096df8c..067b5bd 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
@@ -182,6 +182,9 @@ public class JmsProducer extends DefaultAsyncProducer {
 
         initReplyManager();
 
+        // the request timeout can be overruled by a header otherwise the endpoint configured value is used
+        final long timeout = exchange.getIn().getHeader(JmsConstants.JMS_REQUEST_TIMEOUT, endpoint.getRequestTimeout(), long.class);
+
         // when using message id as correlation id, we need at first to use a provisional correlation id
         // which we then update to the real JMSMessageID when the message has been sent
         // this is done with the help of the MessageSentCallback
@@ -189,7 +192,7 @@ public class JmsProducer extends DefaultAsyncProducer {
         final String provisionalCorrelationId = msgIdAsCorrId ? getUuidGenerator().generateUuid() : null;
         MessageSentCallback messageSentCallback = null;
         if (msgIdAsCorrId) {
-            messageSentCallback = new UseMessageIdAsCorrelationIdMessageSentCallback(replyManager, provisionalCorrelationId, endpoint.getRequestTimeout());
+            messageSentCallback = new UseMessageIdAsCorrelationIdMessageSentCallback(replyManager, provisionalCorrelationId, timeout);
         }
 
         final String originalCorrelationId = in.getHeader("JMSCorrelationID", String.class);
@@ -209,13 +212,16 @@ public class JmsProducer extends DefaultAsyncProducer {
                 if (replyTo == null) {
                     throw new RuntimeExchangeException("Failed to resolve replyTo destination", exchange);
                 }
-                LOG.debug("Using JMSReplyTo destination: {}", replyTo);
                 JmsMessageHelper.setJMSReplyTo(answer, replyTo);
                 replyManager.setReplyToSelectorHeader(in, answer);
 
                 String correlationId = determineCorrelationId(answer, provisionalCorrelationId);
-                replyManager.registerReply(replyManager, exchange, callback, originalCorrelationId, correlationId, endpoint.getRequestTimeout());
-                LOG.debug("Using JMSCorrelationID: {}", correlationId);
+                replyManager.registerReply(replyManager, exchange, callback, originalCorrelationId, correlationId, timeout);
+
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Using JMSCorrelationID: {}, JMSReplyTo destination: {}, with request timeout: {} ms.",
+                           new Object[]{correlationId, replyTo, timeout});
+                }
 
                 LOG.trace("Created javax.jms.Message: {}", answer);
                 return answer;

http://git-wip-us.apache.org/repos/asf/camel/blob/799f95cb/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManager.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManager.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManager.java
index 85d1d95..9eb0085 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManager.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManager.java
@@ -69,7 +69,7 @@ public interface ReplyManager extends MessageListener {
      * @param callback        the callback
      * @param originalCorrelationId  an optional original correlation id
      * @param correlationId   the correlation id to expect being used
-     * @param requestTimeout  an optional timeout
+     * @param requestTimeout  the timeout
      * @return the correlation id used
      */
     String registerReply(ReplyManager replyManager, Exchange exchange, AsyncCallback callback,
@@ -85,7 +85,7 @@ public interface ReplyManager extends MessageListener {
      *
      * @param correlationId     the provisional correlation id
      * @param newCorrelationId  the real correlation id
-     * @param requestTimeout    an optional timeout
+     * @param requestTimeout    the timeout
      */
     void updateCorrelationId(String correlationId, String newCorrelationId, long requestTimeout);
 

http://git-wip-us.apache.org/repos/asf/camel/blob/799f95cb/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOutIndividualRequestTimeoutTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOutIndividualRequestTimeoutTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOutIndividualRequestTimeoutTest.java
new file mode 100644
index 0000000..366a672
--- /dev/null
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOutIndividualRequestTimeoutTest.java
@@ -0,0 +1,105 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jms;
+
+import javax.jms.ConnectionFactory;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelExecutionException;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangeTimedOutException;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+import static org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
+
+/**
+ *
+ */
+public class JmsInOutIndividualRequestTimeoutTest extends CamelTestSupport {
+
+    protected String componentName = "activemq";
+
+    @Test
+    public void testOk() throws Exception {
+        getMockEndpoint("mock:result").expectedBodiesReceived("Bye Camel");
+
+        String out = template.requestBody("direct:start", "Camel", String.class);
+        assertEquals("Bye Camel", out);
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testTimeout() throws Exception {
+        getMockEndpoint("mock:result").expectedMessageCount(0);
+
+        try {
+            template.requestBodyAndHeader("direct:start", "World", JmsConstants.JMS_REQUEST_TIMEOUT, 1500L, String.class);
+            fail("Should have thrown exception");
+        } catch (CamelExecutionException e) {
+            ExchangeTimedOutException timeout = assertIsInstanceOf(ExchangeTimedOutException.class, e.getCause());
+            assertEquals(1500, timeout.getTimeout());
+        }
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testIndividualTimeout() throws Exception {
+        getMockEndpoint("mock:result").expectedMessageCount(1);
+
+        String out = template.requestBodyAndHeader("direct:start", "World", JmsConstants.JMS_REQUEST_TIMEOUT, 8000L, String.class);
+        assertEquals("Bye World", out);
+
+        assertMockEndpointsSatisfied();
+    }
+
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext camelContext = super.createCamelContext();
+
+        ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
+        camelContext.addComponent(componentName, jmsComponentAutoAcknowledge(connectionFactory));
+
+        return camelContext;
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("direct:start")
+                        .inOut("activemq:queue:foo?replyTo=queue:bar&requestTimeout=2000")
+                        .to("mock:result");
+
+                from("activemq:queue:foo")
+                        .process(new Processor() {
+                            @Override
+                            public void process(Exchange exchange) throws Exception {
+                                String body = exchange.getIn().getBody(String.class);
+                                if ("World".equals(body)) {
+                                    log.debug("Sleeping for 4 sec to force a timeout");
+                                    Thread.sleep(4000);
+                                }
+                            }
+                        }).transform(body().prepend("Bye ")).to("log:reply");
+            }
+        };
+    }
+
+}


[32/50] [abbrv] git commit: New component for Amazon Simple Workflow Service

Posted by ni...@apache.org.
New component for Amazon Simple Workflow Service


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1c1d3a88
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1c1d3a88
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1c1d3a88

Branch: refs/heads/camel-gora
Commit: 1c1d3a883202e6de89ba9eee9bdedcc55cf15584
Parents: 88a5104
Author: Bilgin Ibryam <bi...@apache.com>
Authored: Tue Dec 3 23:49:55 2013 +0000
Committer: Bilgin Ibryam <bi...@apache.com>
Committed: Tue Dec 3 23:49:55 2013 +0000

----------------------------------------------------------------------
 components/camel-aws/pom.xml                    |   3 +-
 .../aws/swf/CamelActivityImplementation.java    | 102 ++++++++
 .../swf/CamelActivityImplementationFactory.java |  61 +++++
 .../aws/swf/CamelSWFActivityClient.java         |  66 ++++++
 .../aws/swf/CamelSWFWorkflowClient.java         | 119 ++++++++++
 .../aws/swf/CamelWorkflowDefinition.java        | 139 +++++++++++
 .../aws/swf/CamelWorkflowDefinitionFactory.java |  58 +++++
 .../CamelWorkflowDefinitionFactoryFactory.java  |  52 ++++
 .../component/aws/swf/SWFActivityConsumer.java  |  69 ++++++
 .../component/aws/swf/SWFActivityProducer.java  |  61 +++++
 .../camel/component/aws/swf/SWFComponent.java   |  44 ++++
 .../component/aws/swf/SWFConfiguration.java     | 236 +++++++++++++++++++
 .../camel/component/aws/swf/SWFConstants.java   |  37 +++
 .../camel/component/aws/swf/SWFEndpoint.java    | 141 +++++++++++
 .../component/aws/swf/SWFWorkflowConsumer.java  |  87 +++++++
 .../component/aws/swf/SWFWorkflowProducer.java  | 170 +++++++++++++
 .../services/org/apache/camel/component/aws-swf |   1 +
 .../component/aws/swf/AmazonSWFClientMock.java  |  32 +++
 .../aws/swf/CamelSWFActivityClientTest.java     |  51 ++++
 .../aws/swf/CamelSWFActivityConsumerTest.java   |  68 ++++++
 .../component/aws/swf/CamelSWFTestSupport.java  |  54 +++++
 .../aws/swf/CamelSWFWorkflowClientTest.java     | 143 +++++++++++
 .../aws/swf/CamelSWFWorkflowConsumerTest.java   |  66 ++++++
 .../aws/swf/CamelSWFWorkflowProducerTest.java   |  60 +++++
 .../aws/swf/SwfComponentSpringTest.java         |  59 +++++
 .../swf/integration/CamelSWFEndToEndTest.java   |  90 +++++++
 .../aws/swf/SwfComponentSpringTest-context.xml  |  32 +++
 27 files changed, 2100 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-aws/pom.xml b/components/camel-aws/pom.xml
index 9440099..f05536a 100644
--- a/components/camel-aws/pom.xml
+++ b/components/camel-aws/pom.xml
@@ -40,7 +40,8 @@
           org.apache.camel.spi.ComponentResolver;component=aws-sdb,
           org.apache.camel.spi.ComponentResolver;component=aws-ses,
           org.apache.camel.spi.ComponentResolver;component=aws-sns,
-          org.apache.camel.spi.ComponentResolver;component=aws-sqs
+          org.apache.camel.spi.ComponentResolver;component=aws-sqs,
+          org.apache.camel.spi.ComponentResolver;component=aws-swf
         </camel.osgi.export.service>
     </properties>
 

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelActivityImplementation.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelActivityImplementation.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelActivityImplementation.java
new file mode 100644
index 0000000..042f2b8
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelActivityImplementation.java
@@ -0,0 +1,102 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.CancellationException;
+
+import com.amazonaws.services.simpleworkflow.flow.ActivityExecutionContext;
+import com.amazonaws.services.simpleworkflow.flow.ActivityExecutionContextProviderImpl;
+import com.amazonaws.services.simpleworkflow.flow.ActivityFailureException;
+import com.amazonaws.services.simpleworkflow.flow.DataConverter;
+import com.amazonaws.services.simpleworkflow.flow.DataConverterException;
+import com.amazonaws.services.simpleworkflow.flow.common.WorkflowExecutionUtils;
+import com.amazonaws.services.simpleworkflow.flow.generic.ActivityImplementationBase;
+import com.amazonaws.services.simpleworkflow.flow.worker.ActivityTypeExecutionOptions;
+import com.amazonaws.services.simpleworkflow.flow.worker.ActivityTypeRegistrationOptions;
+import com.amazonaws.services.simpleworkflow.flow.worker.CurrentActivityExecutionContext;
+
+public class CamelActivityImplementation extends ActivityImplementationBase {
+    private final ActivityTypeExecutionOptions executionOptions;
+    private final ActivityTypeRegistrationOptions registrationOptions;
+    private final DataConverter converter;
+    private final SWFActivityConsumer swfWorkflowConsumer;
+    private final ActivityExecutionContextProviderImpl contextProvider = new ActivityExecutionContextProviderImpl();
+
+    public CamelActivityImplementation(SWFActivityConsumer swfWorkflowConsumer, ActivityTypeRegistrationOptions activityTypeRegistrationOptions,
+                                       ActivityTypeExecutionOptions activityTypeExecutionOptions, DataConverter converter) {
+        this.swfWorkflowConsumer = swfWorkflowConsumer;
+        this.registrationOptions = activityTypeRegistrationOptions;
+        this.executionOptions = activityTypeExecutionOptions;
+        this.converter = converter;
+    }
+
+    @Override
+    public ActivityTypeRegistrationOptions getRegistrationOptions() {
+        return registrationOptions;
+    }
+
+    @Override
+    public ActivityTypeExecutionOptions getExecutionOptions() {
+        return executionOptions;
+    }
+
+    @Override
+    protected String execute(String input, ActivityExecutionContext context) throws ActivityFailureException, CancellationException {
+        Object[] inputParameters = converter.fromData(input, Object[].class);
+        CurrentActivityExecutionContext.set(context);
+        Object result = null;
+
+        ActivityExecutionContext executionContext = contextProvider.getActivityExecutionContext();
+        String taskToken = executionContext.getTaskToken();
+
+        try {
+            result = swfWorkflowConsumer.processActivity(inputParameters, taskToken);
+        } catch (InvocationTargetException invocationException) {
+            throwActivityFailureException(invocationException.getTargetException() != null ? invocationException.getTargetException() : invocationException);
+        } catch (IllegalArgumentException illegalArgumentException) {
+            throwActivityFailureException(illegalArgumentException);
+        } catch (IllegalAccessException illegalAccessException) {
+            throwActivityFailureException(illegalAccessException);
+        } catch (Exception e) {
+            throwActivityFailureException(e);
+        } finally {
+            CurrentActivityExecutionContext.unset();
+        }
+        String resultSerialized = converter.toData(result);
+        return resultSerialized;
+    }
+
+    void throwActivityFailureException(Throwable exception) throws ActivityFailureException, CancellationException {
+        if (exception instanceof CancellationException) {
+            throw (CancellationException) exception;
+        }
+
+        String reason = WorkflowExecutionUtils.truncateReason(exception.getMessage());
+        String details = null;
+        try {
+            details = converter.toData(exception);
+        } catch (DataConverterException dataConverterException) {
+            if (dataConverterException.getCause() == null) {
+                dataConverterException.initCause(exception);
+            }
+            throw dataConverterException;
+        }
+
+        throw new ActivityFailureException(reason, details);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelActivityImplementationFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelActivityImplementationFactory.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelActivityImplementationFactory.java
new file mode 100644
index 0000000..15a487e
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelActivityImplementationFactory.java
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import java.util.ArrayList;
+
+import com.amazonaws.services.simpleworkflow.flow.DataConverter;
+import com.amazonaws.services.simpleworkflow.flow.JsonDataConverter;
+import com.amazonaws.services.simpleworkflow.flow.generic.ActivityImplementation;
+import com.amazonaws.services.simpleworkflow.flow.generic.ActivityImplementationFactory;
+import com.amazonaws.services.simpleworkflow.flow.worker.ActivityTypeExecutionOptions;
+import com.amazonaws.services.simpleworkflow.flow.worker.ActivityTypeRegistrationOptions;
+import com.amazonaws.services.simpleworkflow.model.ActivityType;
+
+public class CamelActivityImplementationFactory extends ActivityImplementationFactory {
+    private SWFActivityConsumer swfWorkflowConsumer;
+    private SWFConfiguration configuration;
+
+    public CamelActivityImplementationFactory(SWFActivityConsumer swfWorkflowConsumer, SWFConfiguration configuration) {
+        this.swfWorkflowConsumer = swfWorkflowConsumer;
+        this.configuration = configuration;
+    }
+
+    @Override
+    public Iterable<ActivityType> getActivityTypesToRegister() {
+        ArrayList<ActivityType> activityTypes = new ArrayList<ActivityType>(1);
+        ActivityType activityType = new ActivityType();
+        activityType.setName(configuration.getEventName());
+        activityType.setVersion(configuration.getVersion());
+        activityTypes.add(activityType);
+        return activityTypes;
+    }
+
+    @Override
+    public ActivityImplementation getActivityImplementation(ActivityType activityType) {
+        ActivityTypeExecutionOptions activityTypeExecutionOptions = configuration.getActivityTypeExecutionOptions() != null
+                ? configuration.getActivityTypeExecutionOptions() : new ActivityTypeExecutionOptions();
+
+        ActivityTypeRegistrationOptions activityTypeRegistrationOptions = configuration.getActivityTypeRegistrationOptions() != null
+                ? configuration.getActivityTypeRegistrationOptions() : new ActivityTypeRegistrationOptions();
+
+        DataConverter dataConverter = configuration.getDataConverter() != null
+                ? configuration.getDataConverter() : new JsonDataConverter();
+
+        return new CamelActivityImplementation(swfWorkflowConsumer, activityTypeRegistrationOptions, activityTypeExecutionOptions, dataConverter);
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelSWFActivityClient.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelSWFActivityClient.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelSWFActivityClient.java
new file mode 100644
index 0000000..f75b7de
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelSWFActivityClient.java
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import com.amazonaws.services.simpleworkflow.flow.DynamicActivitiesClient;
+import com.amazonaws.services.simpleworkflow.flow.DynamicActivitiesClientImpl;
+import com.amazonaws.services.simpleworkflow.flow.core.Promise;
+import com.amazonaws.services.simpleworkflow.model.ActivityType;
+
+public class CamelSWFActivityClient {
+    private final DynamicActivitiesClient dynamicActivitiesClient;
+    private SWFConfiguration configuration;
+
+    public CamelSWFActivityClient(SWFConfiguration configuration) {
+        this.configuration = configuration;
+        dynamicActivitiesClient = getDynamicActivitiesClient();
+    }
+
+    public Object scheduleActivity(String eventName, String version, Object input) {
+        ActivityType activity = new ActivityType();
+        activity.setName(eventName);
+        activity.setVersion(version);
+
+        Promise[] promises = asPromiseArray(input);
+        Promise<?> promise = dynamicActivitiesClient.scheduleActivity(activity, promises, configuration.getActivitySchedulingOptions(), Object.class, null);
+        return promise;
+    }
+
+    protected Promise[] asPromiseArray(Object input) {
+        Promise[] promises;
+        if (input instanceof Object[]) {
+            Object[] inputArray = (Object[])input;
+            promises = new Promise[inputArray.length];
+            for (int i = 0; i < inputArray.length; i++) {
+                promises[i] = Promise.asPromise(inputArray[i]);
+            }
+        } else {
+            promises = new Promise[1];
+            if (input instanceof Promise) {
+                promises[0] = (Promise) input;
+            } else {
+                promises[0] = Promise.asPromise(input);
+            }
+        }
+        return promises;
+    }
+
+    DynamicActivitiesClient getDynamicActivitiesClient() {
+        return new DynamicActivitiesClientImpl();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClient.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClient.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClient.java
new file mode 100644
index 0000000..f4ce393
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelSWFWorkflowClient.java
@@ -0,0 +1,119 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.amazonaws.services.simpleworkflow.flow.DynamicWorkflowClientExternal;
+import com.amazonaws.services.simpleworkflow.flow.DynamicWorkflowClientExternalImpl;
+import com.amazonaws.services.simpleworkflow.flow.common.WorkflowExecutionUtils;
+import com.amazonaws.services.simpleworkflow.flow.worker.GenericWorkflowClientExternalImpl;
+import com.amazonaws.services.simpleworkflow.model.ChildPolicy;
+import com.amazonaws.services.simpleworkflow.model.DescribeWorkflowExecutionRequest;
+import com.amazonaws.services.simpleworkflow.model.HistoryEvent;
+import com.amazonaws.services.simpleworkflow.model.WorkflowExecution;
+import com.amazonaws.services.simpleworkflow.model.WorkflowExecutionDetail;
+import com.amazonaws.services.simpleworkflow.model.WorkflowExecutionInfo;
+import com.amazonaws.services.simpleworkflow.model.WorkflowType;
+
+public class CamelSWFWorkflowClient {
+    private final SWFEndpoint endpoint;
+    private final SWFConfiguration configuration;
+
+    public CamelSWFWorkflowClient(SWFEndpoint endpoint, SWFConfiguration configuration) {
+        this.endpoint = endpoint;
+        this.configuration = configuration;
+    }
+
+    public void signalWorkflowExecution(String workflowId, String runId, String signalName, Object arguments) {
+        DynamicWorkflowClientExternal dynamicWorkflowClientExternal = getDynamicWorkflowClient(workflowId, runId);
+        dynamicWorkflowClientExternal.signalWorkflowExecution(signalName, toArray(arguments));
+    }
+
+    public Object getWorkflowExecutionState(String workflowId, String runId, Class aClass) throws Throwable {
+        DynamicWorkflowClientExternal dynamicWorkflowClientExternal = getDynamicWorkflowClient(workflowId, runId);
+        return dynamicWorkflowClientExternal.getWorkflowExecutionState(aClass);
+    }
+
+    public void requestCancelWorkflowExecution(String workflowId, String runId) {
+        DynamicWorkflowClientExternal dynamicWorkflowClientExternal = getDynamicWorkflowClient(workflowId, runId);
+        dynamicWorkflowClientExternal.requestCancelWorkflowExecution();
+    }
+
+    public void terminateWorkflowExecution(String workflowId, String runId, String reason, String details, String childPolicy) {
+        DynamicWorkflowClientExternal dynamicWorkflowClientExternal = getDynamicWorkflowClient(workflowId, runId);
+        ChildPolicy policy = childPolicy != null ? ChildPolicy.valueOf(childPolicy) : null;
+        dynamicWorkflowClientExternal.terminateWorkflowExecution(reason, details, policy);
+    }
+
+    public String[] startWorkflowExecution(String workflowId, String runId, String eventName, String version, Object arguments) {
+        DynamicWorkflowClientExternalImpl dynamicWorkflowClientExternal = (DynamicWorkflowClientExternalImpl) getDynamicWorkflowClient(workflowId, runId);
+
+        WorkflowType workflowType = new WorkflowType();
+        workflowType.setName(eventName);
+        workflowType.setVersion(version);
+        dynamicWorkflowClientExternal.setWorkflowType(workflowType);
+        dynamicWorkflowClientExternal.startWorkflowExecution(toArray(arguments));
+
+        String newWorkflowId = dynamicWorkflowClientExternal.getWorkflowExecution().getWorkflowId();
+        String newRunId = dynamicWorkflowClientExternal.getWorkflowExecution().getRunId();
+
+        return new String[] {newWorkflowId, newRunId};
+    }
+
+    public Map<String, Object> describeWorkflowInstance(String workflowId, String runId) {
+        DescribeWorkflowExecutionRequest describeRequest = new DescribeWorkflowExecutionRequest();
+        describeRequest.setDomain(configuration.getDomainName());
+        describeRequest.setExecution(new WorkflowExecution().withWorkflowId(workflowId).withRunId(runId));
+        WorkflowExecutionDetail executionDetail = endpoint.getSWClient().describeWorkflowExecution(describeRequest);
+        WorkflowExecutionInfo instanceMetadata = executionDetail.getExecutionInfo();
+
+        Map<String, Object> info = new HashMap<String, Object>();
+        info.put("closeStatus", instanceMetadata.getCloseStatus());
+        info.put("closeTimestamp", instanceMetadata.getCloseTimestamp());
+        info.put("executionStatus", instanceMetadata.getExecutionStatus());
+        info.put("tagList", instanceMetadata.getTagList());
+        info.put("executionDetail", executionDetail);
+        return info;
+    }
+
+    public List<HistoryEvent> getWorkflowExecutionHistory(String workflowId, String runId) {
+        return WorkflowExecutionUtils.getHistory(endpoint.getSWClient(),
+                configuration.getDomainName(), new WorkflowExecution().withWorkflowId(workflowId).withRunId(runId));
+    }
+
+    DynamicWorkflowClientExternal getDynamicWorkflowClient(String workflowId, String runId) {
+        GenericWorkflowClientExternalImpl genericClient = new GenericWorkflowClientExternalImpl(endpoint.getSWClient(), configuration.getDomainName());
+        WorkflowExecution workflowExecution = new WorkflowExecution();
+        workflowExecution.setWorkflowId(workflowId != null ? workflowId : genericClient.generateUniqueId());
+        workflowExecution.setRunId(runId);
+        return new DynamicWorkflowClientExternalImpl(workflowExecution, null, endpoint.getStartWorkflowOptions(), null, genericClient);
+    }
+
+    private Object[] toArray(Object input) {
+        Object[] inputArray;
+        if (input instanceof Object[]) {
+            inputArray = (Object[])input;
+        } else {
+            inputArray = new Object[1];
+            inputArray[0] = input;
+        }
+        return inputArray;
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinition.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinition.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinition.java
new file mode 100644
index 0000000..ba95fea
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinition.java
@@ -0,0 +1,139 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.atomic.AtomicReference;
+
+import com.amazonaws.services.simpleworkflow.flow.DataConverter;
+import com.amazonaws.services.simpleworkflow.flow.DataConverterException;
+import com.amazonaws.services.simpleworkflow.flow.DecisionContext;
+import com.amazonaws.services.simpleworkflow.flow.DecisionContextProvider;
+import com.amazonaws.services.simpleworkflow.flow.DecisionContextProviderImpl;
+import com.amazonaws.services.simpleworkflow.flow.JsonDataConverter;
+import com.amazonaws.services.simpleworkflow.flow.WorkflowClock;
+import com.amazonaws.services.simpleworkflow.flow.WorkflowException;
+import com.amazonaws.services.simpleworkflow.flow.common.WorkflowExecutionUtils;
+import com.amazonaws.services.simpleworkflow.flow.core.Promise;
+import com.amazonaws.services.simpleworkflow.flow.core.Settable;
+import com.amazonaws.services.simpleworkflow.flow.core.TryCatchFinally;
+import com.amazonaws.services.simpleworkflow.flow.generic.WorkflowDefinition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CamelWorkflowDefinition extends WorkflowDefinition {
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(CamelWorkflowDefinition.class);
+
+    private SWFWorkflowConsumer swfWorkflowConsumer;
+    private DecisionContext decisionContext;
+    private JsonDataConverter dataConverter;
+
+    private final DecisionContextProvider contextProvider = new DecisionContextProviderImpl();
+    private final WorkflowClock workflowClock = contextProvider.getDecisionContext().getWorkflowClock();
+
+    public CamelWorkflowDefinition(SWFWorkflowConsumer swfWorkflowConsumer, DecisionContext decisionContext, JsonDataConverter dataConverter) {
+        this.swfWorkflowConsumer = swfWorkflowConsumer;
+        this.decisionContext = decisionContext;
+        this.dataConverter = dataConverter;
+    }
+
+    @Override
+    public Promise<String> execute(final String input) throws WorkflowException {
+        final Settable<String> result = new Settable<String>();
+        final AtomicReference<Promise> methodResult = new AtomicReference<Promise>();
+        new TryCatchFinally() {
+
+            @Override
+            protected void doTry() throws Throwable {
+                Object[] parameters = dataConverter.fromData(input, Object[].class);
+                long startTime = workflowClock.currentTimeMillis();
+                boolean replaying = contextProvider.getDecisionContext().getWorkflowClock().isReplaying();
+                LOGGER.debug("Processing workflow execute");
+
+                Object r = swfWorkflowConsumer.processWorkflow(parameters, startTime, replaying);
+                if (r instanceof Promise) {
+                    methodResult.set((Promise) r);
+                } else if (r != null) {
+                    methodResult.set(new Settable(r));
+                }
+            }
+
+            @Override
+            protected void doCatch(Throwable e) throws Throwable {
+                if (!(e instanceof CancellationException) || !decisionContext.getWorkflowContext().isCancelRequested()) {
+                    throwWorkflowException(dataConverter, e);
+                }
+            }
+
+            @Override
+            protected void doFinally() throws Throwable {
+                Promise r = methodResult.get();
+                if (r == null || r.isReady()) {
+                    Object workflowResult = r == null ? null : r.get();
+                    String convertedResult = dataConverter.toData(workflowResult);
+                    result.set(convertedResult);
+                }
+            }
+        };
+
+        return result;
+    }
+
+    @Override
+    public void signalRecieved(String signalName, String input) throws WorkflowException {
+        Object[] parameters = dataConverter.fromData(input, Object[].class);
+        try {
+            LOGGER.debug("Processing workflow signalRecieved");
+
+            swfWorkflowConsumer.signalRecieved(parameters);
+        } catch (Throwable e) {
+            throwWorkflowException(dataConverter, e);
+            throw new IllegalStateException("Unreacheable");
+        }
+    }
+
+    @Override
+    public String getWorkflowState() throws WorkflowException {
+        try {
+            LOGGER.debug("Processing workflow getWorkflowState");
+
+            Object result = swfWorkflowConsumer.getWorkflowState(null);
+            return dataConverter.toData(result);
+        } catch (Throwable e) {
+            throwWorkflowException(dataConverter, e);
+            throw new IllegalStateException("Unreachable");
+        }
+    }
+
+    private void throwWorkflowException(DataConverter c, Throwable exception) throws WorkflowException {
+        if (exception instanceof WorkflowException) {
+            throw (WorkflowException) exception;
+        }
+        String reason = WorkflowExecutionUtils.truncateReason(exception.getMessage());
+        String details = null;
+        try {
+            details = c.toData(exception);
+        } catch (DataConverterException dataConverterException) {
+            if (dataConverterException.getCause() == null) {
+                dataConverterException.initCause(exception);
+            }
+            throw dataConverterException;
+        }
+
+        throw new WorkflowException(reason, details);
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinitionFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinitionFactory.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinitionFactory.java
new file mode 100644
index 0000000..84fe62f
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinitionFactory.java
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import com.amazonaws.services.simpleworkflow.flow.DecisionContext;
+import com.amazonaws.services.simpleworkflow.flow.JsonDataConverter;
+import com.amazonaws.services.simpleworkflow.flow.WorkflowTypeRegistrationOptions;
+import com.amazonaws.services.simpleworkflow.flow.generic.WorkflowDefinition;
+import com.amazonaws.services.simpleworkflow.flow.generic.WorkflowDefinitionFactory;
+import com.amazonaws.services.simpleworkflow.flow.worker.CurrentDecisionContext;
+import com.amazonaws.services.simpleworkflow.model.WorkflowType;
+
+public class CamelWorkflowDefinitionFactory extends WorkflowDefinitionFactory {
+    private SWFWorkflowConsumer swfWorkflowConsumer;
+    private WorkflowType workflowType;
+    private WorkflowTypeRegistrationOptions registrationOptions;
+
+    public CamelWorkflowDefinitionFactory(SWFWorkflowConsumer swfWorkflowConsumer, WorkflowType workflowType, WorkflowTypeRegistrationOptions registrationOptions) {
+        this.swfWorkflowConsumer = swfWorkflowConsumer;
+        this.workflowType = workflowType;
+        this.registrationOptions = registrationOptions;
+    }
+
+    @Override
+    public WorkflowTypeRegistrationOptions getWorkflowRegistrationOptions() {
+        return registrationOptions;
+    }
+
+    @Override
+    public WorkflowDefinition getWorkflowDefinition(DecisionContext context) throws Exception {
+        CurrentDecisionContext.set(context);
+        return new CamelWorkflowDefinition(swfWorkflowConsumer, context, new JsonDataConverter());
+    }
+
+    @Override
+    public void deleteWorkflowDefinition(WorkflowDefinition instance) {
+        CurrentDecisionContext.unset();
+    }
+
+    @Override
+    public WorkflowType getWorkflowType() {
+        return workflowType;
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinitionFactoryFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinitionFactoryFactory.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinitionFactoryFactory.java
new file mode 100644
index 0000000..d3cdecc
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/CamelWorkflowDefinitionFactoryFactory.java
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import java.util.ArrayList;
+
+import com.amazonaws.services.simpleworkflow.flow.WorkflowTypeRegistrationOptions;
+import com.amazonaws.services.simpleworkflow.flow.generic.WorkflowDefinitionFactory;
+import com.amazonaws.services.simpleworkflow.flow.generic.WorkflowDefinitionFactoryFactory;
+import com.amazonaws.services.simpleworkflow.model.WorkflowType;
+
+public class CamelWorkflowDefinitionFactoryFactory extends WorkflowDefinitionFactoryFactory {
+    private final SWFWorkflowConsumer swfWorkflowConsumer;
+    private final SWFConfiguration configuration;
+
+    public CamelWorkflowDefinitionFactoryFactory(SWFWorkflowConsumer swfWorkflowConsumer, SWFConfiguration configuration) {
+        this.swfWorkflowConsumer = swfWorkflowConsumer;
+        this.configuration = configuration;
+    }
+
+    @Override
+    public WorkflowDefinitionFactory getWorkflowDefinitionFactory(WorkflowType workflowType) {
+        WorkflowTypeRegistrationOptions registrationOptions = configuration.getWorkflowTypeRegistrationOptions() != null
+                ? configuration.getWorkflowTypeRegistrationOptions() : new WorkflowTypeRegistrationOptions();
+
+        return new CamelWorkflowDefinitionFactory(swfWorkflowConsumer, workflowType, registrationOptions);
+    }
+
+    @Override
+    public Iterable<WorkflowType> getWorkflowTypesToRegister() {
+        ArrayList<WorkflowType> workflowTypes = new ArrayList<WorkflowType>(1);
+        WorkflowType workflowType = new WorkflowType();
+        workflowType.setName(configuration.getEventName());
+        workflowType.setVersion(configuration.getVersion());
+        workflowTypes.add(workflowType);
+        return workflowTypes;
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFActivityConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFActivityConsumer.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFActivityConsumer.java
new file mode 100644
index 0000000..0f47606
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFActivityConsumer.java
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import com.amazonaws.services.simpleworkflow.flow.worker.GenericActivityWorker;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.impl.DefaultConsumer;
+import org.apache.camel.util.URISupport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SWFActivityConsumer extends DefaultConsumer {
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(SWFWorkflowProducer.class);
+    private SWFEndpoint endpoint;
+    private final SWFConfiguration configuration;
+    private GenericActivityWorker genericWorker;
+
+    public SWFActivityConsumer(SWFEndpoint endpoint, Processor processor, SWFConfiguration configuration) {
+        super(endpoint, processor);
+        this.endpoint = endpoint;
+        this.configuration = configuration;
+    }
+
+    public Object processActivity(Object[] inputParameters, String taskToken) throws Exception {
+        LOGGER.debug("Processing activity task: " + inputParameters);
+
+        Exchange exchange = endpoint.createExchange(inputParameters, SWFConstants.EXECUTE_ACTION);
+        exchange.getIn().setHeader(SWFConstants.TASK_TOKEN, taskToken);
+
+        getProcessor().process(exchange);
+        return endpoint.getResult(exchange);
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        CamelActivityImplementationFactory factory = new CamelActivityImplementationFactory(this, configuration);
+        genericWorker = new GenericActivityWorker(endpoint.getSWClient(), configuration.getDomainName(), configuration.getActivityList());
+        genericWorker.setActivityImplementationFactory(factory);
+        genericWorker.start();
+        super.doStart();
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        genericWorker.setDisableServiceShutdownOnStop(true);
+        genericWorker.shutdownNow();
+        super.doStop();
+    }
+
+    @Override
+    public String toString() {
+        return "SWFActivityConsumer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFActivityProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFActivityProducer.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFActivityProducer.java
new file mode 100644
index 0000000..7b364ac
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFActivityProducer.java
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.util.URISupport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SWFActivityProducer extends DefaultProducer {
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(SWFActivityProducer.class);
+    private final CamelSWFActivityClient camelSWFClient;
+    private SWFEndpoint endpoint;
+    private SWFConfiguration configuration;
+
+    public SWFActivityProducer(SWFEndpoint endpoint, CamelSWFActivityClient camelSWFActivityClient) {
+        super(endpoint);
+        this.endpoint = endpoint;
+        this.configuration = endpoint.getConfiguration();
+        this.camelSWFClient = camelSWFActivityClient;
+    }
+
+    public void process(Exchange exchange) throws Exception {
+        String eventName = getEventName(exchange);
+        String version = getVersion(exchange);
+        LOGGER.debug("scheduleActivity : " + eventName + " : " + version);
+
+        Object result = camelSWFClient.scheduleActivity(eventName, version, exchange.getIn().getBody());
+        endpoint.setResult(exchange, result);
+    }
+
+    private String getEventName(Exchange exchange) {
+        String eventName = exchange.getIn().getHeader(SWFConstants.EVENT_NAME, String.class);
+        return eventName != null ? eventName : configuration.getEventName();
+    }
+
+    private String getVersion(Exchange exchange) {
+        String version = exchange.getIn().getHeader(SWFConstants.VERSION, String.class);
+        return version != null ? version : configuration.getVersion();
+    }
+
+    @Override
+    public String toString() {
+        return "SWFActivityProducer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFComponent.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFComponent.java
new file mode 100644
index 0000000..538ebd7
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFComponent.java
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import java.util.Map;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.util.IntrospectionSupport;
+
+/**
+ * Defines the <a href="http://aws.amazon.com/swf/">Amazon Simple Workflow Component</a>
+ */
+public class SWFComponent extends DefaultComponent {
+
+    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+        Map<String, Object> clientConfigurationParameters = IntrospectionSupport.extractProperties(parameters, "clientConfiguration.");
+        Map<String, Object> sWClientParameters = IntrospectionSupport.extractProperties(parameters, "sWClient.");
+        Map<String, Object> startWorkflowOptionsParameters = IntrospectionSupport.extractProperties(parameters, "startWorkflowOptions.");
+
+        SWFConfiguration configuration = new SWFConfiguration();
+        configuration.setType(remaining);
+        setProperties(configuration, parameters);
+        configuration.setClientConfigurationParameters(clientConfigurationParameters);
+        configuration.setsWClientParameters(sWClientParameters);
+        configuration.setStartWorkflowOptionsParameters(startWorkflowOptionsParameters);
+
+        return new SWFEndpoint(uri, this, configuration);
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConfiguration.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConfiguration.java
new file mode 100644
index 0000000..5d9513f
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConfiguration.java
@@ -0,0 +1,236 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import java.util.Map;
+
+import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient;
+import com.amazonaws.services.simpleworkflow.flow.ActivitySchedulingOptions;
+import com.amazonaws.services.simpleworkflow.flow.DataConverter;
+import com.amazonaws.services.simpleworkflow.flow.WorkflowTypeRegistrationOptions;
+import com.amazonaws.services.simpleworkflow.flow.worker.ActivityTypeExecutionOptions;
+import com.amazonaws.services.simpleworkflow.flow.worker.ActivityTypeRegistrationOptions;
+
+
+public class SWFConfiguration {
+    private String accessKey;
+    private String secretKey;
+    private AmazonSimpleWorkflowClient amazonSWClient;
+    private Map<String, Object> clientConfigurationParameters;
+    private Map<String, Object> sWClientParameters;
+    private Map<String, Object> startWorkflowOptionsParameters;
+    private String operation;
+    private String domainName;
+    private String activityList;
+    private String workflowList;
+    private String eventName;
+    private String version;
+    private String type;
+    private String signalName;
+    private String childPolicy;
+    private String terminationReason;
+    private String stateResultType;
+    private String terminationDetails;
+    private DataConverter dataConverter;
+    private ActivitySchedulingOptions activitySchedulingOptions;
+    private ActivityTypeExecutionOptions activityTypeExecutionOptions;
+    private ActivityTypeRegistrationOptions activityTypeRegistrationOptions;
+    private WorkflowTypeRegistrationOptions workflowTypeRegistrationOptions;
+
+    public String getAccessKey() {
+        return accessKey;
+    }
+
+    public void setAccessKey(String accessKey) {
+        this.accessKey = accessKey;
+    }
+
+    public String getSecretKey() {
+        return secretKey;
+    }
+
+    public void setSecretKey(String secretKey) {
+        this.secretKey = secretKey;
+    }
+
+    public String getDomainName() {
+        return domainName;
+    }
+
+    public void setDomainName(String domainName) {
+        this.domainName = domainName;
+    }
+
+    public String getActivityList() {
+        return activityList;
+    }
+
+    public void setActivityList(String activityList) {
+        this.activityList = activityList;
+    }
+
+    public String getWorkflowList() {
+        return workflowList;
+    }
+
+    public void setWorkflowList(String workflowList) {
+        this.workflowList = workflowList;
+    }
+
+    public String getEventName() {
+        return eventName;
+    }
+
+    public void setEventName(String eventName) {
+        this.eventName = eventName;
+    }
+
+    public String getVersion() {
+        return version;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Map<String, Object> getClientConfigurationParameters() {
+        return clientConfigurationParameters;
+    }
+
+    public void setClientConfigurationParameters(Map<String, Object> clientConfigurationParameters) {
+        this.clientConfigurationParameters = clientConfigurationParameters;
+    }
+
+    public Map<String, Object> getsWClientParameters() {
+        return sWClientParameters;
+    }
+
+    public void setsWClientParameters(Map<String, Object> sWClientParameters) {
+        this.sWClientParameters = sWClientParameters;
+    }
+
+    public AmazonSimpleWorkflowClient getAmazonSWClient() {
+        return amazonSWClient;
+    }
+
+    public void setAmazonSWClient(AmazonSimpleWorkflowClient amazonSWClient) {
+        this.amazonSWClient = amazonSWClient;
+    }
+    public Map<String, Object> getStartWorkflowOptionsParameters() {
+        return startWorkflowOptionsParameters;
+    }
+
+    public void setStartWorkflowOptionsParameters(Map<String, Object> startWorkflowOptionsParameters) {
+        this.startWorkflowOptionsParameters = startWorkflowOptionsParameters;
+    }
+
+    public String getOperation() {
+        return operation;
+    }
+
+    public void setOperation(String operation) {
+        this.operation = operation;
+    }
+
+    public String getSignalName() {
+        return signalName;
+    }
+
+    public void setSignalName(String signalName) {
+        this.signalName = signalName;
+    }
+
+    public String getChildPolicy() {
+        return childPolicy;
+    }
+
+    public void setChildPolicy(String childPolicy) {
+        this.childPolicy = childPolicy;
+    }
+
+    public String getTerminationReason() {
+        return terminationReason;
+    }
+
+    public void setTerminationReason(String terminationReason) {
+        this.terminationReason = terminationReason;
+    }
+
+    public String getStateResultType() {
+        return stateResultType;
+    }
+
+    public void setStateResultType(String stateResultType) {
+        this.stateResultType = stateResultType;
+    }
+
+    public String getTerminationDetails() {
+        return terminationDetails;
+    }
+
+    public void setTerminationDetails(String terminationDetails) {
+        this.terminationDetails = terminationDetails;
+    }
+
+    public ActivityTypeExecutionOptions getActivityTypeExecutionOptions() {
+        return activityTypeExecutionOptions;
+    }
+
+    public void setActivityTypeExecutionOptions(ActivityTypeExecutionOptions activityTypeExecutionOptions) {
+        this.activityTypeExecutionOptions = activityTypeExecutionOptions;
+    }
+
+    public ActivityTypeRegistrationOptions getActivityTypeRegistrationOptions() {
+        return activityTypeRegistrationOptions;
+    }
+
+    public void setActivityTypeRegistrationOptions(ActivityTypeRegistrationOptions activityTypeRegistrationOptions) {
+        this.activityTypeRegistrationOptions = activityTypeRegistrationOptions;
+    }
+
+    public DataConverter getDataConverter() {
+        return dataConverter;
+    }
+
+    public void setDataConverter(DataConverter dataConverter) {
+        this.dataConverter = dataConverter;
+    }
+
+    public WorkflowTypeRegistrationOptions getWorkflowTypeRegistrationOptions() {
+        return workflowTypeRegistrationOptions;
+    }
+
+    public void setWorkflowTypeRegistrationOptions(WorkflowTypeRegistrationOptions workflowTypeRegistrationOptions) {
+        this.workflowTypeRegistrationOptions = workflowTypeRegistrationOptions;
+    }
+
+    public ActivitySchedulingOptions getActivitySchedulingOptions() {
+        return activitySchedulingOptions;
+    }
+
+    public void setActivitySchedulingOptions(ActivitySchedulingOptions activitySchedulingOptions) {
+        this.activitySchedulingOptions = activitySchedulingOptions;
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConstants.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConstants.java
new file mode 100644
index 0000000..6bb71cb
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConstants.java
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+public interface SWFConstants {
+    String OPERATION = "CamelSWFOperation";
+    String WORKFLOW_ID = "CamelSWFWorkflowId";
+    String RUN_ID = "CamelSWFRunId";
+    String STATE_RESULT_TYPE = "CamelSWFStateResultType";
+    String EVENT_NAME = "CamelSWFEventName";
+    String VERSION = "CamelSWFVersion";
+    String SIGNAL_NAME = "CamelSWFSignalName";
+    String CHILD_POLICY = "CamelSWFChildPolicy";
+    String DETAILS = "CamelSWFDetails";
+    String REASON = "CamelSWFReason";
+    String ACTION = "CamelSWFAction";
+    String EXECUTE_ACTION = "CamelSWFActionExecute";
+    String SIGNAL_RECEIVED_ACTION = "CamelSWFSignalReceivedAction";
+    String GET_STATE_ACTION = "CamelSWFGetStateAction";
+    String TASK_TOKEN = "CamelSWFTaskToken";
+    String WORKFLOW_START_TIME = "CamelSWFWorkflowStartTime";
+    String WORKFLOW_REPLAYING = "CamelSWFWorkflowReplaying";
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFEndpoint.java
new file mode 100644
index 0000000..f50c7bd
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFEndpoint.java
@@ -0,0 +1,141 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import com.amazonaws.ClientConfiguration;
+import com.amazonaws.auth.AWSCredentials;
+import com.amazonaws.auth.BasicAWSCredentials;
+import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient;
+import com.amazonaws.services.simpleworkflow.flow.StartWorkflowOptions;
+import org.apache.camel.Consumer;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePattern;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.util.EndpointHelper;
+import org.apache.camel.util.ExchangeHelper;
+
+/**
+ * Defines the <a href="http://aws.amazon.com/swf/">Amazon Simple Workflow Endpoint</a>
+ */
+public class SWFEndpoint extends DefaultEndpoint {
+    private SWFConfiguration configuration;
+    private AmazonSimpleWorkflowClient amazonSWClient;
+
+    public SWFEndpoint() {
+    }
+
+    public SWFEndpoint(String uri, SWFComponent component, SWFConfiguration configuration) {
+        super(uri, component);
+        this.configuration = configuration;
+    }
+
+    public Producer createProducer() throws Exception {
+        return isWorkflow()
+                ? new SWFWorkflowProducer(this, new CamelSWFWorkflowClient(this, configuration)) : new SWFActivityProducer(this, new CamelSWFActivityClient(configuration));
+    }
+
+    public Consumer createConsumer(Processor processor) throws Exception {
+        return isWorkflow()
+                ? new SWFWorkflowConsumer(this, processor, configuration) : new SWFActivityConsumer(this, processor, configuration);
+    }
+
+    public boolean isSingleton() {
+        return true;
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        if (configuration.getAmazonSWClient() == null) {
+            amazonSWClient = createSWClient();
+        }
+        super.doStart();
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        if (amazonSWClient != null) {
+            amazonSWClient.shutdown();
+            amazonSWClient = null;
+        }
+        super.doStop();
+    }
+
+    public AmazonSimpleWorkflowClient getSWClient() {
+        return configuration.getAmazonSWClient() != null ? configuration.getAmazonSWClient() : amazonSWClient;
+    }
+
+    private AmazonSimpleWorkflowClient createSWClient() throws Exception {
+        AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
+
+        ClientConfiguration clientConfiguration = new ClientConfiguration();
+        if (!configuration.getClientConfigurationParameters().isEmpty()) {
+            setProperties(clientConfiguration, configuration.getClientConfigurationParameters());
+        }
+
+        AmazonSimpleWorkflowClient client = new AmazonSimpleWorkflowClient(credentials, clientConfiguration);
+        if (!configuration.getsWClientParameters().isEmpty()) {
+            setProperties(client, configuration.getsWClientParameters());
+        }
+        return client;
+    }
+
+    public StartWorkflowOptions getStartWorkflowOptions() {
+        StartWorkflowOptions startWorkflowOptions = new StartWorkflowOptions();
+        try {
+            EndpointHelper.setReferenceProperties(getCamelContext(), startWorkflowOptions, configuration.getStartWorkflowOptionsParameters());
+            EndpointHelper.setProperties(getCamelContext(), startWorkflowOptions, configuration.getStartWorkflowOptionsParameters());
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return startWorkflowOptions;
+    }
+
+    private boolean isWorkflow() {
+        return configuration.getType().equalsIgnoreCase("workflow");
+    }
+
+    public Exchange createExchange(Object request, String action) {
+        Exchange exchange = createExchange(ExchangePattern.InOut);
+        exchange.getIn().setBody(request);
+        exchange.getIn().setHeader(SWFConstants.ACTION, action);
+        return exchange;
+    }
+
+    public Object getResult(Exchange exchange) {
+        return ExchangeHelper.isOutCapable(exchange) ? exchange.getOut().getBody() : exchange.getIn().getBody();
+    }
+
+    public void setResult(Exchange exchange, Object result) {
+        if (ExchangeHelper.isOutCapable(exchange)) {
+            exchange.getOut().setBody(result);
+        } else {
+            exchange.getIn().setBody(result);
+        }
+    }
+
+    public void setConfiguration(SWFConfiguration configuration) {
+        this.configuration = configuration;
+    }
+
+    public SWFConfiguration getConfiguration() {
+        return configuration;
+    }
+}
+
+

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFWorkflowConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFWorkflowConsumer.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFWorkflowConsumer.java
new file mode 100644
index 0000000..842917a
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFWorkflowConsumer.java
@@ -0,0 +1,87 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import com.amazonaws.services.simpleworkflow.flow.worker.GenericWorkflowWorker;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.impl.DefaultConsumer;
+import org.apache.camel.util.URISupport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.apache.camel.ExchangePattern.InOnly;
+
+public class SWFWorkflowConsumer extends DefaultConsumer {
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(SWFWorkflowProducer.class);
+    private SWFEndpoint endpoint;
+    private final SWFConfiguration configuration;
+    private GenericWorkflowWorker genericWorker;
+
+    public SWFWorkflowConsumer(SWFEndpoint endpoint, Processor processor, SWFConfiguration configuration) {
+        super(endpoint, processor);
+        this.endpoint = endpoint;
+        this.configuration = configuration;
+    }
+
+    public Object processWorkflow(Object[] parameters, long startTime, boolean replaying) throws Exception {
+        LOGGER.debug("Processing workflow task: " + parameters);
+        Exchange exchange = endpoint.createExchange(parameters, SWFConstants.EXECUTE_ACTION);
+        exchange.getIn().setHeader(SWFConstants.WORKFLOW_START_TIME, startTime);
+        exchange.getIn().setHeader(SWFConstants.WORKFLOW_REPLAYING, replaying);
+
+        getProcessor().process(exchange);
+        return endpoint.getResult(exchange);
+    }
+
+    public void signalRecieved(Object[] parameters) throws Exception {
+        LOGGER.debug("signalRecieved: " + parameters);
+
+        Exchange exchange = endpoint.createExchange(parameters, SWFConstants.SIGNAL_RECEIVED_ACTION);
+        exchange.setPattern(InOnly);
+        getProcessor().process(exchange);
+    }
+
+    public Object getWorkflowState(Object parameters) throws Exception {
+        LOGGER.debug("getWorkflowState: " + parameters);
+
+        Exchange exchange = endpoint.createExchange(parameters, SWFConstants.GET_STATE_ACTION);
+        getProcessor().process(exchange);
+        return endpoint.getResult(exchange);
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        CamelWorkflowDefinitionFactoryFactory factoryFactory = new CamelWorkflowDefinitionFactoryFactory(this, configuration);
+        genericWorker = new GenericWorkflowWorker(endpoint.getSWClient(), configuration.getDomainName(), configuration.getWorkflowList());
+        genericWorker.setWorkflowDefinitionFactoryFactory(factoryFactory);
+        genericWorker.start();
+        super.doStart();
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        genericWorker.setDisableServiceShutdownOnStop(true);
+        genericWorker.shutdownNow();
+        super.doStop();
+    }
+
+    @Override
+    public String toString() {
+        return "SWFWorkflowConsumer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFWorkflowProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFWorkflowProducer.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFWorkflowProducer.java
new file mode 100644
index 0000000..aa6913b
--- /dev/null
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFWorkflowProducer.java
@@ -0,0 +1,170 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import java.util.Map;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.util.ExchangeHelper;
+import org.apache.camel.util.URISupport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class SWFWorkflowProducer extends DefaultProducer {
+    private static final transient Logger LOGGER = LoggerFactory.getLogger(SWFWorkflowProducer.class);
+    private final CamelSWFWorkflowClient camelSWFClient;
+    private SWFEndpoint endpoint;
+    private SWFConfiguration configuration;
+
+    public SWFWorkflowProducer(SWFEndpoint endpoint, CamelSWFWorkflowClient camelSWFClient) {
+        super(endpoint);
+        this.endpoint = endpoint;
+        this.configuration = endpoint.getConfiguration();
+        this.camelSWFClient = camelSWFClient;
+    }
+
+    public void process(Exchange exchange) throws Exception {
+        LOGGER.debug("processing workflow task " + exchange);
+
+        try {
+
+            Operation operation = getOperation(exchange);
+            switch (operation) {
+
+            case CANCEL:
+                camelSWFClient.requestCancelWorkflowExecution(getWorkflowId(exchange), getRunId(exchange));
+                break;
+
+            case GET_STATE:
+                Object state = camelSWFClient.getWorkflowExecutionState(getWorkflowId(exchange), getRunId(exchange), getResultType(exchange));
+                endpoint.setResult(exchange, state);
+                break;
+
+            case DESCRIBE:
+                Map<String, Object> workflowInfo = camelSWFClient.describeWorkflowInstance(getWorkflowId(exchange), getRunId(exchange));
+                endpoint.setResult(exchange, workflowInfo);
+                break;
+
+            case GET_HISTORY:
+                Object history = camelSWFClient.getWorkflowExecutionHistory(getWorkflowId(exchange), getRunId(exchange));
+                endpoint.setResult(exchange, history);
+                break;
+
+            case START:
+                String[] ids = camelSWFClient.startWorkflowExecution(getWorkflowId(exchange), getRunId(exchange),
+                        getEventName(exchange), getVersion(exchange), getArguments(exchange));
+                setHeader(exchange, SWFConstants.WORKFLOW_ID, ids[0]);
+                setHeader(exchange, SWFConstants.RUN_ID, ids[1]);
+                break;
+
+            case SIGNAL:
+                camelSWFClient.signalWorkflowExecution(getWorkflowId(exchange), getRunId(exchange), getSignalName(exchange), getArguments(exchange));
+                break;
+
+            case TERMINATE:
+                camelSWFClient.terminateWorkflowExecution(getWorkflowId(exchange), getRunId(exchange), getReason(exchange), getDetails(exchange), getChildPolicy(exchange));
+                break;
+
+            default:
+                throw new UnsupportedOperationException(operation.toString());
+            }
+
+        } catch (Throwable throwable) {
+            throw new Exception(throwable);
+        }
+    }
+
+    private String getEventName(Exchange exchange) {
+        String eventName = exchange.getIn().getHeader(SWFConstants.EVENT_NAME, String.class);
+        return eventName != null ? eventName : configuration.getEventName();
+    }
+
+    private String getVersion(Exchange exchange) {
+        String version = exchange.getIn().getHeader(SWFConstants.VERSION, String.class);
+        return version != null ? version : configuration.getVersion();
+    }
+
+    private String getSignalName(Exchange exchange) {
+        String signalName = exchange.getIn().getHeader(SWFConstants.SIGNAL_NAME, String.class);
+        return signalName != null ? signalName : configuration.getSignalName();
+    }
+
+    private String getChildPolicy(Exchange exchange) {
+        String childPolicy = exchange.getIn().getHeader(SWFConstants.CHILD_POLICY, String.class);
+        return childPolicy != null ? childPolicy : configuration.getChildPolicy();
+    }
+
+    private String getDetails(Exchange exchange) {
+        String details = exchange.getIn().getHeader(SWFConstants.DETAILS, String.class);
+        return details != null ? details : configuration.getTerminationDetails();
+    }
+
+    private String getReason(Exchange exchange) {
+        String reason = exchange.getIn().getHeader(SWFConstants.REASON, String.class);
+        return reason != null ? reason : configuration.getTerminationReason();
+    }
+
+    private String getWorkflowId(Exchange exchange) {
+        return exchange.getIn().getHeader(SWFConstants.WORKFLOW_ID, String.class);
+    }
+
+    private String getRunId(Exchange exchange) {
+        return exchange.getIn().getHeader(SWFConstants.RUN_ID, String.class);
+    }
+
+    private Class getResultType(Exchange exchange) throws ClassNotFoundException {
+        String type = exchange.getIn().getHeader(SWFConstants.STATE_RESULT_TYPE, String.class);
+        if (type == null) {
+            type = configuration.getStateResultType();
+        }
+
+        return type != null ? Class.forName(type) : Object.class;
+    }
+
+    private Operation getOperation(Exchange exchange) {
+        String operation = exchange.getIn().getHeader(SWFConstants.OPERATION, String.class);
+        if (operation == null) {
+            operation = configuration.getOperation();
+        }
+
+        return operation != null ? Operation.valueOf(operation) : Operation.START;
+    }
+
+    private void setHeader(Exchange exchange, String key, Object value) {
+        if (ExchangeHelper.isOutCapable(exchange)) {
+            exchange.getOut().setHeader(key, value);
+        } else {
+            exchange.getIn().setHeader(key, value);
+        }
+    }
+
+    private Object getArguments(Exchange exchange) {
+        return exchange.getIn().getBody();
+    }
+
+
+    @Override
+    public String toString() {
+        return "SWFWorkflowProducer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+    }
+
+    private enum Operation {
+        SIGNAL, CANCEL, TERMINATE, GET_STATE, START, DESCRIBE, GET_HISTORY;
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/main/resources/META-INF/services/org/apache/camel/component/aws-swf
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/resources/META-INF/services/org/apache/camel/component/aws-swf b/components/camel-aws/src/main/resources/META-INF/services/org/apache/camel/component/aws-swf
new file mode 100644
index 0000000..5e33c5b
--- /dev/null
+++ b/components/camel-aws/src/main/resources/META-INF/services/org/apache/camel/component/aws-swf
@@ -0,0 +1 @@
+class=org.apache.camel.component.aws.swf.SWFComponent

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/AmazonSWFClientMock.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/AmazonSWFClientMock.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/AmazonSWFClientMock.java
new file mode 100644
index 0000000..172adcf
--- /dev/null
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/AmazonSWFClientMock.java
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.aws.swf;
+
+import com.amazonaws.AmazonClientException;
+import com.amazonaws.AmazonServiceException;
+import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient;
+import com.amazonaws.services.simpleworkflow.model.Run;
+import com.amazonaws.services.simpleworkflow.model.StartWorkflowExecutionRequest;
+
+public class AmazonSWFClientMock extends AmazonSimpleWorkflowClient {
+
+    @Override
+    public Run startWorkflowExecution(StartWorkflowExecutionRequest startWorkflowExecutionRequest) throws AmazonServiceException, AmazonClientException {
+        return new Run().withRunId("run1");
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFActivityClientTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFActivityClientTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFActivityClientTest.java
new file mode 100644
index 0000000..c7883cc
--- /dev/null
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFActivityClientTest.java
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import com.amazonaws.services.simpleworkflow.flow.ActivitySchedulingOptions;
+import com.amazonaws.services.simpleworkflow.flow.DynamicActivitiesClient;
+import com.amazonaws.services.simpleworkflow.flow.core.Promise;
+import com.amazonaws.services.simpleworkflow.model.ActivityType;
+import org.junit.Before;
+import org.junit.Test;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.isNull;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+public class CamelSWFActivityClientTest {
+
+    private DynamicActivitiesClient activitiesClient;
+    private CamelSWFActivityClient camelSWFActivityClient;
+
+    @Before
+    public void setUp() throws Exception {
+        activitiesClient = mock(DynamicActivitiesClient.class);
+        camelSWFActivityClient = new CamelSWFActivityClient(new SWFConfiguration()) {
+            @Override
+            DynamicActivitiesClient getDynamicActivitiesClient() {
+                return activitiesClient;
+            }
+        };
+    }
+
+    @Test
+    public void testScheduleActivity() throws Exception {
+        Object result = camelSWFActivityClient.scheduleActivity("eventName", "version", "input");
+        verify(activitiesClient).scheduleActivity(any(ActivityType.class),  any(Promise[].class), isNull(ActivitySchedulingOptions.class), any(Class.class), isNull(Promise.class));
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFActivityConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFActivityConsumerTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFActivityConsumerTest.java
new file mode 100644
index 0000000..33e8a47
--- /dev/null
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFActivityConsumerTest.java
@@ -0,0 +1,68 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import com.amazonaws.services.simpleworkflow.model.ActivityTask;
+import com.amazonaws.services.simpleworkflow.model.PollForActivityTaskRequest;
+import org.apache.camel.Exchange;
+import org.apache.camel.Predicate;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class CamelSWFActivityConsumerTest extends CamelSWFTestSupport {
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+
+            public void configure() throws Exception {
+                from("aws-swf://activity?" + options)
+                        .to("mock:result");
+            }
+        };
+    }
+
+    @Override
+    public boolean isUseAdviceWith() {
+        return true;
+    }
+
+    @Test
+    public void receivesDecisionTask() throws Exception {
+        result.expectedMinimumMessageCount(1);
+        result.expectedMessagesMatches(new Predicate() {
+            public boolean matches(Exchange exchange) {
+                return exchange.getIn().getHeader(SWFConstants.ACTION).equals(SWFConstants.EXECUTE_ACTION)
+                        && exchange.getIn().getBody(Object[].class)[0].equals("test");
+            }
+        });
+
+        ActivityTask activityTask = new ActivityTask();
+        activityTask.setTaskToken("token");
+        activityTask.setInput("[\"[Ljava.lang.Object;\",[\"test\"]]");
+        when(amazonSWClient.pollForActivityTask(any(PollForActivityTaskRequest.class))).thenReturn(activityTask);
+
+        context.start();
+
+        assertMockEndpointsSatisfied();
+        verify(amazonSWClient, atLeastOnce()).pollForActivityTask(any(PollForActivityTaskRequest.class));
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1c1d3a88/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFTestSupport.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFTestSupport.java
new file mode 100644
index 0000000..f7ad1c0
--- /dev/null
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/swf/CamelSWFTestSupport.java
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws.swf;
+
+import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.impl.JndiRegistry;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import static org.mockito.Mockito.mock;
+
+public class CamelSWFTestSupport extends CamelTestSupport {
+
+    protected String options =
+            "accessKey=key"
+                    + "&secretKey=secret"
+                    + "&domainName=testDomain"
+                    + "&activityList=swf-alist"
+                    + "&workflowList=swf-wlist"
+                    + "&version=1.0"
+                    + "&eventName=testEvent"
+                    + "&amazonSWClient=#amazonSWClient";
+
+    @EndpointInject(uri = "direct:start")
+    protected ProducerTemplate template;
+    
+    @EndpointInject(uri = "mock:result")
+    protected MockEndpoint result;
+
+    protected AmazonSimpleWorkflowClient amazonSWClient;
+
+    @Override
+    protected JndiRegistry createRegistry() throws Exception {
+        JndiRegistry registry = super.createRegistry();
+        amazonSWClient = mock(AmazonSimpleWorkflowClient.class);
+        registry.bind("amazonSWClient", amazonSWClient);
+        return registry;
+    }
+}
\ No newline at end of file


[17/50] [abbrv] git commit: Polished as per made suggestions on CAMEL-7023 which applies for the camel-guice-plugin as well.

Posted by ni...@apache.org.
Polished as per made suggestions on CAMEL-7023 which applies for the camel-guice-plugin as well.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/708a3cb6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/708a3cb6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/708a3cb6

Branch: refs/heads/camel-gora
Commit: 708a3cb6247fd3a30c7dd6ab7602ec84e0f2a0b6
Parents: fa48ad8
Author: Babak Vahdat <bv...@apache.org>
Authored: Mon Dec 2 20:29:33 2013 +0100
Committer: Babak Vahdat <bv...@apache.org>
Committed: Mon Dec 2 20:29:33 2013 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/guice/Main.java           | 4 ++--
 .../src/main/java/org/apache/camel/guice/maven/RunMojo.java  | 8 ++------
 2 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/708a3cb6/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java b/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
index 4a200d4..76af353 100644
--- a/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
+++ b/components/camel-guice/src/main/java/org/apache/camel/guice/Main.java
@@ -37,6 +37,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.guice.inject.Injectors;
 import org.apache.camel.main.MainSupport;
+import org.apache.camel.model.Constants;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.view.ModelFileGenerator;
 
@@ -164,7 +165,6 @@ public class Main extends MainSupport {
     }
 
     protected ModelFileGenerator createModelFileGenerator() throws JAXBException {
-        return new ModelFileGenerator(
-            JAXBContext.newInstance("org.apache.camel.model:org.apache.camel.model.config:org.apache.camel.model.dataformat:org.apache.camel.model.language:org.apache.camel.model.loadbalancer"));
+        return new ModelFileGenerator(JAXBContext.newInstance(Constants.JAXB_CONTEXT_PACKAGES));
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/708a3cb6/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
index b96cf4b..82e60b7 100644
--- a/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
+++ b/tooling/maven/guice-maven-plugin/src/main/java/org/apache/camel/guice/maven/RunMojo.java
@@ -367,12 +367,8 @@ public class RunMojo extends AbstractExecMojo {
             public void run() {
                 try {
                     Method main = Thread.currentThread().getContextClassLoader().loadClass(mainClass)
-                        .getMethod("main", new Class[] {String[].class});
-                    if (!main.isAccessible()) {
-                        getLog().debug("Setting accessibility to true in order to invoke main().");
-                        main.setAccessible(true);
-                    }
-                    main.invoke(main, new Object[] {arguments});
+                                        .getMethod("main", String[].class);
+                    main.invoke(null, new Object[] {arguments});
                 } catch (Exception e) { // just pass it on
                     Thread.currentThread().getThreadGroup().uncaughtException(Thread.currentThread(), e);
                 }


[15/50] [abbrv] git commit: CAMEL-7027 Added an unit test for SpringZipSplitterRouteTest

Posted by ni...@apache.org.
CAMEL-7027 Added an unit test for SpringZipSplitterRouteTest


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3ad2ccbd
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3ad2ccbd
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3ad2ccbd

Branch: refs/heads/camel-gora
Commit: 3ad2ccbdd4b34eb8ec4b9804c413450754fbe8d9
Parents: 102843f
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Dec 2 17:49:50 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Dec 2 17:51:33 2013 +0800

----------------------------------------------------------------------
 components/camel-zipfile/pom.xml                |  10 +++++
 .../zipfile/SpringZipSplitterRouteTest.java     |  39 +++++++++++++++++
 .../ZipFileMultipleFilesSplitterTest.java       |   2 +-
 .../zipfile/ZipSplitterRouteTest.java           |   2 +-
 .../zipfile/SpringZipSplitterRouteTest.xml      |  43 +++++++++++++++++++
 .../camel/dataformat/zipfile/data/resources.zip | Bin 0 -> 306 bytes
 .../camel/dataformat/zipfile/resources.zip      | Bin 306 -> 0 bytes
 7 files changed, 94 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3ad2ccbd/components/camel-zipfile/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-zipfile/pom.xml b/components/camel-zipfile/pom.xml
index f9a20db..008e7ca 100644
--- a/components/camel-zipfile/pom.xml
+++ b/components/camel-zipfile/pom.xml
@@ -47,6 +47,16 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-spring</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-test-spring</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
       <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/camel/blob/3ad2ccbd/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/SpringZipSplitterRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/SpringZipSplitterRouteTest.java b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/SpringZipSplitterRouteTest.java
new file mode 100644
index 0000000..cd7189c
--- /dev/null
+++ b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/SpringZipSplitterRouteTest.java
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dataformat.zipfile;
+
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.spring.CamelSpringTestSupport;
+import org.junit.Test;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class SpringZipSplitterRouteTest extends CamelSpringTestSupport {
+    
+    @Test
+    public void testSplitter() throws InterruptedException {
+        MockEndpoint processZipEntry = getMockEndpoint("mock:processZipEntry");
+        processZipEntry.expectedBodiesReceivedInAnyOrder("chau", "hi", "hola");
+        assertMockEndpointsSatisfied();
+    }
+    
+    @Override
+    protected ClassPathXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/dataformat/zipfile/SpringZipSplitterRouteTest.xml");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/3ad2ccbd/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipFileMultipleFilesSplitterTest.java
----------------------------------------------------------------------
diff --git a/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipFileMultipleFilesSplitterTest.java b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipFileMultipleFilesSplitterTest.java
index 54b5e54..9490e94 100644
--- a/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipFileMultipleFilesSplitterTest.java
+++ b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipFileMultipleFilesSplitterTest.java
@@ -44,7 +44,7 @@ public class ZipFileMultipleFilesSplitterTest extends ZipSplitterRouteTest {
                 // Unzip file and Split it according to FileEntry
                 ZipFileDataFormat zipFile = new ZipFileDataFormat();
                 zipFile.setUsingIterator(true);
-                from("file:src/test/resources/org/apache/camel/dataformat/zipfile/?consumer.delay=1000&noop=true")
+                from("file:src/test/resources/org/apache/camel/dataformat/zipfile/data/?consumer.delay=1000&noop=true")
                         .unmarshal(zipFile)
                         .split(body(Iterator.class))
                         .streaming()

http://git-wip-us.apache.org/repos/asf/camel/blob/3ad2ccbd/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteTest.java
----------------------------------------------------------------------
diff --git a/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteTest.java b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteTest.java
index d94e0c7..64d5ef8 100644
--- a/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteTest.java
+++ b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteTest.java
@@ -36,7 +36,7 @@ public class ZipSplitterRouteTest extends CamelTestSupport {
             @Override
             public void configure() throws Exception {
                 // Unzip file and Split it according to FileEntry
-                from("file:src/test/resources/org/apache/camel/dataformat/zipfile?consumer.delay=1000&noop=true")
+                from("file:src/test/resources/org/apache/camel/dataformat/zipfile/data?consumer.delay=1000&noop=true")
                     .log("Start processing big file: ${header.CamelFileName}")
                     .split(new ZipSplitter()).streaming()
                         .to("log:entry")

http://git-wip-us.apache.org/repos/asf/camel/blob/3ad2ccbd/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/SpringZipSplitterRouteTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/SpringZipSplitterRouteTest.xml b/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/SpringZipSplitterRouteTest.xml
new file mode 100644
index 0000000..fae435e
--- /dev/null
+++ b/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/SpringZipSplitterRouteTest.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+  <!-- START SNIPPET: e1 -->
+
+  <!-- use a bean to define a custom expression -->
+  <bean id="zipSplitter" class="org.apache.camel.dataformat.zipfile.ZipSplitter"/>
+
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <route>
+      <from uri="file:src/test/resources/org/apache/camel/dataformat/zipfile/data?consumer.delay=1000&amp;noop=true"/>
+      <split streaming="true">
+        <!-- refer to our custom expression, using ref tag -->
+        <ref>zipSplitter</ref>
+        <convertBodyTo type="java.lang.String" charset="UTF-8"/>
+        <to uri="mock:processZipEntry"/>
+      </split>
+    </route>
+  </camelContext>
+  <!-- END SNIPPET: e1 -->
+
+</beans>

http://git-wip-us.apache.org/repos/asf/camel/blob/3ad2ccbd/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/data/resources.zip
----------------------------------------------------------------------
diff --git a/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/data/resources.zip b/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/data/resources.zip
new file mode 100644
index 0000000..7ab9690
Binary files /dev/null and b/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/data/resources.zip differ

http://git-wip-us.apache.org/repos/asf/camel/blob/3ad2ccbd/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/resources.zip
----------------------------------------------------------------------
diff --git a/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/resources.zip b/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/resources.zip
deleted file mode 100644
index 7ab9690..0000000
Binary files a/components/camel-zipfile/src/test/resources/org/apache/camel/dataformat/zipfile/resources.zip and /dev/null differ


[50/50] [abbrv] git commit: CAMEL-4817 move the version properties into parent/pom.xml

Posted by ni...@apache.org.
CAMEL-4817 move the version properties into parent/pom.xml


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c88e547c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c88e547c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c88e547c

Branch: refs/heads/camel-gora
Commit: c88e547ccd0175705618671fbc604ab70e903c6f
Parents: 4e7783b
Author: Willem Jiang <wi...@gmail.com>
Authored: Tue Nov 19 16:17:46 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Dec 9 10:07:08 2013 +0800

----------------------------------------------------------------------
 components/camel-gora/pom.xml | 56 +++++++++++++++-----------------------
 parent/pom.xml                |  3 ++
 2 files changed, 25 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c88e547c/components/camel-gora/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-gora/pom.xml b/components/camel-gora/pom.xml
index e05920e..d808643 100644
--- a/components/camel-gora/pom.xml
+++ b/components/camel-gora/pom.xml
@@ -46,24 +46,6 @@
         <camel.osgi.export.pkg>org.apache.camel.component.gora.*</camel.osgi.export.pkg>
         <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=gora</camel.osgi.export.service>
 
-        <!--
-            Libraries versions
-        -->
-
-        <!-- apache gora -->
-        <apache-gora.version>0.4-SNAPSHOT</apache-gora.version>
-
-        <mockito.version>1.9.0</mockito.version>
-        <powermock.version>1.4.11</powermock.version>
-
-        <hadoop.version>1.1.1_1</hadoop.version>
-        <avro.version>1.6.1_1</avro.version>
-        <jackson.version>1.6.9</jackson.version>
-
-        <jdom.version>1.1.2_1</jdom.version>
-        <guava.version>11.0.2_2</guava.version>
-        <commons-beanutils.version>1.8.3</commons-beanutils.version>
-
     </properties>
     
     <build>
@@ -99,25 +81,25 @@
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-all</artifactId>
-            <version>${mockito.version}</version>
+            <version>${mockito-version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.powermock</groupId>
             <artifactId>powermock-core</artifactId>
-            <version>${powermock.version}</version>
+            <version>${powermock-version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.powermock</groupId>
             <artifactId>powermock-module-junit4</artifactId>
-            <version>${powermock.version}</version>
+            <version>${powermock-version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.powermock</groupId>
             <artifactId>powermock-api-mockito</artifactId>
-            <version>${powermock.version}</version>
+            <version>${powermock-version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -141,21 +123,27 @@
         <dependency>
             <groupId>org.apache.gora</groupId>
             <artifactId>gora-core</artifactId>
-            <version>${apache-gora.version}</version>
+            <version>${apache-gora-version}</version>
         </dependency>
 
         <!-- hadoop -->
         <dependency>
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.hadoop-core</artifactId>
-            <version>${hadoop.version}</version>
+            <version>${hadoop-bundle-version}</version>
+            <exclusions>
+               <exclusion>
+                  <groupId>commons-beanutils</groupId>
+                  <artifactId>commons-beanutils-core</artifactId>
+               </exclusion>
+            </exclusions>
         </dependency>
 
         <!-- Avro  -->
         <dependency>
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.avro</artifactId>
-            <version>${avro.version}</version>
+            <version>${avro-bundle-version}</version>
         </dependency>
 
         <!-- other -->
@@ -163,27 +151,27 @@
         <dependency>
             <groupId>org.codehaus.jackson</groupId>
             <artifactId>jackson-core-asl</artifactId>
-            <version>${jackson.version}</version>
+            <version>${jackson-version}</version>
         </dependency>
         <dependency>
             <groupId>org.codehaus.jackson</groupId>
             <artifactId>jackson-mapper-asl</artifactId>
-            <version>${jackson.version}</version>
+            <version>${jackson-version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.jdom</artifactId>
-            <version>${jdom.version}</version>
+            <version>${jdom-bundle-version}</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.guava</artifactId>
-            <version>${guava.version}</version>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>${google-guava-version}</version>
         </dependency>
         <dependency>
-            <groupId>commons-beanutils</groupId>
-            <artifactId>commons-beanutils</artifactId>
-            <version>${commons-beanutils.version}</version>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.commons-beanutils</artifactId>
+            <version>${commons-beanutils-bundle-version}</version>
         </dependency>
     </dependencies>
 

http://git-wip-us.apache.org/repos/asf/camel/blob/c88e547c/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 02c7d60..4f21389 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -43,6 +43,7 @@
     <antlr-runtime-bundle-version>3.4_2</antlr-runtime-bundle-version>
     <aopalliance-bundle-version>1.0_6</aopalliance-bundle-version>
     <apacheds-version>1.5.7</apacheds-version>
+    <apache-gora-version>0.4-SNAPSHOT</apache-gora-version>
     <apache-mime4j-version>0.7.2</apache-mime4j-version>
     <aries-blueprint-api-version>1.0.0</aries-blueprint-api-version>
     <aries-blueprint-core-version>1.1.0</aries-blueprint-core-version>
@@ -79,6 +80,7 @@
     <cometd-java-server-bundle-version>2.3.1_2</cometd-java-server-bundle-version>
     <cometd-java-server>2.3.1</cometd-java-server>
     <commons-beanutils-bundle-version>1.8.3_1</commons-beanutils-bundle-version>
+    <commons-beanutils-version>1.8.3</commons-beanutils-version>
     <commons-codec-version>1.8</commons-codec-version>
     <commons-collections-version>3.2.1</commons-collections-version>
     <commons-compress-version>1.5</commons-compress-version>
@@ -329,6 +331,7 @@
     <plexus-container-default-version>1.0-alpha-48</plexus-container-default-version>
     <plexus-utils-version>1.5.6</plexus-utils-version>
     <pojosr-version>0.2.1</pojosr-version>
+    <powermock-version>1.5.1</powermock-version>
     <protobuf-java-bundle-version>2.3.0_3</protobuf-java-bundle-version>
     <protobuf-version>2.3.0</protobuf-version>
     <qpid-bundle-version>0.22_1</qpid-bundle-version>


[27/50] [abbrv] git commit: CAMEL-7034: Ensure quartz scheduler instance name is unique in JVMs and assigned ththe same way when using Camels quartz component.

Posted by ni...@apache.org.
CAMEL-7034: Ensure quartz scheduler instance name is unique in JVMs and assigned ththe same way when using Camels quartz component.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b26df9f0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b26df9f0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b26df9f0

Branch: refs/heads/camel-gora
Commit: b26df9f012568fe1d6997e06d05c78570db21a3e
Parents: 126c312
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Dec 3 11:55:21 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Dec 3 11:55:21 2013 +0100

----------------------------------------------------------------------
 .../camel/component/quartz/QuartzComponent.java | 28 ++++++++++++++------
 .../component/quartz2/QuartzComponent.java      | 28 ++++++++++++++------
 2 files changed, 40 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b26df9f0/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
index acfafbb..f852115 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
@@ -449,6 +449,10 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             // force disabling update checker (will do online check over the internet)
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
 
+            // camel context name will be a suffix to use one scheduler per context
+            String instName = createInstanceName(prop);
+            prop.setProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME, instName);
+
             // enable jmx unless configured to not do so
             if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
                 LOG.info("Setting org.quartz.scheduler.jmx.export=true to ensure QuartzScheduler(s) will be enlisted in JMX.");
@@ -474,14 +478,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             }
 
             // camel context name will be a suffix to use one scheduler per context
-            String identity = getCamelContext().getName();
-
-            String instName = prop.getProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME);
-            if (instName == null) {
-                instName = "scheduler-" + identity;
-            } else {
-                instName = instName + "-" + identity;
-            }
+            String instName = createInstanceName(prop);
             prop.setProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME, instName);
 
             // force disabling update checker (will do online check over the internet)
@@ -503,6 +500,21 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
         return answer;
     }
 
+    protected String createInstanceName(Properties prop) {
+        String instName = prop.getProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME);
+
+        // camel context name will be a suffix to use one scheduler per context
+        String identity = getCamelContext().getManagementName();
+        if (identity != null) {
+            if (instName == null) {
+                instName = "scheduler-" + identity;
+            } else {
+                instName = instName + "-" + identity;
+            }
+        }
+        return instName;
+    }
+
     protected Scheduler createScheduler() throws SchedulerException {
         Scheduler scheduler = getFactory().getScheduler();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/b26df9f0/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
index 5d5c308..cfaf801 100644
--- a/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
+++ b/components/camel-quartz2/src/main/java/org/apache/camel/component/quartz2/QuartzComponent.java
@@ -129,6 +129,10 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             prop.put("org.quartz.scheduler.skipUpdateCheck", "true");
             prop.put("org.terracotta.quartz.skipUpdateCheck", "true");
 
+            // camel context name will be a suffix to use one scheduler per context
+            String instName = createInstanceName(prop);
+            prop.setProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME, instName);
+
             // enable jmx unless configured to not do so
             if (enableJmx && !prop.containsKey("org.quartz.scheduler.jmx.export")) {
                 prop.put("org.quartz.scheduler.jmx.export", "true");
@@ -154,14 +158,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             }
 
             // camel context name will be a suffix to use one scheduler per context
-            String identity = getCamelContext().getManagementName();
-
-            String instName = prop.getProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME);
-            if (instName == null) {
-                instName = "scheduler-" + identity;
-            } else {
-                instName = instName + "-" + identity;
-            }
+            String instName = createInstanceName(prop);
             prop.setProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME, instName);
 
             // force disabling update checker (will do online check over the internet)
@@ -184,6 +181,21 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
         return answer;
     }
 
+    protected String createInstanceName(Properties prop) {
+        String instName = prop.getProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_NAME);
+
+        // camel context name will be a suffix to use one scheduler per context
+        String identity = getCamelContext().getManagementName();
+        if (identity != null) {
+            if (instName == null) {
+                instName = "scheduler-" + identity;
+            } else {
+                instName = instName + "-" + identity;
+            }
+        }
+        return instName;
+    }
+
     /**
      * Is the quartz scheduler clustered?
      */