aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2010-10-06 15:43:42 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2010-10-08 11:08:12 +0200
commit213609520351bc26beab887dd7f41f09b0b70d89 (patch)
tree06a30ebf3f34ceae8ad5ae1d909fefec2ce67b6a /org.eclipse.jgit.test/tst/org/eclipse/jgit/transport
parentcee08c30273c18d0b36ee3659fbca1b3b8451d24 (diff)
downloadjgit-213609520351bc26beab887dd7f41f09b0b70d89.tar.gz
jgit-213609520351bc26beab887dd7f41f09b0b70d89.zip
Fixed URI regexp regarding user/password part
The regular expression which should handle the user/password part in an URI was potentially processing too many chars. This led to problems when user/pwd and port was specified Change-Id: I87db02494c4b367283e1d00437b1c06d2c8fdd28 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/transport')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
index 9c4c11cd25..88651b75e6 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java
@@ -424,4 +424,27 @@ public class URIishTest extends TestCase {
assertEquals("c", humanishName);
}
+ public void testUserPasswordAndPort() throws URISyntaxException {
+ String str = "http://user:secret@host.xy:80/some/path";
+ URIish u = new URIish(str);
+ assertEquals("http", u.getScheme());
+ assertTrue(u.isRemote());
+ assertEquals("/some/path", u.getPath());
+ assertEquals("host.xy", u.getHost());
+ assertEquals(80, u.getPort());
+ assertEquals("user", u.getUser());
+ assertEquals("secret", u.getPass());
+ assertEquals(u, new URIish(str));
+
+ str = "http://user:secret@pass@host.xy:80/some/path";
+ u = new URIish(str);
+ assertEquals("http", u.getScheme());
+ assertTrue(u.isRemote());
+ assertEquals("/some/path", u.getPath());
+ assertEquals("host.xy", u.getHost());
+ assertEquals(80, u.getPort());
+ assertEquals("user", u.getUser());
+ assertEquals("secret@pass", u.getPass());
+ assertEquals(u, new URIish(str));
+ }
}