jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jalka...@apache.org
Subject svn commit: r797012 - in /incubator/jspwiki/trunk: ./ src/java/org/apache/wiki/ src/java/org/apache/wiki/action/ src/java/org/apache/wiki/attachment/ src/java/org/apache/wiki/content/ src/java/org/apache/wiki/content/jcr/ src/java/org/apache/wiki/conte...
Date Thu, 23 Jul 2009 10:52:42 GMT
Author: jalkanen
Date: Thu Jul 23 10:52:40 2009
New Revision: 797012

URL: http://svn.apache.org/viewvc?rev=797012&view=rev
Log:
Moved classes to better packages; Cleaned ContentManager from obsolete code.

Added:
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ReferenceManager.java
      - copied, changed from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/ReferenceManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/jcr/
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/jcr/JCRWikiPage.java
      - copied, changed from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/EnglishPluralsPageNameResolver.java
      - copied, changed from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/content/EnglishPluralsPageNameResolver.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/PageNameResolver.java
      - copied, changed from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/content/PageNameResolver.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/SpecialPageNameResolver.java
      - copied, changed from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/content/SpecialPageNameResolver.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/util/LinkCollector.java
      - copied, changed from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/LinkCollector.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/ReferenceManagerTest.java
      - copied, changed from r796986, incubator/jspwiki/trunk/tests/java/org/apache/wiki/ReferenceManagerTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/AllTests.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/EnglishPluralsPageNameResolverTest.java
      - copied, changed from r796986, incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/EnglishPluralsPageNameResolverTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/SpecialPageNameResolverTest.java
      - copied, changed from r796986, incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/SpecialPageNameResolverTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/FileUtilTest.java
      - copied, changed from r796986, incubator/jspwiki/trunk/tests/java/org/apache/wiki/FileUtilTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/PropertyReaderTest.java
      - copied, changed from r796986, incubator/jspwiki/trunk/tests/java/org/apache/wiki/PropertyReaderTest.java
Removed:
    incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/LinkCollector.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/ReferenceManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/EnglishPluralsPageNameResolver.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/PageNameResolver.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/SpecialPageNameResolver.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/FileUtilTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/PropertyReaderTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/ReferenceManagerTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/TextUtilTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/EnglishPluralsPageNameResolverTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/SpecialPageNameResolverTest.java
Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/src/java/org/apache/wiki/PageManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiProvider.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/ViewActionBean.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentServlet.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/DynamicAttachment.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/SpamFilter.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/ReferredPagesPlugin.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/ReferringPagesPlugin.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/UndefinedPagesPlugin.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/UnusedPagesPlugin.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/search/LuceneSearchProvider.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkTag.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandler.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandlerUTF8.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/AllTests.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/AllTests.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/parser/JSPWikiMarkupParserTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/AllTests.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/TextUtilTest.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Thu Jul 23 10:52:40 2009
@@ -1,3 +1,15 @@
+2009-07-23 Janne Jalkanen <jalkanen@apache.org>
+
+        * 3.0.0-svn-135
+        
+        * Moved some classes from the top-level package to better places.
+        For example, JCRWikiPage => org.apache.wiki.content.jcr; 
+        ReferenceManager => org.apache.wiki.content.
+        
+        * PageNameResolvers now have their own package under .content.
+        
+        * Also moved around some test classes to their proper packages.
+        
 2009-07-23 Andrew Jaquith <ajaquith AT apache DOT org>
 
         * 3.0.0-svn-134

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/PageManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/PageManager.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/PageManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/PageManager.java Thu Jul 23 10:52:40 2009
@@ -26,10 +26,7 @@
 
 import org.apache.wiki.api.WikiException;
 import org.apache.wiki.api.WikiPage;
-import org.apache.wiki.content.ContentManager;
-import org.apache.wiki.content.PageAlreadyExistsException;
-import org.apache.wiki.content.PageNotFoundException;
-import org.apache.wiki.content.WikiPath;
+import org.apache.wiki.content.*;
 import org.apache.wiki.content.lock.PageLock;
 import org.apache.wiki.log.Logger;
 import org.apache.wiki.log.LoggerFactory;

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=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Thu Jul 23 10:52:40 2009
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "134";
+    public static final String     BUILD         = "135";
 
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java Thu Jul 23 10:52:40 2009
@@ -51,6 +51,9 @@
 import org.apache.wiki.auth.acl.DefaultAclManager;
 import org.apache.wiki.auth.authorize.GroupManager;
 import org.apache.wiki.content.*;
+import org.apache.wiki.content.resolver.EnglishPluralsPageNameResolver;
+import org.apache.wiki.content.resolver.PageNameResolver;
+import org.apache.wiki.content.resolver.SpecialPageNameResolver;
 import org.apache.wiki.diff.DifferenceManager;
 import org.apache.wiki.event.WikiEngineEvent;
 import org.apache.wiki.event.WikiEventListener;
@@ -1098,7 +1101,7 @@
      *  <p>If the page is a special page, then returns a direct URI
      *  to that page.  Otherwise returns <code>null</code>.
      *  This method delegates requests to
-     *  {@link org.apache.wiki.content.SpecialPageNameResolver#getSpecialPageURI}.
+     *  {@link org.apache.wiki.content.resolver.SpecialPageNameResolver#getSpecialPageURI}.
      *  </p>
      *  <p>
      *  Special pages are defined in jspwiki.properties using the jspwiki.specialPage
@@ -1347,7 +1350,7 @@
      */
     public String getText( String page )
     {
-        return getText( page, WikiPageProvider.LATEST_VERSION );
+        return getText( page, WikiProvider.LATEST_VERSION );
     }
 
     /**
@@ -1486,7 +1489,7 @@
     public String getHTML( String page ) 
         throws PageNotFoundException, ProviderException
     {
-        return getHTML( page, WikiPageProvider.LATEST_VERSION );
+        return getHTML( page, WikiProvider.LATEST_VERSION );
     }
 
     /**
@@ -1948,7 +1951,7 @@
 
         // Kludge to make diffs for new pages to work this way.
 
-        if( version1 == WikiPageProvider.LATEST_VERSION )
+        if( version1 == WikiProvider.LATEST_VERSION )
         {
             page1 = "";
         }

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiProvider.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiProvider.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiProvider.java Thu Jul 23 10:52:40 2009
@@ -32,9 +32,10 @@
 public interface WikiProvider
 {
     /**
-     *  Passing this to any method should get the latest version
+     *  Magic number for the latest version.
      */
-    public static final int LATEST_VERSION = -1;
+    
+    public static final  int   LATEST_VERSION     = -1;
 
     /**
      *  Initializes the page provider.

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/ViewActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/ViewActionBean.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/ViewActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/ViewActionBean.java Thu Jul 23 10:52:40 2009
@@ -108,7 +108,7 @@
      * special page names from <code>jspwiki.properties</code>, and possible
      * aliases. To determine whether the page is a special page, this method
      * calls
-     * {@link org.apache.wiki.content.SpecialPageNameResolver#getSpecialPageURI(String)}.
+     * {@link org.apache.wiki.content.resolver.SpecialPageNameResolver#getSpecialPageURI(String)}.
      * 
      * @return a {@link net.sourceforge.stripes.action.RedirectResolution} to
      *         the special page's real URL, if a special page was specified, or

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentManager.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentManager.java Thu Jul 23 10:52:40 2009
@@ -27,7 +27,6 @@
 import java.util.*;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.wiki.JCRWikiPage;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.WikiProvider;
@@ -35,6 +34,7 @@
 import org.apache.wiki.api.WikiPage;
 import org.apache.wiki.content.PageNotFoundException;
 import org.apache.wiki.content.WikiPath;
+import org.apache.wiki.content.jcr.JCRWikiPage;
 import org.apache.wiki.log.Logger;
 import org.apache.wiki.log.LoggerFactory;
 import org.apache.wiki.providers.ProviderException;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentServlet.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentServlet.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentServlet.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentServlet.java Thu Jul 23 10:52:40 2009
@@ -43,7 +43,10 @@
 import org.apache.commons.fileupload.ProgressListener;
 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.apache.commons.fileupload.servlet.ServletFileUpload;
-import org.apache.wiki.*;
+import org.apache.wiki.WikiContext;
+import org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiProvider;
+import org.apache.wiki.WikiSession;
 import org.apache.wiki.api.WikiException;
 import org.apache.wiki.api.WikiPage;
 import org.apache.wiki.auth.AuthorizationManager;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/DynamicAttachment.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/DynamicAttachment.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/DynamicAttachment.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/DynamicAttachment.java Thu Jul 23 10:52:40 2009
@@ -20,9 +20,9 @@
  */
 package org.apache.wiki.attachment;
 
-import org.apache.wiki.JCRWikiPage;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.content.WikiPath;
+import org.apache.wiki.content.jcr.JCRWikiPage;
 
 /**
  *  A DynamicAttachment is an attachment which does not really exist, but is

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=797012&r1=797011&r2=797012&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 Thu Jul 23 10:52:40 2009
@@ -50,6 +50,7 @@
 import org.apache.wiki.auth.acl.AclEntry;
 import org.apache.wiki.auth.acl.AclEntryImpl;
 import org.apache.wiki.auth.user.UserProfile;
+import org.apache.wiki.content.jcr.JCRWikiPage;
 import org.apache.wiki.content.lock.PageLock;
 import org.apache.wiki.event.*;
 import org.apache.wiki.log.Logger;
@@ -745,64 +746,7 @@
         return result;
     }
 
-    /**
-     *  Finds a WikiPage object describing a particular page and version.
-     *  
-     *  @param pageName  The name of the page
-     *  @param version   A version number
-     *  @return          A WikiPage object, or null, if the page does not exist
-     *  @throws ProviderException If there is something wrong with the page 
-     *                            name or the repository
-     */
-    /*
-    // FIXME: Remove.  Just exists to make sure that all the things that need
-    //        to be called are called.
-    public WikiPage getPage( String pageName, int version )
-        throws ProviderException
-    {
-        if( pageName == null || pageName.length() == 0 )
-        {
-            throw new ProviderException("Illegal page name '"+pageName+"'");
-        }
-
-        WikiPage page = null;
-
-        try
-        {
-            page = m_provider.getPageInfo( pageName, version );
-        }
-        catch( RepositoryModifiedException e )
-        {
-            //
-            //  This only occurs with the latest version.
-            //
-            log.info("Repository has been modified externally while fetching info for "+pageName );
 
-            page = m_provider.getPageInfo( pageName, version );
-
-            if( page != null )
-            {
-                m_engine.updateReferences( page );
-            }
-            else
-            {
-                m_engine.getReferenceManager().pageRemoved( new WikiPage(m_engine,pageName) );
-            }
-        }
-
-        //
-        //  Should update the metadata.
-        //
-        
-        if( page != null && !page.hasMetadata() )
-        {
-            WikiContext context = new WikiContext(m_engine,page);
-            m_engine.textToHTML( context, getPageText(pageName,version) );
-        }
-        
-        return page;
-    }
-*/
     /**
      *  Gets a version history of page.  Each element in the returned
      *  List is a WikiPage.
@@ -1034,8 +978,6 @@
     private void restore( JCRWikiPage page ) throws ProviderException, RepositoryException, PageAlreadyExistsException
     {
         JCRWikiPage original = page.getCurrentVersion();
-        WikiPath path = original.getPath();
-        String contentType = page.getContentType();
         
         Node origNode = original.getJCRNode();
 
@@ -1121,7 +1063,7 @@
 
                 for( Iterator<PageLock> i = entries.iterator(); i.hasNext(); )
                 {
-                    PageLock p = (PageLock) i.next();
+                    PageLock p = i.next();
 
                     if( now.after( p.getExpiryTime() ) )
                     {
@@ -1249,7 +1191,7 @@
             JCRWikiPage page;
             try
             {
-                page = (JCRWikiPage)engine.getContentManager().getPage( name );
+                page = engine.getContentManager().getPage( name );
             }
             catch( PageNotFoundException e )
             {
@@ -1363,10 +1305,8 @@
         //  Do the actual rename by changing from the frompage to the topage, including
         //  all of the attachments
         //
-        Workspace w;
         try
         {
-            w = getCurrentSession().getWorkspace();
             getCurrentSession().move( getJCRPath( fromPage ), getJCRPath( toPage ) );
             getCurrentSession().save();
         }
@@ -1494,7 +1434,6 @@
         
             Node nd = session.getRootNode().addNode( jcrPath );
             
-            //nd.addMixin( "mix:versionable" );
             nd.addMixin( "mix:referenceable" );
             nd.setProperty( JCRWikiPage.CONTENTTYPE, contentType );
             

Copied: incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ReferenceManager.java (from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/ReferenceManager.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ReferenceManager.java?p2=incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ReferenceManager.java&p1=incubator/jspwiki/trunk/src/java/org/apache/wiki/ReferenceManager.java&r1=796986&r2=797012&rev=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/ReferenceManager.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ReferenceManager.java Thu Jul 23 10:52:40 2009
@@ -18,7 +18,7 @@
     specific language governing permissions and limitations
     under the License.    
  */
-package org.apache.wiki;
+package org.apache.wiki.content;
 
 import java.io.IOException;
 import java.util.*;
@@ -27,16 +27,16 @@
 
 import javax.jcr.*;
 
+import org.apache.wiki.WikiContext;
+import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.WikiException;
 import org.apache.wiki.api.WikiPage;
-import org.apache.wiki.content.ContentManager;
-import org.apache.wiki.content.PageNotFoundException;
-import org.apache.wiki.content.WikiPath;
 import org.apache.wiki.event.*;
 import org.apache.wiki.modules.InternalModule;
 import org.apache.wiki.parser.JSPWikiMarkupParser;
 import org.apache.wiki.parser.MarkupParser;
 import org.apache.wiki.providers.ProviderException;
+import org.apache.wiki.util.LinkCollector;
 import org.apache.wiki.util.TextUtil;
 
 /**

Copied: incubator/jspwiki/trunk/src/java/org/apache/wiki/content/jcr/JCRWikiPage.java (from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/content/jcr/JCRWikiPage.java?p2=incubator/jspwiki/trunk/src/java/org/apache/wiki/content/jcr/JCRWikiPage.java&p1=incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java&r1=796986&r2=797012&rev=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/JCRWikiPage.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/content/jcr/JCRWikiPage.java Thu Jul 23 10:52:40 2009
@@ -18,7 +18,7 @@
     specific language governing permissions and limitations
     under the License.    
  */
-package org.apache.wiki;
+package org.apache.wiki.content.jcr;
 
 import java.io.*;
 import java.util.*;
@@ -28,6 +28,7 @@
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.version.VersionException;
 
+import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.WikiPage;
 import org.apache.wiki.attachment.Attachment;
 import org.apache.wiki.auth.acl.Acl;

Copied: incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/EnglishPluralsPageNameResolver.java (from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/content/EnglishPluralsPageNameResolver.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/EnglishPluralsPageNameResolver.java?p2=incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/EnglishPluralsPageNameResolver.java&p1=incubator/jspwiki/trunk/src/java/org/apache/wiki/content/EnglishPluralsPageNameResolver.java&r1=796986&r2=797012&rev=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/content/EnglishPluralsPageNameResolver.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/EnglishPluralsPageNameResolver.java Thu Jul 23 10:52:40 2009
@@ -18,9 +18,11 @@
     specific language governing permissions and limitations
     under the License.  
  */
-package org.apache.wiki.content;
+package org.apache.wiki.content.resolver;
 
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.content.ContentManager;
+import org.apache.wiki.content.WikiPath;
 import org.apache.wiki.providers.ProviderException;
 import org.apache.wiki.util.TextUtil;
 

Copied: incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/PageNameResolver.java (from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/content/PageNameResolver.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/PageNameResolver.java?p2=incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/PageNameResolver.java&p1=incubator/jspwiki/trunk/src/java/org/apache/wiki/content/PageNameResolver.java&r1=796986&r2=797012&rev=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/content/PageNameResolver.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/PageNameResolver.java Thu Jul 23 10:52:40 2009
@@ -18,9 +18,10 @@
     specific language governing permissions and limitations
     under the License.  
  */
-package org.apache.wiki.content;
+package org.apache.wiki.content.resolver;
 
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.content.WikiPath;
 import org.apache.wiki.providers.ProviderException;
 
 /**

Copied: incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/SpecialPageNameResolver.java (from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/content/SpecialPageNameResolver.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/SpecialPageNameResolver.java?p2=incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/SpecialPageNameResolver.java&p1=incubator/jspwiki/trunk/src/java/org/apache/wiki/content/SpecialPageNameResolver.java&r1=796986&r2=797012&rev=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/content/SpecialPageNameResolver.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/content/resolver/SpecialPageNameResolver.java Thu Jul 23 10:52:40 2009
@@ -18,7 +18,7 @@
     specific language governing permissions and limitations
     under the License.    
  */
-package org.apache.wiki.content;
+package org.apache.wiki.content.resolver;
 
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -27,6 +27,7 @@
 import java.util.Properties;
 
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.content.WikiPath;
 import org.apache.wiki.log.Logger;
 import org.apache.wiki.log.LoggerFactory;
 import org.apache.wiki.providers.ProviderException;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/SpamFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/SpamFilter.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/SpamFilter.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/filters/SpamFilter.java Thu Jul 23 10:52:40 2009
@@ -40,7 +40,10 @@
 import org.apache.commons.jrcs.diff.*;
 import org.apache.commons.jrcs.diff.myers.MyersDiff;
 import org.apache.commons.lang.time.StopWatch;
-import org.apache.wiki.*;
+import org.apache.wiki.InternalWikiException;
+import org.apache.wiki.WikiContext;
+import org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiProvider;
 import org.apache.wiki.action.WikiActionBean;
 import org.apache.wiki.action.WikiContextFactory;
 import org.apache.wiki.api.ModuleData;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/ReferredPagesPlugin.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/ReferredPagesPlugin.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/ReferredPagesPlugin.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/ReferredPagesPlugin.java Thu Jul 23 10:52:40 2009
@@ -28,6 +28,7 @@
 import org.apache.wiki.api.WikiPage;
 import org.apache.wiki.content.ContentManager;
 import org.apache.wiki.content.PageNotFoundException;
+import org.apache.wiki.content.ReferenceManager;
 import org.apache.wiki.content.WikiPath;
 import org.apache.wiki.log.Logger;
 import org.apache.wiki.log.LoggerFactory;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/ReferringPagesPlugin.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/ReferringPagesPlugin.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/ReferringPagesPlugin.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/ReferringPagesPlugin.java Thu Jul 23 10:52:40 2009
@@ -26,11 +26,11 @@
 import java.util.Map;
 import java.util.ResourceBundle;
 
-import org.apache.wiki.ReferenceManager;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.api.PluginException;
 import org.apache.wiki.api.WikiPage;
 import org.apache.wiki.content.PageNotFoundException;
+import org.apache.wiki.content.ReferenceManager;
 import org.apache.wiki.content.WikiPath;
 import org.apache.wiki.log.Logger;
 import org.apache.wiki.log.LoggerFactory;

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/UndefinedPagesPlugin.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/UndefinedPagesPlugin.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/UndefinedPagesPlugin.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/UndefinedPagesPlugin.java Thu Jul 23 10:52:40 2009
@@ -24,9 +24,9 @@
 
 import javax.jcr.RepositoryException;
 
-import org.apache.wiki.ReferenceManager;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.api.PluginException;
+import org.apache.wiki.content.ReferenceManager;
 import org.apache.wiki.content.WikiPath;
 
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/UnusedPagesPlugin.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/UnusedPagesPlugin.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/UnusedPagesPlugin.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/plugin/UnusedPagesPlugin.java Thu Jul 23 10:52:40 2009
@@ -24,9 +24,9 @@
 
 import javax.jcr.RepositoryException;
 
-import org.apache.wiki.ReferenceManager;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.api.PluginException;
+import org.apache.wiki.content.ReferenceManager;
 import org.apache.wiki.content.WikiPath;
 import org.apache.wiki.util.TextUtil;
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/search/LuceneSearchProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/search/LuceneSearchProvider.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/search/LuceneSearchProvider.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/search/LuceneSearchProvider.java Thu Jul 23 10:52:40 2009
@@ -24,7 +24,6 @@
 import java.util.*;
 
 import org.apache.commons.lang.StringUtils;
-
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.document.Document;
@@ -45,7 +44,10 @@
 import org.apache.lucene.search.highlight.SimpleHTMLFormatter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
-import org.apache.wiki.*;
+import org.apache.wiki.InternalWikiException;
+import org.apache.wiki.NoRequiredPropertyException;
+import org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiProvider;
 import org.apache.wiki.api.WikiPage;
 import org.apache.wiki.attachment.Attachment;
 import org.apache.wiki.attachment.AttachmentManager;
@@ -56,7 +58,6 @@
 import org.apache.wiki.log.LoggerFactory;
 import org.apache.wiki.parser.MarkupParser;
 import org.apache.wiki.providers.ProviderException;
-import org.apache.wiki.providers.WikiPageProvider;
 import org.apache.wiki.util.*;
 
 
@@ -590,7 +591,7 @@
                 WikiPage page;
                 try
                 {
-                    page = m_engine.getPage(pageName, WikiPageProvider.LATEST_VERSION);
+                    page = m_engine.getPage(pageName, WikiProvider.LATEST_VERSION);
                     if(page.isAttachment())
                     {
                         // Currently attachments don't look nice on the search-results page

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkTag.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkTag.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkTag.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/tags/LinkTag.java Thu Jul 23 10:52:40 2009
@@ -29,7 +29,9 @@
 import javax.servlet.jsp.tagext.BodyContent;
 import javax.servlet.jsp.tagext.BodyTag;
 
-import org.apache.wiki.*;
+import org.apache.wiki.WikiContext;
+import org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiProvider;
 import org.apache.wiki.api.WikiPage;
 import org.apache.wiki.content.PageNotFoundException;
 import org.apache.wiki.content.WikiPath;

Copied: incubator/jspwiki/trunk/src/java/org/apache/wiki/util/LinkCollector.java (from r796986, incubator/jspwiki/trunk/src/java/org/apache/wiki/LinkCollector.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/util/LinkCollector.java?p2=incubator/jspwiki/trunk/src/java/org/apache/wiki/util/LinkCollector.java&p1=incubator/jspwiki/trunk/src/java/org/apache/wiki/LinkCollector.java&r1=796986&r2=797012&rev=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/LinkCollector.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/util/LinkCollector.java Thu Jul 23 10:52:40 2009
@@ -18,12 +18,12 @@
     specific language governing permissions and limitations
     under the License.    
  */
-package org.apache.wiki;
+package org.apache.wiki.util;
 
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.wiki.util.StringTransmutator;
+import org.apache.wiki.WikiContext;
 
 /**
  *  Just a simple class collecting all of the links

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=797012&r1=797011&r2=797012&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 Thu Jul 23 10:52:40 2009
@@ -32,6 +32,7 @@
 import org.apache.wiki.log.Logger;
 import org.apache.wiki.log.LoggerFactory;
 import org.apache.wiki.providers.ProviderException;
+import org.apache.wiki.util.LinkCollector;
 import org.apache.wiki.util.TextUtil;
 import org.apache.xmlrpc.XmlRpcException;
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandlerUTF8.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandlerUTF8.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandlerUTF8.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/xmlrpc/RPCHandlerUTF8.java Thu Jul 23 10:52:40 2009
@@ -22,7 +22,6 @@
 
 import java.util.*;
 
-import org.apache.wiki.LinkCollector;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.WikiPage;
@@ -30,6 +29,7 @@
 import org.apache.wiki.auth.permissions.PermissionFactory;
 import org.apache.wiki.content.PageNotFoundException;
 import org.apache.wiki.providers.ProviderException;
+import org.apache.wiki.util.LinkCollector;
 import org.apache.xmlrpc.XmlRpcException;
 
 

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/AllTests.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/AllTests.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/AllTests.java Thu Jul 23 10:52:40 2009
@@ -37,11 +37,7 @@
     {
         TestSuite suite = new TestSuite("JSPWiki Unit Tests");
 
-        suite.addTest( FileUtilTest.suite() );
-        suite.addTest( PropertyReaderTest.suite() );
-        suite.addTest( ReferenceManagerTest.suite() );
         suite.addTest( ReleaseTest.suite() );
-        suite.addTest( TextUtilTest.suite() );
         suite.addTest( VariableManagerTest.suite() );
         // This is obsolete and not maintained anymore
         // suite.addTest( TranslatorReaderTest.suite() );

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/AllTests.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/AllTests.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/AllTests.java Thu Jul 23 10:52:40 2009
@@ -21,6 +21,9 @@
 
 package org.apache.wiki.content;
 
+import org.apache.wiki.content.resolver.EnglishPluralsPageNameResolverTest;
+import org.apache.wiki.content.resolver.SpecialPageNameResolverTest;
+
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -39,9 +42,9 @@
         suite.addTest( PageRenamerTest.suite() );
         suite.addTest( WikiPathTest.suite() );
         suite.addTest( ContentManagerTest.suite() );
-        suite.addTest( SpecialPageNameResolverTest.suite() );
-        suite.addTest( EnglishPluralsPageNameResolverTest.suite() );
-        
+        suite.addTest( ReferenceManagerTest.suite() );
+        suite.addTest( org.apache.wiki.content.resolver.AllTests.suite() );
+
         return suite;
     }
 }

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java Thu Jul 23 10:52:40 2009
@@ -125,7 +125,7 @@
         
         refs = findReferrers( "FooTest" );
         assertEquals( "new size", 1, refs.size() );
-        assertEquals( "wrong ref", "TestPage2", (WikiPath)refs.iterator().next() );
+        assertEquals( "wrong ref", "TestPage2", refs.iterator().next() );
     }
 
     public void testReferrerChangeCC()
@@ -149,7 +149,7 @@
         
         refs = findReferrers( "FooTest" );
         assertEquals( "new size", 1, refs.size() );
-        assertEquals( "wrong ref", "TestPage2", (WikiPath)refs.iterator().next() );
+        assertEquals( "wrong ref", "TestPage2", refs.iterator().next() );
     }
     
     public void testReferrerChangeAnchor()

Copied: incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/ReferenceManagerTest.java (from r796986, incubator/jspwiki/trunk/tests/java/org/apache/wiki/ReferenceManagerTest.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/ReferenceManagerTest.java?p2=incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/ReferenceManagerTest.java&p1=incubator/jspwiki/trunk/tests/java/org/apache/wiki/ReferenceManagerTest.java&r1=796986&r2=797012&rev=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/ReferenceManagerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/ReferenceManagerTest.java Thu Jul 23 10:52:40 2009
@@ -19,7 +19,7 @@
     under the License.    
  */
 
-package org.apache.wiki;
+package org.apache.wiki.content;
 
 import java.util.*;
 
@@ -32,8 +32,10 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.apache.wiki.TestEngine;
 import org.apache.wiki.api.WikiException;
 import org.apache.wiki.content.ContentManager;
+import org.apache.wiki.content.ReferenceManager;
 import org.apache.wiki.content.WikiPath;
 import org.apache.wiki.providers.ProviderException;
 

Added: incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/AllTests.java?rev=797012&view=auto
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/AllTests.java (added)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/AllTests.java Thu Jul 23 10:52:40 2009
@@ -0,0 +1,44 @@
+/*
+    JSPWiki - a JSP-based WikiWiki clone.
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.    
+ */
+
+package org.apache.wiki.content.resolver;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class AllTests extends TestCase
+{
+    public AllTests( String s )
+    {
+        super( s );
+    }
+
+    public static Test suite()
+    {
+        TestSuite suite = new TestSuite("JSPWiki Content Resolver Unit Tests");
+
+        suite.addTest( SpecialPageNameResolverTest.suite() );
+        suite.addTest( EnglishPluralsPageNameResolverTest.suite() );
+
+        return suite;
+    }
+}

Copied: incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/EnglishPluralsPageNameResolverTest.java (from r796986, incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/EnglishPluralsPageNameResolverTest.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/EnglishPluralsPageNameResolverTest.java?p2=incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/EnglishPluralsPageNameResolverTest.java&p1=incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/EnglishPluralsPageNameResolverTest.java&r1=796986&r2=797012&rev=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/EnglishPluralsPageNameResolverTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/EnglishPluralsPageNameResolverTest.java Thu Jul 23 10:52:40 2009
@@ -18,7 +18,7 @@
     specific language governing permissions and limitations
     under the License.  
  */
-package org.apache.wiki.content;
+package org.apache.wiki.content.resolver;
 
 import java.util.Properties;
 
@@ -28,6 +28,8 @@
 
 import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.content.WikiPath;
+import org.apache.wiki.content.resolver.EnglishPluralsPageNameResolver;
 
 public class EnglishPluralsPageNameResolverTest extends TestCase
 {

Copied: incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/SpecialPageNameResolverTest.java (from r796986, incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/SpecialPageNameResolverTest.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/SpecialPageNameResolverTest.java?p2=incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/SpecialPageNameResolverTest.java&p1=incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/SpecialPageNameResolverTest.java&r1=796986&r2=797012&rev=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/SpecialPageNameResolverTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/resolver/SpecialPageNameResolverTest.java Thu Jul 23 10:52:40 2009
@@ -19,13 +19,14 @@
     under the License.      
  */
 
-package org.apache.wiki.content;
+package org.apache.wiki.content.resolver;
 
 import java.net.URI;
 import java.util.Properties;
 
 import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.content.resolver.SpecialPageNameResolver;
 
 import junit.framework.Test;
 import junit.framework.TestCase;

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/parser/JSPWikiMarkupParserTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/parser/JSPWikiMarkupParserTest.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/parser/JSPWikiMarkupParserTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/parser/JSPWikiMarkupParserTest.java Thu Jul 23 10:52:40 2009
@@ -37,6 +37,7 @@
 import org.apache.wiki.content.WikiPath;
 import org.apache.wiki.providers.ProviderException;
 import org.apache.wiki.render.XHTMLRenderer;
+import org.apache.wiki.util.LinkCollector;
 import org.apache.wiki.util.TextUtil;
 
 import stress.Benchmark;

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/AllTests.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/AllTests.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/AllTests.java Thu Jul 23 10:52:40 2009
@@ -22,9 +22,9 @@
 package org.apache.wiki.util;
 
 
-import org.apache.wiki.ui.migrator.JspParserTest;
-
-import junit.framework.*;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
 
 public class AllTests extends TestCase
 {
@@ -37,10 +37,13 @@
     {
         TestSuite suite = new TestSuite("Utility suite tests");
 
+        suite.addTest( FileUtilTest.suite() );
+        suite.addTest( TextUtilTest.suite() );
+        suite.addTest( PropertyReaderTest.suite() );
+
         suite.addTest( ClassUtilTest.suite() );
         suite.addTest( CommentedPropertiesTest.suite() );
         suite.addTest( CryptoUtilTest.suite() );
-        suite.addTest( JspParserTest.suite() );
         suite.addTest( MailUtilTest.suite() );
         suite.addTest( PriorityListTest.suite() );
         suite.addTest( SerializerTest.suite() );

Copied: incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/FileUtilTest.java (from r796986, incubator/jspwiki/trunk/tests/java/org/apache/wiki/FileUtilTest.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/FileUtilTest.java?p2=incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/FileUtilTest.java&p1=incubator/jspwiki/trunk/tests/java/org/apache/wiki/FileUtilTest.java&r1=796986&r2=797012&rev=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/FileUtilTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/FileUtilTest.java Thu Jul 23 10:52:40 2009
@@ -19,7 +19,7 @@
     under the License.    
  */
 
-package org.apache.wiki;
+package org.apache.wiki.util;
 
 import junit.framework.*;
 import java.io.*;

Copied: incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/PropertyReaderTest.java (from r796986, incubator/jspwiki/trunk/tests/java/org/apache/wiki/PropertyReaderTest.java)
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/PropertyReaderTest.java?p2=incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/PropertyReaderTest.java&p1=incubator/jspwiki/trunk/tests/java/org/apache/wiki/PropertyReaderTest.java&r1=796986&r2=797012&rev=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/PropertyReaderTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/PropertyReaderTest.java Thu Jul 23 10:52:40 2009
@@ -18,7 +18,7 @@
     specific language governing permissions and limitations
     under the License.    
  */
-package org.apache.wiki;
+package org.apache.wiki.util;
 
 import java.util.Properties;
 

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/TextUtilTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/TextUtilTest.java?rev=797012&r1=797011&r2=797012&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/TextUtilTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/util/TextUtilTest.java Thu Jul 23 10:52:40 2009
@@ -21,6 +21,8 @@
 package org.apache.wiki.util;
 
 
+import java.util.Properties;
+
 import org.apache.wiki.util.TextUtil;
 
 import junit.framework.*;
@@ -40,6 +42,338 @@
         }
     }
 
+    public void testEncodeName_1()
+    {
+        String name = "Hello/World";
+
+        assertEquals( "Hello/World",
+                      TextUtil.urlEncode(name,"ISO-8859-1") );
+    }
+
+    public void testEncodeName_2()
+    {
+        String name = "Hello~World";
+
+        assertEquals( "Hello%7EWorld",
+                      TextUtil.urlEncode(name,"ISO-8859-1") );
+    }
+
+    public void testEncodeName_3()
+    {
+        String name = "Hello/World ~";
+
+        assertEquals( "Hello/World+%7E",
+                      TextUtil.urlEncode(name,"ISO-8859-1") );
+    }
+
+    public void testDecodeName_1()
+         throws Exception
+    {
+        String name = "Hello/World+%7E+%2F";
+
+        assertEquals( "Hello/World ~ /",
+                      TextUtil.urlDecode(name,"ISO-8859-1") );
+    }
+
+    public void testEncodeNameUTF8_1()
+    {
+        String name = "\u0041\u2262\u0391\u002E";
+
+        assertEquals( "A%E2%89%A2%CE%91.",
+                      TextUtil.urlEncodeUTF8(name) );
+    }
+
+    public void testEncodeNameUTF8_2()
+    {
+        String name = "\uD55C\uAD6D\uC5B4";
+
+        assertEquals( "%ED%95%9C%EA%B5%AD%EC%96%B4",
+                      TextUtil.urlEncodeUTF8(name) );
+    }
+
+    public void testEncodeNameUTF8_3()
+    {
+        String name = "\u65E5\u672C\u8A9E";
+
+        assertEquals( "%E6%97%A5%E6%9C%AC%E8%AA%9E",
+                      TextUtil.urlEncodeUTF8(name) );
+    }
+
+    public void testEncodeNameUTF8_4()
+    {
+        String name = "Hello World";
+
+        assertEquals( "Hello+World",
+                      TextUtil.urlEncodeUTF8(name) );
+    }
+
+    public void testDecodeNameUTF8_1()
+    {
+        String name = "A%E2%89%A2%CE%91.";
+
+        assertEquals( "\u0041\u2262\u0391\u002E",
+                      TextUtil.urlDecodeUTF8(name) );
+    }
+
+    public void testDecodeNameUTF8_2()
+    {
+        String name = "%ED%95%9C%EA%B5%AD%EC%96%B4";
+
+        assertEquals( "\uD55C\uAD6D\uC5B4",
+                      TextUtil.urlDecodeUTF8(name) );
+    }
+
+    public void testDecodeNameUTF8_3()
+    {
+        String name = "%E6%97%A5%E6%9C%AC%E8%AA%9E";
+
+        assertEquals( "\u65E5\u672C\u8A9E",
+                      TextUtil.urlDecodeUTF8(name) );
+    }
+
+    public void testReplaceString1()
+    {
+        String text = "aabacaa";
+
+        assertEquals( "ddbacdd", TextUtil.replaceString( text, "aa", "dd" ) ); 
+    }
+
+    public void testReplaceString4()
+    {
+        String text = "aabacaafaa";
+
+        assertEquals( "ddbacddfdd", TextUtil.replaceString( text, "aa", "dd" ) ); 
+    }
+
+    public void testReplaceString5()
+    {
+        String text = "aaabacaaafaa";
+
+        assertEquals( "dbacdfaa", TextUtil.replaceString( text, "aaa", "d" ) );     
+    }
+
+    public void testReplaceString2()
+    {
+        String text = "abcde";
+
+        assertEquals( "fbcde", TextUtil.replaceString( text, "a", "f" ) ); 
+    }
+
+    public void testReplaceString3()
+    {
+        String text = "ababab";
+
+        assertEquals( "afafaf", TextUtil.replaceString( text, "b", "f" ) ); 
+    }
+    
+    public void testReplaceStringCaseUnsensitive1()
+    {
+        String text = "aABcAa";
+
+        assertEquals( "ddBcdd", TextUtil.replaceStringCaseUnsensitive( text, "aa", "dd" ) ); 
+    }
+
+    public void testReplaceStringCaseUnsensitive2()
+    {
+        String text = "Abcde";
+
+        assertEquals( "fbcde", TextUtil.replaceStringCaseUnsensitive( text, "a", "f" ) ); 
+    }
+
+    public void testReplaceStringCaseUnsensitive3()
+    {
+        String text = "aBAbab";
+
+        assertEquals( "afAfaf", TextUtil.replaceStringCaseUnsensitive( text, "b", "f" ) ); 
+    }
+    
+    public void testReplaceStringCaseUnsensitive4()
+    {
+        String text = "AaBAcAAfaa";
+
+        assertEquals( "ddBAcddfdd", TextUtil.replaceStringCaseUnsensitive( text, "aa", "dd" ) ); 
+    }
+
+    public void testReplaceStringCaseUnsensitive5()
+    {
+        String text = "aAaBaCAAafaa";
+
+        assertEquals( "dBaCdfaa", TextUtil.replaceStringCaseUnsensitive( text, "aaa", "d" ) );     
+    }
+
+    // Pure UNIX.
+    public void testNormalizePostdata1()
+    {
+        String text = "ab\ncd";
+
+        assertEquals( "ab\r\ncd\r\n", TextUtil.normalizePostData( text ) );
+    }
+
+    // Pure MSDOS.
+    public void testNormalizePostdata2()
+    {
+        String text = "ab\r\ncd";
+
+        assertEquals( "ab\r\ncd\r\n", TextUtil.normalizePostData( text ) );
+    }
+
+    // Pure Mac
+    public void testNormalizePostdata3()
+    {
+        String text = "ab\rcd";
+
+        assertEquals( "ab\r\ncd\r\n", TextUtil.normalizePostData( text ) );
+    }
+
+    // Mixed, ending correct.
+    public void testNormalizePostdata4()
+    {
+        String text = "ab\ncd\r\n\r\n\r";
+
+        assertEquals( "ab\r\ncd\r\n\r\n\r\n", TextUtil.normalizePostData( text ) );
+    }
+
+    // Multiple newlines
+    public void testNormalizePostdata5()
+    {
+        String text = "ab\ncd\n\n\n\n";
+
+        assertEquals( "ab\r\ncd\r\n\r\n\r\n\r\n", TextUtil.normalizePostData( text ) );
+    }
+
+    // Empty.
+    public void testNormalizePostdata6()
+    {
+        String text = "";
+
+        assertEquals( "\r\n", TextUtil.normalizePostData( text ) );
+    }
+
+    // Just a newline.
+    public void testNormalizePostdata7()
+    {
+        String text = "\n";
+
+        assertEquals( "\r\n", TextUtil.normalizePostData( text ) );
+    }
+
+    public void testGetBooleanProperty()
+    {
+        Properties props = new Properties();
+
+        props.setProperty("foobar.0", "YES");
+        props.setProperty("foobar.1", "true");
+        props.setProperty("foobar.2", "false");
+        props.setProperty("foobar.3", "no");
+        props.setProperty("foobar.4", "on");
+        props.setProperty("foobar.5", "OFF");
+        props.setProperty("foobar.6", "gewkjoigew");
+
+        assertTrue( "foobar.0", 
+                    TextUtil.getBooleanProperty( props, "foobar.0", false ) );
+        assertTrue( "foobar.1", 
+                    TextUtil.getBooleanProperty( props, "foobar.1", false ) );
+
+        assertFalse( "foobar.2", 
+                     TextUtil.getBooleanProperty( props, "foobar.2", true ) );
+        assertFalse( "foobar.3", 
+                    TextUtil.getBooleanProperty( props, "foobar.3", true ) );
+        assertTrue( "foobar.4", 
+                    TextUtil.getBooleanProperty( props, "foobar.4", false ) );
+
+        assertFalse( "foobar.5", 
+                     TextUtil.getBooleanProperty( props, "foobar.5", true ) );
+
+        assertFalse( "foobar.6", 
+                     TextUtil.getBooleanProperty( props, "foobar.6", true ) );
+
+
+    }
+
+    public void testGetSection1()
+        throws Exception
+    {
+        String src = "Single page.";
+
+        assertEquals( "section 1", src, TextUtil.getSection(src,1) );
+
+        try
+        {
+            TextUtil.getSection( src, 5 );
+            fail("Did not get exception for 2");
+        }
+        catch( IllegalArgumentException e ) {}
+
+        try
+        {
+            TextUtil.getSection( src, -1 );
+            fail("Did not get exception for -1");
+        }
+        catch( IllegalArgumentException e ) {}
+    }
+
+    public void testGetSection2()
+        throws Exception
+    {
+        String src = "First section\n----\nSecond section\n\n----\n\nThird section";
+
+        assertEquals( "section 1", "First section\n", TextUtil.getSection(src,1) );
+        assertEquals( "section 2", "\nSecond section\n\n", TextUtil.getSection(src,2) );
+        assertEquals( "section 3", "\n\nThird section", TextUtil.getSection(src,3) );
+
+        try
+        {
+            TextUtil.getSection( src, 4 );
+            fail("Did not get exception for section 4");
+        }
+        catch( IllegalArgumentException e ) {}
+    }
+
+    public void testGetSection3()
+        throws Exception
+    {
+        String src = "----\nSecond section\n----";
+
+        
+        assertEquals( "section 1", "", TextUtil.getSection(src,1) );
+        assertEquals( "section 2", "\nSecond section\n", TextUtil.getSection(src,2) );
+        assertEquals( "section 3", "", TextUtil.getSection(src,3) );
+
+        try
+        {
+            TextUtil.getSection( src, 4 );
+            fail("Did not get exception for section 4");
+        }
+        catch( IllegalArgumentException e ) {}
+    }
+
+    public void testGetSectionWithMoreThanFourDashes() throws Exception
+    {
+        String src = "----------------\nSecond section\n----";
+
+        assertEquals("section 2", "\nSecond section\n", TextUtil.getSection(src, 2));
+    }
+    
+    public void testBooleanParameter()
+       throws Exception
+    {
+        assertEquals( "1", true, TextUtil.isPositive(" true ") );
+        assertEquals( "2", false, TextUtil.isPositive(" fewqkfow kfpokwe ") );
+        assertEquals( "3", true, TextUtil.isPositive("on") );
+        assertEquals( "4", true, TextUtil.isPositive("\t\ton") );
+    }
+    
+    public void testTrimmedProperty()
+    {
+        String[] vals = { "foo", " this is a property ", "bar", "60" };
+        
+        Properties props = TextUtil.createProperties(vals);
+        
+        assertEquals( "foo", "this is a property", TextUtil.getStringProperty(props,"foo","") );
+        assertEquals( "bar", 60, TextUtil.getIntegerProperty(props,"bar",0) );
+    }
+    
+
     public static Test suite()
     {
         return new TestSuite( TextUtilTest.class );



Mime
View raw message