camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/3] camel git commit: CAMEL-8639: Ensure FTP uses the FTP poll strategy by default. Thanks to Rob Sessink for the patch.
Date Sat, 18 Jul 2015 07:36:12 GMT
CAMEL-8639: Ensure FTP uses the FTP poll strategy by default. Thanks to Rob Sessink for the
patch.


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

Branch: refs/heads/camel-2.14.x
Commit: 560044167b6605abcd439716a58da5dd23759f4e
Parents: 13831f6
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sat Jul 18 09:41:02 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sat Jul 18 09:42:55 2015 +0200

----------------------------------------------------------------------
 .../file/remote/RemoteFileEndpoint.java         |  6 ++++
 ...moteFilePollingConsumerPollStrategyTest.java | 30 ++++++++++++++++++++
 2 files changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/56004416/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
index 97a310d..e327292 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
@@ -50,6 +50,9 @@ public abstract class RemoteFileEndpoint<T> extends GenericFileEndpoint<T>
{
         // for ftp we need to use higher interval/checkout that for files
         setReadLockTimeout(20000);
         setReadLockCheckInterval(5000);
+        // explicitly set RemoteFilePollingConsumerPollStrategy otherwise
+        // DefaultPollingConsumerPollStrategy is be used
+        setPollStrategy(new RemoteFilePollingConsumerPollStrategy());
     }
 
     public RemoteFileEndpoint(String uri, RemoteFileComponent<T> component, RemoteFileConfiguration
configuration) {
@@ -58,6 +61,9 @@ public abstract class RemoteFileEndpoint<T> extends GenericFileEndpoint<T>
{
         // for ftp we need to use higher interval/checkout that for files
         setReadLockTimeout(20000);
         setReadLockCheckInterval(5000);
+        // explicitly set RemoteFilePollingConsumerPollStrategy otherwise
+        // DefaultPollingConsumerPollStrategy is be used
+        setPollStrategy(new RemoteFilePollingConsumerPollStrategy());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/56004416/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/RemoteEndPointRemoteFilePollingConsumerPollStrategyTest.java
----------------------------------------------------------------------
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/RemoteEndPointRemoteFilePollingConsumerPollStrategyTest.java
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/RemoteEndPointRemoteFilePollingConsumerPollStrategyTest.java
new file mode 100644
index 0000000..1d05b97
--- /dev/null
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/RemoteEndPointRemoteFilePollingConsumerPollStrategyTest.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.component.file.remote;
+
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class RemoteEndPointRemoteFilePollingConsumerPollStrategyTest extends CamelTestSupport
{
+
+    @Test
+    public void testPollStrategy() throws Exception {
+        RemoteFileEndpoint<?> endpoint = context.getEndpoint("ftp://hostname", RemoteFileEndpoint.class);
+        assertTrue(endpoint.getPollStrategy() instanceof RemoteFilePollingConsumerPollStrategy);
+    }
+
+}


Mime
View raw message