This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 3bd87f7ff6a2a52b2972e576d04c790be9a2c75d
Author: juanpablo <[email protected]>
AuthorDate: Wed Dec 27 23:23:35 2017 +0100

    add testEmptyURL on URLConstructor's test classes
---
 .../test/java/org/apache/wiki/url/DefaultURLConstructorTest.java  | 8 ++++++++
 .../test/java/org/apache/wiki/url/ShortURLConstructorTest.java    | 8 ++++++++
 .../java/org/apache/wiki/url/ShortViewURLConstructorTest.java     | 8 ++++++++
 3 files changed, 24 insertions(+)

diff --git 
a/jspwiki-war/src/test/java/org/apache/wiki/url/DefaultURLConstructorTest.java 
b/jspwiki-war/src/test/java/org/apache/wiki/url/DefaultURLConstructorTest.java
index c1966b2..ba4548c 100644
--- 
a/jspwiki-war/src/test/java/org/apache/wiki/url/DefaultURLConstructorTest.java
+++ 
b/jspwiki-war/src/test/java/org/apache/wiki/url/DefaultURLConstructorTest.java
@@ -147,6 +147,14 @@ public class DefaultURLConstructorTest extends TestCase
         assertEquals( "/test/foo.jsp?a=1&amp;b=2", 
c.makeURL(WikiContext.NONE,"foo.jsp",true,"a=1&amp;b=2") );
     }
 
+    public void testEmptyURL()
+        throws Exception
+    {
+        URLConstructor c = getConstructor( null );
+
+        assertEquals( "/test/Wiki.jsp?page=", 
c.makeURL(WikiContext.VIEW,"",true,null) );
+    }
+
     public static Test suite()
     {
         return new TestSuite( DefaultURLConstructorTest.class );
diff --git 
a/jspwiki-war/src/test/java/org/apache/wiki/url/ShortURLConstructorTest.java 
b/jspwiki-war/src/test/java/org/apache/wiki/url/ShortURLConstructorTest.java
index 75a8726..c287f5f 100644
--- a/jspwiki-war/src/test/java/org/apache/wiki/url/ShortURLConstructorTest.java
+++ b/jspwiki-war/src/test/java/org/apache/wiki/url/ShortURLConstructorTest.java
@@ -147,6 +147,14 @@ public class ShortURLConstructorTest extends TestCase
         assertEquals( "/test/foo.jsp?a=1&amp;b=2", 
c.makeURL(WikiContext.NONE,"foo.jsp",true,"a=1&amp;b=2") );
     }
 
+    public void testEmptyURL()
+        throws Exception
+    {
+        URLConstructor c = getConstructor("wiki/" );
+
+        assertEquals( "/test/wiki/", c.makeURL(WikiContext.VIEW,"",true,null) 
);
+    }
+
     public static Test suite()
     {
         return new TestSuite( ShortURLConstructorTest.class );
diff --git 
a/jspwiki-war/src/test/java/org/apache/wiki/url/ShortViewURLConstructorTest.java
 
b/jspwiki-war/src/test/java/org/apache/wiki/url/ShortViewURLConstructorTest.java
index cdc4b19..4fa21de 100644
--- 
a/jspwiki-war/src/test/java/org/apache/wiki/url/ShortViewURLConstructorTest.java
+++ 
b/jspwiki-war/src/test/java/org/apache/wiki/url/ShortViewURLConstructorTest.java
@@ -147,6 +147,14 @@ public class ShortViewURLConstructorTest extends TestCase
         assertEquals( "/test/foo.jsp?a=1&amp;b=2", 
c.makeURL(WikiContext.NONE,"foo.jsp",true,"a=1&amp;b=2") );
     }
 
+    public void testEmptyURL()
+        throws Exception
+    {
+        URLConstructor c = getConstructor("wiki/" );
+
+        assertEquals( "/test/wiki/", c.makeURL(WikiContext.VIEW,"",true,null) 
);
+    }
+
     public static Test suite()
     {
         return new TestSuite( ShortViewURLConstructorTest.class );

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to