You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by me...@apache.org on 2016/12/31 14:23:42 UTC
[07/12] jspwiki git commit: 2016-12-26 Harry Metske
(metskem@apache.org) * Fixed JSPWIKI-1035 - Get rid of jspwiki.baseURL fixed
remaining unit tests * changed Release postfix from "svn" to "git"
2016-12-26 Harry Metske (metskem@apache.org)
* Fixed JSPWIKI-1035 - Get rid of jspwiki.baseURL
fixed remaining unit tests
* changed Release postfix from "svn" to "git"
Project: http://git-wip-us.apache.org/repos/asf/jspwiki/repo
Commit: http://git-wip-us.apache.org/repos/asf/jspwiki/commit/72e1acee
Tree: http://git-wip-us.apache.org/repos/asf/jspwiki/tree/72e1acee
Diff: http://git-wip-us.apache.org/repos/asf/jspwiki/diff/72e1acee
Branch: refs/heads/master
Commit: 72e1acee0dc9ca1348bf381fc12f529b9bccf055
Parents: a522408
Author: Harry Metske <ha...@gmail.com>
Authored: Mon Dec 26 11:59:25 2016 +0100
Committer: Harry Metske <ha...@gmail.com>
Committed: Mon Dec 26 11:59:25 2016 +0100
----------------------------------------------------------------------
ChangeLog | 5 ++
.../src/main/java/org/apache/wiki/Release.java | 4 +-
.../apache/wiki/url/DefaultURLConstructor.java | 2 +-
.../org/apache/wiki/ui/CommandResolverTest.java | 4 +-
.../wiki/url/DefaultURLConstructorTest.java | 51 ++++++++++----------
.../wiki/url/ShortURLConstructorTest.java | 51 ++++++++++----------
.../wiki/url/ShortViewURLConstructorTest.java | 51 ++++++++++----------
.../org/apache/wiki/xmlrpc/RPCHandlerTest.java | 6 +--
8 files changed, 88 insertions(+), 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jspwiki/blob/72e1acee/ChangeLog
----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 9c1acc8..70e0ae8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-26 Harry Metske (metskem@apache.org)
+ * Fixed JSPWIKI-1035 - Get rid of jspwiki.baseURL
+ fixed remaining unit tests
+ * changed Release postfix from "svn" to "git"
+
2016-12-19 Dirk Frederickx (brushed AT apache DOT org)
* 2.10.3-svn-22 Various HADDOCK updates & fixes.
http://git-wip-us.apache.org/repos/asf/jspwiki/blob/72e1acee/jspwiki-war/src/main/java/org/apache/wiki/Release.java
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/java/org/apache/wiki/Release.java b/jspwiki-war/src/main/java/org/apache/wiki/Release.java
index 9cf5f0d..6d807cb 100644
--- a/jspwiki-war/src/main/java/org/apache/wiki/Release.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/Release.java
@@ -52,7 +52,7 @@ public final class Release {
* <p>
* If the POSTFIX is empty, it is not added to the version string.
*/
- private static final String POSTFIX = "svn";
+ private static final String POSTFIX = "git";
/** The JSPWiki major version. */
public static final int VERSION = 2;
@@ -72,7 +72,7 @@ public final class Release {
* <p>
* If the build identifier is empty, it is not added.
*/
- public static final String BUILD = "22";
+ public static final String BUILD = "23";
/**
* This is the generic version string you should use when printing out the version. It is of
http://git-wip-us.apache.org/repos/asf/jspwiki/blob/72e1acee/jspwiki-war/src/main/java/org/apache/wiki/url/DefaultURLConstructor.java
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/java/org/apache/wiki/url/DefaultURLConstructor.java b/jspwiki-war/src/main/java/org/apache/wiki/url/DefaultURLConstructor.java
index 8d8779c..dca6d25 100644
--- a/jspwiki-war/src/main/java/org/apache/wiki/url/DefaultURLConstructor.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/url/DefaultURLConstructor.java
@@ -84,7 +84,7 @@ public class DefaultURLConstructor
{
String baseurl = m_pathPrefix;
- if( absolute ) baseurl = m_engine.getBaseURL();
+ if( absolute ) baseurl = m_engine.getBaseURL() + "/";
baseptrn = TextUtil.replaceString( baseptrn, "%u", baseurl );
baseptrn = TextUtil.replaceString( baseptrn, "%U", m_engine.getBaseURL() );
http://git-wip-us.apache.org/repos/asf/jspwiki/blob/72e1acee/jspwiki-war/src/test/java/org/apache/wiki/ui/CommandResolverTest.java
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/test/java/org/apache/wiki/ui/CommandResolverTest.java b/jspwiki-war/src/test/java/org/apache/wiki/ui/CommandResolverTest.java
index 721d757..4fdab21 100644
--- a/jspwiki-war/src/test/java/org/apache/wiki/ui/CommandResolverTest.java
+++ b/jspwiki-war/src/test/java/org/apache/wiki/ui/CommandResolverTest.java
@@ -225,10 +225,10 @@ public class CommandResolverTest extends TestCase
{
String url;
url = resolver.getSpecialPageReference( "RecentChanges" );
- assertEquals( "http://localhost/RecentChanges.jsp", url );
+ assertEquals( "/test/RecentChanges.jsp", url );
url = resolver.getSpecialPageReference( "Search" );
- assertEquals( "http://localhost/Search.jsp", url );
+ assertEquals( "/test/Search.jsp", url );
// UserPrefs doesn't exist in our test properties
url = resolver.getSpecialPageReference( "UserPrefs" );
http://git-wip-us.apache.org/repos/asf/jspwiki/blob/72e1acee/jspwiki-war/src/test/java/org/apache/wiki/url/DefaultURLConstructorTest.java
----------------------------------------------------------------------
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 fc3df0b..0cab8ac 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
@@ -39,10 +39,9 @@ public class DefaultURLConstructorTest extends TestCase
Properties props = TestEngine.getTestProperties();
- private URLConstructor getConstructor( String baseURL, String prefix )
+ private URLConstructor getConstructor( String prefix )
throws WikiException
{
- props.setProperty( WikiEngine.PROP_BASEURL, baseURL );
if( prefix != null ) props.setProperty( ShortViewURLConstructor.PROP_PREFIX, prefix );
testEngine = new TestEngine(props);
@@ -56,97 +55,97 @@ public class DefaultURLConstructorTest extends TestCase
public void testViewURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/", "wiki/" );
+ URLConstructor c = getConstructor("wiki/" );
- assertEquals( "http://localhost/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL2()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor( null );
- assertEquals( "http://localhost/mywiki/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL3()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost:8080/", null );
+ URLConstructor c = getConstructor( null );
- assertEquals( "http://localhost:8080/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL4()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor( null );
- assertEquals( "/mywiki/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",false,null) );
+ assertEquals( "/test/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",false,null) );
}
public void testViewURL5()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/", "" );
+ URLConstructor c = getConstructor( "" );
- assertEquals( "http://localhost/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL6()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/app1/", null );
+ URLConstructor c = getConstructor( null );
- assertEquals( "http://localhost/mywiki/app1/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL7()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/app1/", "view/" );
+ URLConstructor c = getConstructor( "view/" );
- assertEquals( "http://localhost/mywiki/app1/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/Wiki.jsp?page=Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testEditURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor( null );
- assertEquals( "http://localhost/mywiki/Edit.jsp?page=Main", c.makeURL(WikiContext.EDIT,"Main",true,null) );
+ assertEquals( "/test/Edit.jsp?page=Main", c.makeURL(WikiContext.EDIT,"Main",true,null) );
}
public void testAttachURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor( null );
- assertEquals( "http://localhost/mywiki/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",true,null) );
+ assertEquals( "/test/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",true,null) );
}
public void testAttachURLRelative1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor( null );
- assertEquals( "/mywiki/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",false,null) );
+ assertEquals( "/test/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",false,null) );
}
public void testOtherURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor( null );
- assertEquals( "http://localhost/mywiki/foo.jsp", c.makeURL(WikiContext.NONE,"foo.jsp",true,null) );
+ assertEquals( "/test/foo.jsp", c.makeURL(WikiContext.NONE,"foo.jsp",true,null) );
}
public void testOtherURL2()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/dobble/", null );
+ URLConstructor c = getConstructor( null );
- assertEquals( "http://localhost/mywiki/dobble/foo.jsp?a=1&b=2", c.makeURL(WikiContext.NONE,"foo.jsp",true,"a=1&b=2") );
+ assertEquals( "/test/foo.jsp?a=1&b=2", c.makeURL(WikiContext.NONE,"foo.jsp",true,"a=1&b=2") );
}
public static Test suite()
http://git-wip-us.apache.org/repos/asf/jspwiki/blob/72e1acee/jspwiki-war/src/test/java/org/apache/wiki/url/ShortURLConstructorTest.java
----------------------------------------------------------------------
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 5cc7024..6b7de52 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
@@ -39,10 +39,9 @@ public class ShortURLConstructorTest extends TestCase
Properties props = TestEngine.getTestProperties();
- private URLConstructor getConstructor( String baseURL, String prefix )
+ private URLConstructor getConstructor(String prefix)
throws WikiException
{
- props.setProperty( WikiEngine.PROP_BASEURL, baseURL );
if( prefix != null ) props.setProperty( ShortURLConstructor.PROP_PREFIX, prefix );
testEngine = new TestEngine(props);
@@ -56,97 +55,97 @@ public class ShortURLConstructorTest extends TestCase
public void testViewURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/", "wiki/" );
+ URLConstructor c = getConstructor("wiki/" );
- assertEquals( "http://localhost/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL2()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL3()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost:8080/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost:8080/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL4()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "/mywiki/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",false,null) );
+ assertEquals( "/test/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",false,null) );
}
public void testViewURL5()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/", "" );
+ URLConstructor c = getConstructor("" );
- assertEquals( "http://localhost/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL6()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/app1/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/app1/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL7()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/app1/", "view/" );
+ URLConstructor c = getConstructor("view/" );
- assertEquals( "http://localhost/mywiki/app1/view/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/view/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testEditURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/wiki/Main?do=Edit", c.makeURL(WikiContext.EDIT,"Main",true,null) );
+ assertEquals( "/test/wiki/Main?do=Edit", c.makeURL(WikiContext.EDIT,"Main",true,null) );
}
public void testAttachURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",true,null) );
+ assertEquals( "/test/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",true,null) );
}
public void testAttachURLRelative1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "/mywiki/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",false,null) );
+ assertEquals( "/test/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",false,null) );
}
public void testOtherURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/foo.jsp", c.makeURL(WikiContext.NONE,"foo.jsp",true,null) );
+ assertEquals( "/test/foo.jsp", c.makeURL(WikiContext.NONE,"foo.jsp",true,null) );
}
public void testOtherURL2()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/dobble/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/dobble/foo.jsp?a=1&b=2", c.makeURL(WikiContext.NONE,"foo.jsp",true,"a=1&b=2") );
+ assertEquals( "/test/foo.jsp?a=1&b=2", c.makeURL(WikiContext.NONE,"foo.jsp",true,"a=1&b=2") );
}
public static Test suite()
http://git-wip-us.apache.org/repos/asf/jspwiki/blob/72e1acee/jspwiki-war/src/test/java/org/apache/wiki/url/ShortViewURLConstructorTest.java
----------------------------------------------------------------------
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 2a1e1bc..3270a59 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
@@ -39,10 +39,9 @@ public class ShortViewURLConstructorTest extends TestCase
Properties props = TestEngine.getTestProperties();
- private URLConstructor getConstructor( String baseURL, String prefix )
+ private URLConstructor getConstructor(String prefix)
throws WikiException
{
- props.setProperty( WikiEngine.PROP_BASEURL, baseURL );
if( prefix != null ) props.setProperty( ShortViewURLConstructor.PROP_PREFIX, prefix );
testEngine = new TestEngine(props);
@@ -56,97 +55,97 @@ public class ShortViewURLConstructorTest extends TestCase
public void testViewURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/", "wiki/" );
+ URLConstructor c = getConstructor("wiki/" );
- assertEquals( "http://localhost/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL2()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL3()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost:8080/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost:8080/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL4()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "/mywiki/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",false,null) );
+ assertEquals( "/test/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",false,null) );
}
public void testViewURL5()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/", "" );
+ URLConstructor c = getConstructor("" );
- assertEquals( "http://localhost/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL6()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/app1/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/app1/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/wiki/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testViewURL7()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/app1/", "view/" );
+ URLConstructor c = getConstructor("view/" );
- assertEquals( "http://localhost/mywiki/app1/view/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
+ assertEquals( "/test/view/Main", c.makeURL(WikiContext.VIEW,"Main",true,null) );
}
public void testEditURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/Edit.jsp?page=Main", c.makeURL(WikiContext.EDIT,"Main",true,null) );
+ assertEquals( "/test/Edit.jsp?page=Main", c.makeURL(WikiContext.EDIT,"Main",true,null) );
}
public void testAttachURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",true,null) );
+ assertEquals( "/test/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",true,null) );
}
public void testAttachURLRelative1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "/mywiki/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",false,null) );
+ assertEquals( "/test/attach/Main/foo.txt", c.makeURL(WikiContext.ATTACH,"Main/foo.txt",false,null) );
}
public void testOtherURL1()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/foo.jsp", c.makeURL(WikiContext.NONE,"foo.jsp",true,null) );
+ assertEquals( "/test/foo.jsp", c.makeURL(WikiContext.NONE,"foo.jsp",true,null) );
}
public void testOtherURL2()
throws Exception
{
- URLConstructor c = getConstructor( "http://localhost/mywiki/dobble/", null );
+ URLConstructor c = getConstructor(null );
- assertEquals( "http://localhost/mywiki/dobble/foo.jsp?a=1&b=2", c.makeURL(WikiContext.NONE,"foo.jsp",true,"a=1&b=2") );
+ assertEquals( "/test/foo.jsp?a=1&b=2", c.makeURL(WikiContext.NONE,"foo.jsp",true,"a=1&b=2") );
}
public static Test suite()
http://git-wip-us.apache.org/repos/asf/jspwiki/blob/72e1acee/jspwiki-war/src/test/java/org/apache/wiki/xmlrpc/RPCHandlerTest.java
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/test/java/org/apache/wiki/xmlrpc/RPCHandlerTest.java b/jspwiki-war/src/test/java/org/apache/wiki/xmlrpc/RPCHandlerTest.java
index e300e19..d13340c 100644
--- a/jspwiki-war/src/test/java/org/apache/wiki/xmlrpc/RPCHandlerTest.java
+++ b/jspwiki-war/src/test/java/org/apache/wiki/xmlrpc/RPCHandlerTest.java
@@ -158,7 +158,7 @@ public class RPCHandlerTest extends TestCase
assertEquals( "name", "Foobar", linkinfo.get("page") );
assertEquals( "type", "local", linkinfo.get("type") );
- assertEquals( "href", "http://localhost/Edit.jsp?page=Foobar", linkinfo.get("href") );
+ assertEquals( "href", "/test/Edit.jsp?page=Foobar", linkinfo.get("href") );
}
@@ -184,13 +184,13 @@ public class RPCHandlerTest extends TestCase
assertEquals( "edit name", "Foobar", linkinfo.get("page") );
assertEquals( "edit type", "local", linkinfo.get("type") );
- assertEquals( "edit href", "http://localhost/Edit.jsp?page=Foobar", linkinfo.get("href") );
+ assertEquals( "edit href", "/test/Edit.jsp?page=Foobar", linkinfo.get("href") );
linkinfo = (Hashtable) links.elementAt(1);
assertEquals( "att name", NAME1+"/TestAtt.txt", linkinfo.get("page") );
assertEquals( "att type", "local", linkinfo.get("type") );
- assertEquals( "att href", "http://localhost/attach/"+NAME1+"/TestAtt.txt", linkinfo.get("href") );
+ assertEquals( "att href", "/test/attach/"+NAME1+"/TestAtt.txt", linkinfo.get("href") );
}
private Date getCalendarTime( Date modifiedDate )