You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ja...@apache.org on 2008/12/09 20:09:43 UTC

svn commit: r724836 - in /incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH: src/com/ecyrd/jspwiki/content/WikiName.java tests/com/ecyrd/jspwiki/content/AllTests.java tests/com/ecyrd/jspwiki/content/WikiNameTest.java

Author: jalkanen
Date: Tue Dec  9 11:09:42 2008
New Revision: 724836

URL: http://svn.apache.org/viewvc?rev=724836&view=rev
Log:
Merged with trunk 724833.

Added:
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/tests/com/ecyrd/jspwiki/content/WikiNameTest.java
      - copied unchanged from r724834, incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/content/WikiNameTest.java
Modified:
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/content/WikiName.java
    incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/tests/com/ecyrd/jspwiki/content/AllTests.java

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/content/WikiName.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/content/WikiName.java?rev=724836&r1=724835&r2=724836&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/content/WikiName.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/src/com/ecyrd/jspwiki/content/WikiName.java Tue Dec  9 11:09:42 2008
@@ -104,6 +104,26 @@
     }
     
     /**
+     *  Resolves a path with respect to this WikiName.  This is typically used
+     *  when figuring out where a subpage should be pointing at.
+     *  
+     *  @param path Path to resolve
+     *  @return A new WikiName
+     */
+    public WikiName resolve( String path )
+    {
+        int colon = path.indexOf( ':' );
+        
+        if( colon != -1 )
+        {
+            // It is a FQN, essentially an absolute path, so no resolution necessary
+            return WikiName.valueOf( path );
+        }
+        
+        return new WikiName( getSpace(), path );
+    }
+    
+    /**
      *  Returns the FQN format (space:path) of the name.
      *  
      *  @return The name in FQN format.

Modified: incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/tests/com/ecyrd/jspwiki/content/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/tests/com/ecyrd/jspwiki/content/AllTests.java?rev=724836&r1=724835&r2=724836&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/tests/com/ecyrd/jspwiki/content/AllTests.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_JCR_BRANCH/tests/com/ecyrd/jspwiki/content/AllTests.java Tue Dec  9 11:09:42 2008
@@ -17,6 +17,8 @@
         TestSuite suite = new TestSuite("JSPWiki Content Unit Tests");
 
         suite.addTest( PageRenamerTest.suite() );
+        suite.addTest( WikiNameTest.suite() );
+        suite.addTest( ContentManagerTest.suite() );
         
         return suite;
     }