Author: ajaquith
Date: Mon May 4 23:53:20 2009
New Revision: 771504
URL: http://svn.apache.org/viewvc?rev=771504&view=rev
Log:
Minor Javadoc tweaks and unit test fixes.
Modified:
incubator/jspwiki/trunk/ChangeLog
incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandler.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/Util.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PluginIndexPluginTest.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PluginManagerTest.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/ReferredPagesPluginTest.java
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java
Modified: incubator/jspwiki/trunk/ChangeLog
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=771504&r1=771503&r2=771504&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Mon May 4 23:53:20 2009
@@ -1,3 +1,26 @@
+2009-05-04 Andrew Jaquith <ajaquith AT apache DOT org>
+
+ * 3.0.0-svn-110
+
+ * Encountered problem with new ReferenceManager (probably related to
Priha)
+ that causes heap exhaustion. ReferenceManager includes a few
(temporary)
+ diagnostics for this. It also changes the method signatures for
getRefersTo
+ and getReferredBy to return lists of WikiPath. Several plugins were
changed
+ to accommodate this.
+
+ * Added method WikiEngine.beautify(WikiPath), which works identically
to
+ the String version, except that those paths who are prefixed with the
default
+ space name (plus a colon) are rendered without the space name.
WikiEngine
+ also gains a method getSpaces(), which today only returns the default
space.
+ In the future this will be configurable.
+
+ * To prevent wiki paths that have space prefixes from being
interpreted as
+ inter-wiki links, JSPWikiMarkupParser prioritizes these first. This
means that
+ wiki space names can't be the same as those for an interwiki prefixes.
+ (Which is ok: when you think about it, an outside wiki is really just
a space
+ managed by someone else.) This fix was needed prevent various unit
tests
+ from bombing.
+
2009-05-03 Andrew Jaquith <ajaquith AT apache DOT org>
* 3.0.0-svn-109
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=771504&r1=771503&r2=771504&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Mon May 4
23:53:20 2009
@@ -77,7 +77,7 @@
* <p>
* If the build identifier is empty, it is not added.
*/
- public static final String BUILD = "109";
+ public static final String BUILD = "110";
/**
* This is the generic version string you should use
Modified:
incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java?rev=771504&r1=771503&r2=771504&view=diff
==============================================================================
---
incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
(original)
+++
incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
Mon May 4 23:53:20 2009
@@ -330,8 +330,8 @@
}
/**
- * Saves a WikiPage to the repositiry.
- * @param page
+ * Saves a WikiPage to the repository.
+ * @param page the page to save
*/
public void save( WikiPage page ) throws RepositoryException
{
Modified:
incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandler.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandler.java?rev=771504&r1=771503&r2=771504&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandler.java
(original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandler.java Mon
May 4 23:53:20 2009
@@ -172,7 +172,7 @@
for( WikiPage page : pages )
{
- if( page.getLastModified().after( since ) && !(
page.isAttachment() ) )
+ if( !( page.isAttachment() ) && page.getLastModified().after(
since ) )
{
result.add( encodeWikiPage( page ) );
}
Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/Util.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/Util.java?rev=771504&r1=771503&r2=771504&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/Util.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/Util.java Mon May 4
23:53:20 2009
@@ -28,7 +28,11 @@
public class Util
{
/**
- * Check that a collection contains the required string.
+ * Check that a collection contains the required object.
+ * @param items the collection to check
+ * @param item the item to look for
+ * @return <code>true</code> if the collection contains an item equal
+ * to the supplied item; <code>false</code> otherwise
*/
public static boolean collectionContains( Collection<String> container,
String captive )
Modified:
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PluginIndexPluginTest.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PluginIndexPluginTest.java?rev=771504&r1=771503&r2=771504&view=diff
==============================================================================
---
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PluginIndexPluginTest.java
(original)
+++
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PluginIndexPluginTest.java
Mon May 4 23:53:20 2009
@@ -63,7 +63,9 @@
manager = new PluginManager( engine, props );
- context = engine.getWikiContextFactory().newViewContext(
engine.createPage( "TestPage" ) );
+ engine.saveText( "TestPage", "This is a test." );
+
+ context = engine.getWikiContextFactory().newViewContext(
engine.getPage( "TestPage" ) );
m_requiredPlugins = context.getEngine().getPluginManager().modules();
}
Modified:
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PluginManagerTest.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PluginManagerTest.java?rev=771504&r1=771503&r2=771504&view=diff
==============================================================================
---
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PluginManagerTest.java
(original)
+++
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/PluginManagerTest.java
Mon May 4 23:53:20 2009
@@ -30,7 +30,6 @@
import org.apache.wiki.TestEngine;
import org.apache.wiki.WikiContext;
-import org.apache.wiki.WikiEngine;
import org.apache.wiki.plugin.PluginManager.WikiPluginInfo;
@@ -40,7 +39,7 @@
Properties props = new Properties();
- WikiEngine engine;
+ TestEngine engine;
WikiContext context;
@@ -57,7 +56,8 @@
props.load( TestEngine.findTestProperties() );
engine = new TestEngine(props);
- context = engine.getWikiContextFactory().newViewContext(
engine.createPage( "Testpage" ) );
+ engine.saveText( "TestPage", "This is a test." );
+ context = engine.getWikiContextFactory().newViewContext(
engine.getPage( "TestPage" ) );
manager = new PluginManager( engine, props );
}
Modified:
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/ReferredPagesPluginTest.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/ReferredPagesPluginTest.java?rev=771504&r1=771503&r2=771504&view=diff
==============================================================================
---
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/ReferredPagesPluginTest.java
(original)
+++
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/ReferredPagesPluginTest.java
Mon May 4 23:53:20 2009
@@ -88,7 +88,7 @@
String res = manager.execute( context, "{INSERT
org.apache.wiki.plugin.ReferredPagesPlugin}" );
assertEquals(
- "<div class=\"ReferredPagesPlugin\">\n<a
class=\"wikipage\" href=\"/Wiki.jsp?page=IPointToSomeoneElse\"
title=\"ReferredPagesPlugin: depth[1] include[.*] exclude[^$]
format[compact]\">IPointToSomeoneElse</a>\n<ul>\n<li><a class=\"wikipage\"
href=\"/Wiki.jsp?page=SomeBodyPointsToMe\">SomeBodyPointsToMe</a></li>\n</ul>\n</div>\n",
+ "<div class=\"ReferredPagesPlugin\">\n<a
class=\"wikipage\" href=\"/Wiki.jsp?page=IPointToSomeoneElse\"
title=\"ReferredPagesPlugin: depth[1] include[.*] exclude[^$]
format[compact]\">IPointToSomeoneElse</a>\n<ul>\n<li><a class=\"wikipage\"
href=\"/Wiki.jsp?page=SomeBodyPointsToMe\">Main:SomeBodyPointsToMe</a></li>\n</ul>\n</div>\n",
res );
}
@@ -105,7 +105,7 @@
String res = manager.execute( context, "{INSERT
org.apache.wiki.plugin.ReferredPagesPlugin page=IPointToSomeoneElseToo}" );
assertEquals(
- "<div class=\"ReferredPagesPlugin\">\n<a
class=\"wikipage\" href=\"/Wiki.jsp?page=IPointToSomeoneElseToo\"
title=\"ReferredPagesPlugin: depth[1] include[.*] exclude[^$]
format[compact]\">IPointToSomeoneElseToo</a>\n<ul>\n<li><a class=\"wikipage\"
href=\"/Wiki.jsp?page=SomeBodyPointsToMe\">SomeBodyPointsToMe</a></li>\n</ul>\n</div>\n",
+ "<div class=\"ReferredPagesPlugin\">\n<a
class=\"wikipage\" href=\"/Wiki.jsp?page=IPointToSomeoneElseToo\"
title=\"ReferredPagesPlugin: depth[1] include[.*] exclude[^$]
format[compact]\">IPointToSomeoneElseToo</a>\n<ul>\n<li><a class=\"wikipage\"
href=\"/Wiki.jsp?page=SomeBodyPointsToMe\">Main:SomeBodyPointsToMe</a></li>\n</ul>\n</div>\n",
res );
}
Modified:
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java?rev=771504&r1=771503&r2=771504&view=diff
==============================================================================
---
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java
(original)
+++
incubator/jspwiki/trunk/tests/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java
Mon May 4 23:53:20 2009
@@ -67,7 +67,7 @@
manager = new PluginManager( engine, props );
}
- public void tearDown()
+ public void tearDown() throws Exception
{
TestEngine.deleteTestPage( "TestPage" );
TestEngine.deleteTestPage( "Foobar" );
@@ -77,7 +77,7 @@
TestEngine.deleteTestPage( "Foobar5" );
TestEngine.deleteTestPage( "Foobar6" );
TestEngine.deleteTestPage( "Foobar7" );
-
+ engine.emptyRepository();
engine.shutdown();
}