[ 
https://issues.apache.org/jira/browse/CAMEL-6018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13567611#comment-13567611
 ] 

Jeff Maher commented on CAMEL-6018:
-----------------------------------

Hi Willem - I tried to create a unit test, but a few things prevent this from 
being easy:

# The method under test does not return a value ({{public void 
changeCurrentDirectory(String path)}})
** Even though the method under test doesn't return a value, 
{{getCurrentDirectory()}} can be used
# The method under test requires a lot of external infrastructure to setup. 
Mocking all the dependencies is a significant effort (otherwise, I suppose it's 
not a *unit* test)
# I noticed that most of the test cases are not true unit test (integration 
tests) by inheriting from {{SftpServerTestSupport}}. I tried this approach too, 
but to perform the test, the {{sshd}} object in {{SftpServerTestSupport}} needs 
to be able to use the root dir ('/') as the home directory. I suspect that this 
would be an access violation on whatever continuous integration environment is 
used (i.e. I doubt root access is available on Apache's CI machine -- it'd be 
scary if it was)

Could you advise, particularly on point #3 (as I think the first two can be 
worked around easily by using the getter mentioned and making it an integration 
test)?
                
> camel-ftp module loses starting characters of path for root dir logins
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-6018
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6018
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.10.2, 2.11.1
>         Environment: Camel app ran on: Java 6 u 38
> FTP Server: UNIX-based
>            Reporter: Jeff Maher
>         Attachments: SftpOperations.java, SftpOperations.java.patch
>
>
> When a SFTP Camel route is established and the user's home directory is the 
> root dir (i.e. when the user logs in, they are put at / because it is their 
> home), the first character in the path is accidentally removed . While this 
> is okay for users that login to a '~' based path (or have '~' as their home), 
> for the root, it means that the '/' is prematurely removed.
> This problem happens in SftpOperations. Originally found in 2.10.2 (attached: 
> SftpOperations.java, includes fix). Patch file (SftpOperations.java.patch) is 
> for 2.11-SNAPSHOT (the current trunk).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to