jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juanpa...@apache.org
Subject svn commit: r1097130 - in /incubator/jspwiki/trunk: ./ src/java/org/apache/wiki/ src/java/org/apache/wiki/action/ src/java/org/apache/wiki/content/ tests/java/org/apache/wiki/ tests/java/org/apache/wiki/auth/ tests/java/org/apache/wiki/plugin/
Date Wed, 27 Apr 2011 14:29:45 GMT
Author: juanpablo
Date: Wed Apr 27 14:29:45 2011
New Revision: 1097130

URL: http://svn.apache.org/viewvc?rev=1097130&view=rev
Log:
3.0.0-svn-227: fixes JSPWIKI-636

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/WikiContextFactory.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/content/ContentManager.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestEngine.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/AuthenticationManagerTest.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=1097130&r1=1097129&r2=1097130&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Wed Apr 27 14:29:45 2011
@@ -1,3 +1,15 @@
+2011-04-27  Juan Pablo Santos (juanpablo AT apache DOT org)
+        
+        * 3.0.0-svn-227
+        
+        * JSPWIKI-636: fixed DefaultAclManagerTest.testPrintAcl(). Saving pages involves
calling 
+        RenderingManager.getRenderedDocument(), which can return cached or non-cached WikiDocuments.
In  
+        the first case, ACLs were not associated to current WikiPage, whereas in the second
one yes
+        (DefaultAclManager.parseAcl() is called as part of MarkupParser.parse()). 
+        
+        * JSPWIKI-636: 27 tests where locale-dependant (test assertions assumed english locale),
so
+        TestEngine and WikiContextFactory enforce it when building mock requests.
+
 2011-04-03  Harry Metske <metskem@apache.org>
 
         * 3.0.0-svn-226

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=1097130&r1=1097129&r2=1097130&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Wed Apr 27 14:29:45 2011
@@ -77,7 +77,7 @@ public final class Release
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "226";
+    public static final String     BUILD         = "227";
 
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/WikiContextFactory.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/WikiContextFactory.java?rev=1097130&r1=1097129&r2=1097130&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/WikiContextFactory.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/WikiContextFactory.java Wed Apr
27 14:29:45 2011
@@ -22,10 +22,7 @@
 package org.apache.wiki.action;
 
 import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
+import java.util.*;
 
 import javax.servlet.ServletRequest;
 import javax.servlet.http.HttpServletRequest;
@@ -342,6 +339,7 @@ public final class WikiContextFactory
         {
             request = new MockHttpServletRequest( m_mockContextPath, "/Wiki.jsp" );
             MockHttpSession session = new MockHttpSession( m_engine.getServletContext() );
+            ((MockHttpServletRequest) request).addLocale( new Locale("") );
             ((MockHttpServletRequest) request).setSession( session );
         }
 

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=1097130&r1=1097129&r2=1097130&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 Wed Apr 27
14:29:45 2011
@@ -1448,7 +1448,9 @@ public class ContentManager implements W
             {
                 WikiContext context = engine.getWikiContextFactory().newViewContext( page
);
                 engine.getPage( page.getName() );
-                engine.textToHTML( context, text );
+                engine.textToHTML( context, text ); // may use cached HTML; in that case,
ACLs don't get associated to WikiPage
+                // force re-parsing of ACLs, and set them in the page, if any
+                engine.getRenderingManager().getParser( context, text ).parse();
                 engine.getFilterManager().doPostSaveFiltering( context, text );
             }
             catch( PageNotFoundException e )
@@ -1456,6 +1458,11 @@ public class ContentManager implements W
                 e.printStackTrace();
                 throw new WikiException( e.getMessage(), e );
             }
+            catch ( IOException ioe ) 
+            {
+                log.error( "unable to parse", ioe );
+                throw new WikiException( ioe.getMessage(), ioe );
+            }
             return Outcome.STEP_COMPLETE;
         }
     }

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestEngine.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestEngine.java?rev=1097130&r1=1097129&r2=1097130&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestEngine.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/TestEngine.java Wed Apr 27 14:29:45
2011
@@ -171,6 +171,7 @@ public class TestEngine extends WikiEngi
     public MockHttpServletRequest newHttpRequest( String path )
     {
         MockHttpServletRequest request = new MockHttpServletRequest( "/JSPWiki", path );
+        request.addLocale( new Locale( "" ) );
         request.setSession( new MockHttpSession( this.getServletContext() ) );
         return request;
     }

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/AuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/AuthenticationManagerTest.java?rev=1097130&r1=1097129&r2=1097130&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/AuthenticationManagerTest.java
(original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/auth/AuthenticationManagerTest.java
Wed Apr 27 14:29:45 2011
@@ -181,6 +181,7 @@ public class AuthenticationManagerTest e
         AuthenticationManager authMgr = engine.getAuthenticationManager();
         assertEquals( CookieAssertionLoginModule.class, authMgr.m_loginModuleClass );
         engine.shutdown();
+        m_engine = new TestEngine( props ); // so that m_engine.shutdown() in tearDown()
doesn't yield an InternalWikiException
     }
 
     public void testCustomJAASLoginModuleOptions() throws Exception
@@ -207,6 +208,7 @@ public class AuthenticationManagerTest e
         assertEquals( "value2", options.get( "key2" ) );
         assertEquals( "value3", options.get( "key3" ) );
         engine.shutdown();
+        m_engine = new TestEngine( props ); // so that m_engine.shutdown() in tearDown()
doesn't yield an InternalWikiException
     }
 
     public void testIsUserPrincipal()

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=1097130&r1=1097129&r2=1097130&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
Wed Apr 27 14:29:45 2011
@@ -22,6 +22,7 @@
 package org.apache.wiki.plugin;
 
 import java.text.SimpleDateFormat;
+import java.util.Locale;
 import java.util.Properties;
 
 import junit.framework.Test;
@@ -198,7 +199,7 @@ public class ReferringPagesPluginTest ex
         
         String dateString = result.substring(result.indexOf("(")+1,result.indexOf(")"));
         // the date should be parseable:
-        SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss dd-MMM-yyyy zzz");
+        SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss dd-MMM-yyyy zzz", new Locale(
"" ) ); // Locale fixed in TestEngine:174
         df.parse(dateString);
 
         // test if the proper exception is thrown:



Mime
View raw message