1 package ch
.cyberduck
.core
;
3 import ch
.cyberduck
.core
.sftp
.SFTPProtocol
;
7 import static org
.junit
.Assert
.assertEquals
;
12 public class HostUrlProviderTest
extends AbstractTestCase
{
15 public void testToUrl() {
16 assertEquals("sftp://user@localhost", new HostUrlProvider().get(new Host(new SFTPProtocol(), "localhost", new Credentials("user", "p"))));
17 assertEquals("sftp://localhost", new HostUrlProvider(false, false).get(new Host(new SFTPProtocol(), "localhost", new Credentials("user", "p"))));
18 assertEquals("sftp://localhost:222",
19 new HostUrlProvider(false, false).get(new Host(new SFTPProtocol(), "localhost", 222)));
23 public void testPath() {
24 final Host h
= new Host(new SFTPProtocol(), "localhost", new Credentials("user", "p"));
25 h
.setDefaultPath("p");
26 assertEquals("sftp://user@localhost/p", new HostUrlProvider(true, true).get(h
));