jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajaqu...@apache.org
Subject svn commit: r889524 - in /incubator/jspwiki/trunk: ./ src/java/org/apache/wiki/ src/java/org/apache/wiki/action/ tests/java/org/apache/wiki/action/ tests/java/org/apache/wiki/ui/migrator/ tests/java/org/apache/wiki/ui/stripes/
Date Fri, 11 Dec 2009 07:39:42 GMT
Author: ajaquith
Date: Fri Dec 11 07:39:41 2009
New Revision: 889524

URL: http://svn.apache.org/viewvc?rev=889524&view=rev
Log:
3.0.0-svn-190. Unit test fixes. Back up to 97.3% pass rate. Page-renaming, references and
related plugins are still messed up, but the stuff I messed up a few checkins ago is fixed.

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiContext.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DiffActionBean.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/action/GroupActionBean.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/DiffActionBeanTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/EditActionBeanTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/GroupActionBeanTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/migrator/JSPWikiJspTransformerTest.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/HandlerInfoTest.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=889524&r1=889523&r2=889524&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Fri Dec 11 07:39:41 2009
@@ -1,3 +1,9 @@
+2009-12-10 Andrew Jaquith <ajaquith AT apache DOT org>
+
+        * 3.0.0-svn-190. Unit test fixes. Back up to 97.3% pass rate.
+        Page-renaming, references and related plugins are still messed up,
+        but the stuff I messed up a few checkins ago is fixed. 
+
 2009-12-03 Janne Jalkanen <jalkanen@apache.org>
 
         * 3.0.0-svn-189

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=889524&r1=889523&r2=889524&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Fri Dec 11 07:39:41 2009
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "189";
+    public static final String     BUILD         = "190";
 
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiContext.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiContext.java?rev=889524&r1=889523&r2=889524&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiContext.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiContext.java Fri Dec 11 07:39:41
2009
@@ -68,7 +68,7 @@
     public static final String    WORKFLOW = HandlerInfo.getHandlerInfo( WorkflowActionBean.class,
"view" ).getRequestContext();
 
     /** The EDIT context - the user is editing the page. */
-    public static final String    EDIT     = HandlerInfo.getHandlerInfo( EditActionBean.class,
"edit" ).getRequestContext();
+    public static final String    EDIT     = "edit";
 
     /** User is preparing for a login/authentication. */
     public static final String    LOGIN    = HandlerInfo.getHandlerInfo( LoginActionBean.class,
"login" ).getRequestContext();

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DiffActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DiffActionBean.java?rev=889524&r1=889523&r2=889524&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DiffActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/DiffActionBean.java Fri Dec 11
07:39:41 2009
@@ -28,7 +28,7 @@
 
     private int m_r2 = WikiProvider.LATEST_VERSION;
 
-    private String m_diffProvider = null;
+    private String m_diffProvider = "TraditionalDiffProvider";
 
     private List<WikiPage> m_history = null;
 

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java?rev=889524&r1=889523&r2=889524&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java Fri Dec 11
07:39:41 2009
@@ -194,7 +194,6 @@
     public Resolution edit() throws ProviderException
     {
         // Load the page text
-        WikiEngine engine = getContext().getEngine();
         setWikiText( getPage().getContentAsString() );
         
         // Init edit fields and forward to the display JSP

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/action/GroupActionBean.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/GroupActionBean.java?rev=889524&r1=889523&r2=889524&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/GroupActionBean.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/GroupActionBean.java Fri Dec 11
07:39:41 2009
@@ -206,7 +206,7 @@
      *         display JSP
      */
     @HandlesEvent( "edit" )
-    @HandlerPermission( permissionClass = WikiPermission.class, target = "*", actions = WikiPermission.CREATE_GROUPS_ACTION
)
+    @HandlerPermission( permissionClass = GroupPermission.class, target = "${group.name}",
actions = GroupPermission.EDIT_ACTION )
     @WikiRequestContext( "editGroup" )
     public Resolution edit()
     {

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/DiffActionBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/DiffActionBeanTest.java?rev=889524&r1=889523&r2=889524&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/DiffActionBeanTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/DiffActionBeanTest.java Fri
Dec 11 07:39:41 2009
@@ -68,7 +68,7 @@
         MockRoundtrip trip = m_engine.guestTrip( "/Diff.action" );
         trip.execute( "diff" );
         DiffActionBean bean = trip.getActionBean( DiffActionBean.class );
-        assertEquals( "ContextualDiffProvider", bean.getDiffProvider() );
+        assertEquals( "TraditionalDiffProvider", bean.getDiffProvider() );
     }
     
     public void testHistory() throws Exception

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/EditActionBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/EditActionBeanTest.java?rev=889524&r1=889523&r2=889524&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/EditActionBeanTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/EditActionBeanTest.java Fri
Dec 11 07:39:41 2009
@@ -56,13 +56,13 @@
         m_engine.shutdown();
     }
 
-    public void testEditNoParameter() throws Exception
+    public void testEditNoParameters() throws Exception
     {
         // Try editing without specifying a page
         MockRoundtrip trip = m_engine.guestTrip( "/Edit.action" );
         String startTime = String.valueOf( System.currentTimeMillis() );
         trip.addParameter( "startTime", CryptoUtil.encrypt( startTime ) );
-        trip.addParameter( "text", "This is the edited text" );
+        trip.addParameter( "wikiText", "This is the edited text" );
         TestEngine.addSpamProtectParams( trip );
         trip.execute( "save" );
 
@@ -70,11 +70,12 @@
         EditActionBean bean = trip.getActionBean( EditActionBean.class );
         assertNull( bean.getPage() );
 
-        // ...and the "page" param should be flagged as invalid
+        // ...and the "page" and "append" params should be flagged as invalid
         ValidationErrors errors = trip.getValidationErrors();
-        assertEquals( 1, errors.size() );
+        assertEquals( 2, errors.size() );
         assertTrue( errors.hasFieldErrors() );
         assertTrue( errors.containsKey( "page" ) );
+        assertTrue( errors.containsKey( "append" ) );
 
         // ...and the destination should be the original display JSP (for
         // displaying errors)
@@ -91,7 +92,8 @@
         String startTime = String.valueOf( System.currentTimeMillis() );
         trip.addParameter( "page", "FindPage" );
         trip.addParameter( "startTime", CryptoUtil.encrypt( startTime ) );
-        trip.addParameter( "text", "This is the edited text" );
+        trip.addParameter( "wikiText", "This is the edited text" );
+        trip.addParameter( "append", CryptoUtil.encrypt( "false" ) );
         TestEngine.addSpamProtectParams( trip );
         trip.execute( "save" );
 
@@ -124,7 +126,8 @@
         trip.setParameter( "page", pageName );
         String startTime = String.valueOf( System.currentTimeMillis() );
         trip.addParameter( "startTime", CryptoUtil.encrypt( startTime ) );
-        trip.addParameter( "text", "This is the edited text" );
+        trip.addParameter( "wikiText", "This is the edited text" );
+        trip.addParameter( "append", CryptoUtil.encrypt( "false" ) );
         TestEngine.addSpamProtectParams( trip );
         trip.execute( "save" );
 
@@ -143,7 +146,8 @@
         trip.setParameter( "page", pageName );
         startTime = String.valueOf( System.currentTimeMillis() );
         trip.addParameter( "startTime", CryptoUtil.encrypt( startTime ) );
-        trip.addParameter( "text", "This is the third revision." );
+        trip.addParameter( "wikiText", "This is the third revision." );
+        trip.addParameter( "append", CryptoUtil.encrypt( "false" ) );
         TestEngine.addSpamProtectParams( trip );
         trip.execute( "save" );
         
@@ -169,7 +173,8 @@
         trip.setParameter( "page", pageName );
         String startTime = String.valueOf( System.currentTimeMillis() );
         trip.addParameter( "startTime", CryptoUtil.encrypt( startTime ) );
-        trip.addParameter( "text", "This is the edited text" );
+        trip.addParameter( "wikiText", "This is the edited text" );
+        trip.addParameter( "append", CryptoUtil.encrypt( "false" ) );
         TestEngine.addSpamProtectParams( trip );
         trip.execute( "save" );
 

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/GroupActionBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/GroupActionBeanTest.java?rev=889524&r1=889523&r2=889524&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/GroupActionBeanTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/action/GroupActionBeanTest.java Fri
Dec 11 07:39:41 2009
@@ -222,6 +222,9 @@
         assertTrue( group.isMember( new WikiPrincipal( "Princess Buttercup" ) ) );
         assertTrue( group.isMember( new WikiPrincipal( "Inigo Montoya" ) ) );
         assertTrue( group.isMember( new WikiPrincipal( "Miracle Max" ) ) );
+
+        // Remove the test group
+        mgr.removeGroup( "TestSaveExistingGroup" );
     }
     
     public void testSaveNewGroup() throws Exception
@@ -271,6 +274,9 @@
         assertTrue( group.isMember( new WikiPrincipal( "Princess Buttercup" ) ) );
         assertTrue( group.isMember( new WikiPrincipal( "Inigo Montoya" ) ) );
         assertTrue( group.isMember( new WikiPrincipal( "Miracle Max" ) ) );
+
+        // Remove the test group
+        m_engine.getGroupManager().removeGroup( "TestSaveNewGroup" );
     }
 
     private void deleteGroup( String groupName )

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/migrator/JSPWikiJspTransformerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/migrator/JSPWikiJspTransformerTest.java?rev=889524&r1=889523&r2=889524&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/migrator/JSPWikiJspTransformerTest.java
(original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/migrator/JSPWikiJspTransformerTest.java
Fri Dec 11 07:39:41 2009
@@ -248,7 +248,7 @@
     
     public void testUseActionBean()
     {
-        String s = "<% engine.createContext( request, WikiContext.EDIT ); %>";
+        String s = "<% engine.createContext( request, WikiContext.COMMENT ); %>";
         JspDocument doc = new JspParser().parse( s );
 
         // Should be 1 node: scriptlet
@@ -266,7 +266,7 @@
         assertEquals( "beanclass", tag.getAttributes().get( 0 ).getName() );
         assertEquals( "org.apache.wiki.action.EditActionBean", tag.getAttributes().get( 0
).getValue() );
         assertEquals( "event", tag.getAttributes().get( 1 ).getName() );
-        assertEquals( "edit", tag.getAttributes().get( 1 ).getValue() );
+        assertEquals( "comment", tag.getAttributes().get( 1 ).getValue() );
     }
     
     public static Test suite()

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/HandlerInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/HandlerInfoTest.java?rev=889524&r1=889523&r2=889524&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/HandlerInfoTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/ui/stripes/HandlerInfoTest.java Fri
Dec 11 07:39:41 2009
@@ -67,7 +67,7 @@
     {
         assertEquals( "createGroup", HandlerInfo.getHandlerInfo( GroupActionBean.class, "create"
).getRequestContext() );
         assertEquals( "deleteGroup", HandlerInfo.getHandlerInfo( GroupActionBean.class, "delete"
).getRequestContext() );
-        assertEquals( "editGroup", HandlerInfo.getHandlerInfo( GroupActionBean.class, "save"
).getRequestContext() );
+        assertEquals( "editGroup", HandlerInfo.getHandlerInfo( GroupActionBean.class, "edit"
).getRequestContext() );
         assertEquals( "group", HandlerInfo.getHandlerInfo( GroupActionBean.class, "view"
).getRequestContext() );
     }
 
@@ -85,7 +85,7 @@
         assertEquals( "view", handlerInfo.getPermissionActions() );
         assertNull( handlerInfo.getActionsExpression() );
 
-        method = GroupActionBean.class.getMethod( "save", new Class[0] );
+        method = GroupActionBean.class.getMethod( "edit", new Class[0] );
         assertTrue( map.containsKey( method ) );
         handlerInfo = map.get( method );
         assertEquals( GroupPermission.class, handlerInfo.getPermissionClass() );
@@ -94,13 +94,13 @@
         assertEquals( "edit", handlerInfo.getPermissionActions() );
         assertNull( handlerInfo.getActionsExpression() );
 
-        method = GroupActionBean.class.getMethod( "saveNew", new Class[0] );
+        method = GroupActionBean.class.getMethod( "save", new Class[0] );
         assertTrue( map.containsKey( method ) );
         handlerInfo = map.get( method );
-        assertEquals( WikiPermission.class, handlerInfo.getPermissionClass() );
-        assertEquals( "*", handlerInfo.getPermissionTarget() );
+        assertNull( handlerInfo.getPermissionClass() );
+        assertNull( handlerInfo.getPermissionTarget() );
         assertNull( handlerInfo.getPermissionTargetExpression() );
-        assertEquals( WikiPermission.CREATE_GROUPS_ACTION, handlerInfo.getPermissionActions()
);
+        assertNull( handlerInfo.getPermissionActions() );
         assertNull( handlerInfo.getActionsExpression() );
         
         method = GroupActionBean.class.getMethod( "delete", new Class[0] );
@@ -159,7 +159,7 @@
         assertNotNull( bean );
 
         // The view handler should return a "edit" GroupPermission
-        method = GroupActionBean.class.getMethod( "save", new Class[0] );
+        method = GroupActionBean.class.getMethod( "edit", new Class[0] );
         handlerInfo = handlerInfos.get( method );
         assertNotNull( handlerInfo );
         perm = handlerInfo.getPermission( bean );



Mime
View raw message