|
|
@ -468,6 +468,48 @@ public class URIishTest { |
|
|
|
assertEquals(u, new URIish(str)); |
|
|
|
assertEquals(u, new URIish(str)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void testSshProtoWithEmailUserAndPort() throws Exception { |
|
|
|
|
|
|
|
final String str = "ssh://user.name@email.com@example.com:33/some/p ath"; |
|
|
|
|
|
|
|
URIish u = new URIish(str); |
|
|
|
|
|
|
|
assertEquals("ssh", u.getScheme()); |
|
|
|
|
|
|
|
assertTrue(u.isRemote()); |
|
|
|
|
|
|
|
assertEquals("/some/p ath", u.getRawPath()); |
|
|
|
|
|
|
|
assertEquals("/some/p ath", u.getPath()); |
|
|
|
|
|
|
|
assertEquals("example.com", u.getHost()); |
|
|
|
|
|
|
|
assertEquals("user.name@email.com", u.getUser()); |
|
|
|
|
|
|
|
assertNull(u.getPass()); |
|
|
|
|
|
|
|
assertEquals(33, u.getPort()); |
|
|
|
|
|
|
|
assertEquals("ssh://user.name%40email.com@example.com:33/some/p ath", |
|
|
|
|
|
|
|
u.toPrivateString()); |
|
|
|
|
|
|
|
assertEquals("ssh://user.name%40email.com@example.com:33/some/p%20ath", |
|
|
|
|
|
|
|
u.toPrivateASCIIString()); |
|
|
|
|
|
|
|
assertEquals(u.setPass(null).toPrivateString(), u.toString()); |
|
|
|
|
|
|
|
assertEquals(u.setPass(null).toPrivateASCIIString(), u.toASCIIString()); |
|
|
|
|
|
|
|
assertEquals(u, new URIish(str)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void testSshProtoWithEmailUserPassAndPort() throws Exception { |
|
|
|
|
|
|
|
final String str = "ssh://user.name@email.com:pass@wor:d@example.com:33/some/p ath"; |
|
|
|
|
|
|
|
URIish u = new URIish(str); |
|
|
|
|
|
|
|
assertEquals("ssh", u.getScheme()); |
|
|
|
|
|
|
|
assertTrue(u.isRemote()); |
|
|
|
|
|
|
|
assertEquals("/some/p ath", u.getRawPath()); |
|
|
|
|
|
|
|
assertEquals("/some/p ath", u.getPath()); |
|
|
|
|
|
|
|
assertEquals("example.com", u.getHost()); |
|
|
|
|
|
|
|
assertEquals("user.name@email.com", u.getUser()); |
|
|
|
|
|
|
|
assertEquals("pass@wor:d", u.getPass()); |
|
|
|
|
|
|
|
assertEquals(33, u.getPort()); |
|
|
|
|
|
|
|
assertEquals("ssh://user.name%40email.com:pass%40wor%3ad@example.com:33/some/p ath", |
|
|
|
|
|
|
|
u.toPrivateString()); |
|
|
|
|
|
|
|
assertEquals("ssh://user.name%40email.com:pass%40wor%3ad@example.com:33/some/p%20ath", |
|
|
|
|
|
|
|
u.toPrivateASCIIString()); |
|
|
|
|
|
|
|
assertEquals(u.setPass(null).toPrivateString(), u.toString()); |
|
|
|
|
|
|
|
assertEquals(u.setPass(null).toPrivateASCIIString(), u.toASCIIString()); |
|
|
|
|
|
|
|
assertEquals(u, new URIish(str)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testSshProtoWithADUserPassAndPort() throws Exception { |
|
|
|
public void testSshProtoWithADUserPassAndPort() throws Exception { |
|
|
|
final String str = "ssh://DOMAIN\\user:pass@example.com:33/some/p ath"; |
|
|
|
final String str = "ssh://DOMAIN\\user:pass@example.com:33/some/p ath"; |
|
|
|