You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/05/21 08:11:04 UTC

[camel] 03/04: CAMEL-13400: Fixed CS

This is an automated email from the ASF dual-hosted git repository.

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

commit 38fe2eca5fcda573d30ca1cb8478a019edf11bc5
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue May 21 09:56:12 2019 +0200

    CAMEL-13400: Fixed CS
---
 .../FromFtpRecursiveNotStepwiseNoBasePath.java     | 68 ++++++++++----------
 .../FromSftpRecursiveNotStepwiseNoBasePath.java    | 74 +++++++++++-----------
 .../file/remote/sftp/SftpServerTestSupport.java    |  4 +-
 3 files changed, 73 insertions(+), 73 deletions(-)

diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRecursiveNotStepwiseNoBasePath.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRecursiveNotStepwiseNoBasePath.java
index 6112d17..c0ae0be 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRecursiveNotStepwiseNoBasePath.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpRecursiveNotStepwiseNoBasePath.java
@@ -23,42 +23,42 @@ import org.junit.Test;
 
 public class FromFtpRecursiveNotStepwiseNoBasePath extends FtpServerTestSupport {
 
-  protected String getFtpUrl() {
-    return "ftp://admin@localhost:" + getPort() + "?password=admin&initialDelay=3000&stepwise=false"
-        + "&recursive=true";
-  }
+    protected String getFtpUrl() {
+        return "ftp://admin@localhost:" + getPort() + "?password=admin&initialDelay=3000&stepwise=false"
+                + "&recursive=true";
+    }
 
-  @Override
-  @Before
-  public void setUp() throws Exception {
-    super.setUp();
-    prepareFtpServer();
-  }
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+        prepareFtpServer();
+    }
 
-  @Test
-  public void testRecursiveNotStepwiseNoBasePath() throws Exception {
-    //CAMEL-13400
-    MockEndpoint mock = getMockEndpoint("mock:result");
-    mock.expectedBodiesReceivedInAnyOrder("Bye World", "Hello World", "Goodday World");
-    assertMockEndpointsSatisfied();
-  }
+    @Test
+    public void testRecursiveNotStepwiseNoBasePath() throws Exception {
+        //CAMEL-13400
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedBodiesReceivedInAnyOrder("Bye World", "Hello World", "Goodday World");
+        assertMockEndpointsSatisfied();
+    }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from(getFtpUrl())
-            .convertBodyTo(String.class)
-            .to("log:ftp")
-            .to("mock:result");
-      }
-    };
-  }
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from(getFtpUrl())
+                        .convertBodyTo(String.class)
+                        .to("log:ftp")
+                        .to("mock:result");
+            }
+        };
+    }
 
-  private void prepareFtpServer() throws Exception {
-    sendFile(getFtpUrl(), "Bye World", "bye.txt");
-    sendFile(getFtpUrl(), "Hello World", "sub/hello.txt");
-    sendFile(getFtpUrl(), "Goodday World", "sub/sub2/godday.txt");
-  }
+    private void prepareFtpServer() throws Exception {
+        sendFile(getFtpUrl(), "Bye World", "bye.txt");
+        sendFile(getFtpUrl(), "Hello World", "sub/hello.txt");
+        sendFile(getFtpUrl(), "Goodday World", "sub/sub2/godday.txt");
+    }
 }
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/FromSftpRecursiveNotStepwiseNoBasePath.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/FromSftpRecursiveNotStepwiseNoBasePath.java
index 001a1c9..1cbcb6f 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/FromSftpRecursiveNotStepwiseNoBasePath.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/FromSftpRecursiveNotStepwiseNoBasePath.java
@@ -24,46 +24,46 @@ import org.junit.Test;
 
 public class FromSftpRecursiveNotStepwiseNoBasePath extends SftpServerTestSupport {
 
-  protected String getSftpUrl() {
-    return "sftp://admin@localhost:" + getPort() + "?password=admin&initialDelay=3000&stepwise=false"
-        + "&recursive=true";
-  }
+    protected String getSftpUrl() {
+        return "sftp://admin@localhost:" + getPort() + "?password=admin&initialDelay=3000&stepwise=false"
+                + "&recursive=true";
+    }
 
-  @Override
-  @Before
-  public void setUp() throws Exception {
-    rootDirMode = true;
-    super.setUp();
-    prepareFtpServer();
-  }
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        rootDirMode = true;
+        super.setUp();
+        prepareFtpServer();
+    }
 
-  @Test
-  public void testRecursiveNotStepwiseNoBasePath() throws Exception {
-    //CAMEL-13400
-    MockEndpoint mock = getMockEndpoint("mock:result");
-    mock.expectedBodiesReceivedInAnyOrder("Bye World", "Hello World", "Goodday World");
-    assertMockEndpointsSatisfied();
-  }
+    @Test
+    public void testRecursiveNotStepwiseNoBasePath() throws Exception {
+        //CAMEL-13400
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedBodiesReceivedInAnyOrder("Bye World", "Hello World", "Goodday World");
+        assertMockEndpointsSatisfied();
+    }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() throws Exception {
-    return new RouteBuilder() {
-      @Override
-      public void configure() throws Exception {
-        from(getSftpUrl())
-            .convertBodyTo(String.class)
-            .to("mock:result");
-      }
-    };
-  }
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from(getSftpUrl())
+                        .convertBodyTo(String.class)
+                        .to("mock:result");
+            }
+        };
+    }
 
-  private void prepareFtpServer() throws Exception {
-    sendFile("Bye World", "bye.txt");
-    sendFile("Hello World", "sub/hello.txt");
-    sendFile("Goodday World", "sub/sub2/godday.txt");
-  }
+    private void prepareFtpServer() throws Exception {
+        sendFile("Bye World", "bye.txt");
+        sendFile("Hello World", "sub/hello.txt");
+        sendFile("Goodday World", "sub/sub2/godday.txt");
+    }
 
-  public void sendFile(Object body, String fileName) {
-    template.sendBodyAndHeader("file://" + FTP_ROOT_DIR, body, Exchange.FILE_NAME, fileName);
-  }
+    public void sendFile(Object body, String fileName) {
+        template.sendBodyAndHeader("file://" + FTP_ROOT_DIR, body, Exchange.FILE_NAME, fileName);
+    }
 }
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java
index f4dbf12..51380bf 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpServerTestSupport.java
@@ -45,7 +45,7 @@ public class SftpServerTestSupport extends BaseServerTestSupport {
     protected SshServer sshd;
     protected boolean canTest;
     protected String oldUserHome;
-    protected boolean rootDirMode = false;
+    protected boolean rootDirMode;
 
     @Override
     @Before
@@ -80,7 +80,7 @@ public class SftpServerTestSupport extends BaseServerTestSupport {
             sshd.setPasswordAuthenticator((username, password, session) -> true);
             sshd.setPublickeyAuthenticator((username, password, session) -> true);
             if (rootDirMode) {
-              sshd.setFileSystemFactory(new VirtualFileSystemFactory(FileSystems.getDefault().getPath(System.getProperty("user.dir") + "/target/res")));
+                sshd.setFileSystemFactory(new VirtualFileSystemFactory(FileSystems.getDefault().getPath(System.getProperty("user.dir") + "/target/res")));
             }
             sshd.start();
         } catch (Exception e) {