1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.sftp;
12
13 import org.mule.tck.junit4.AbstractMuleTestCase;
14
15 import org.junit.Test;
16
17 import static org.junit.Assert.assertEquals;
18
19
20
21
22
23
24 public class SftpClientTestCase extends AbstractMuleTestCase
25 {
26
27 @Test
28 public void testGetAbsolutePath()
29 {
30 SftpClient client = new SftpClient("hostName");
31 client.setHome("/home/user");
32
33
34
35 assertEquals("hostName", client.getHost());
36
37
38 assertEquals("/home/user/foo", client.getAbsolutePath("/~/foo"));
39 assertEquals("/home/user/foo/bar", client.getAbsolutePath("/~/foo/bar"));
40
41
42 assertEquals("/home/user/foo/bar", client.getAbsolutePath(client.getAbsolutePath("/~/foo/bar")));
43
44
45 assertEquals("/opt/mule/files", client.getAbsolutePath("/opt/mule/files"));
46
47
48
49 assertEquals("foo", client.getAbsolutePath("foo"));
50 }
51 }