summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorKetan Padegaonkar <KetanPadegaonkar@gmail.com>2011-05-19 13:08:26 +0530
committerChris Aniszczyk <caniszczyk@gmail.com>2011-05-19 08:58:17 -0500
commitf953a35e9a1f279ca038955243c07fd84fb6ae23 (patch)
tree2de64ceafa32ceba88548f59d41dee8fca82094b /org.eclipse.jgit.test
parentdc30c95d971ca270f442403ada0d4e3b00151419 (diff)
downloadjgit-f953a35e9a1f279ca038955243c07fd84fb6ae23.tar.gz
jgit-f953a35e9a1f279ca038955243c07fd84fb6ae23.zip
Fix NPE in URIish when parsing an empty URI
Change-Id: Id1c42dc9843f62c581b9904b02150de53cf7777c Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java20
1 files changed, 20 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 01d3820184..9b4ebf90d8 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
@@ -63,6 +63,26 @@ public class URIishTest {
private static final String GIT_SCHEME = "git://";
@Test
+ public void shouldRaiseErrorOnEmptyURI() throws Exception {
+ try {
+ new URIish("");
+ fail("expecting an exception");
+ } catch (URISyntaxException e) {
+ // expected
+ }
+ }
+
+ @Test
+ public void shouldRaiseErrorOnNullURI() throws Exception {
+ try {
+ new URIish((String) null);
+ fail("expecting an exception");
+ } catch (URISyntaxException e) {
+ // expected
+ }
+ }
+
+ @Test
public void testUnixFile() throws Exception {
final String str = "/home/m y";
URIish u = new URIish(str);