jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dvit...@apache.org
Subject svn commit: r1688207 [2/2] - in /jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src: main/java/org/apache/wiki/ main/java/org/apache/wiki/api/engine/ main/java/org/apache/wiki/api/filters/ main/java/org/apache/wiki/attachment/ main/java/org/apac...
Date Mon, 29 Jun 2015 13:29:40 GMT
Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/workflow/WorkflowManager.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/workflow/WorkflowManager.java?rev=1688207&r1=1688206&r2=1688207&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/workflow/WorkflowManager.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/workflow/WorkflowManager.java
Mon Jun 29 13:29:39 2015
@@ -30,13 +30,13 @@ import java.util.Properties;
 import java.util.Set;
 
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiInternalModule;
 import org.apache.wiki.WikiSession;
 import org.apache.wiki.api.exceptions.WikiException;
 import org.apache.wiki.auth.acl.UnresolvedPrincipal;
 import org.apache.wiki.event.WikiEvent;
 import org.apache.wiki.event.WikiEventListener;
 import org.apache.wiki.event.WorkflowEvent;
-import org.apache.wiki.modules.InternalModule;
 
 
 /**
@@ -46,7 +46,7 @@ import org.apache.wiki.modules.InternalM
  * Workflows.
  * </p>
  */
-public class WorkflowManager implements WikiEventListener, InternalModule {
+public class WorkflowManager extends WikiInternalModule implements WikiEventListener {
 
     private final DecisionQueue m_queue = new DecisionQueue();
 
@@ -106,8 +106,6 @@ public class WorkflowManager implements
         return new ArrayList<Workflow>( m_completed );
     }
 
-    private WikiEngine m_engine = null;
-
     /**
      * Initializes the WorkflowManager using a specfied WikiEngine and
      * properties. Any properties that begin with
@@ -123,9 +121,9 @@ public class WorkflowManager implements
      * @param engine the wiki engine to associate with this WorkflowManager
      * @param props the wiki engine's properties
      */
-    public void initialize( WikiEngine engine, Properties props )
+    public void initialize( WikiEngine engine, Properties props ) throws WikiException
     {
-        m_engine = engine;
+        super.initialize(engine, props);
 
         // Identify the workflows requiring approvals
         for ( Iterator<?> it = props.keySet().iterator(); it.hasNext(); )

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/resources/ini/classmappings.xml
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/resources/ini/classmappings.xml?rev=1688207&r1=1688206&r2=1688207&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/resources/ini/classmappings.xml
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/resources/ini/classmappings.xml
Mon Jun 29 13:29:39 2015
@@ -123,4 +123,20 @@
     <requestedClass>org.apache.wiki.workflow.WorkflowManager</requestedClass>
     <mappedClass>org.apache.wiki.workflow.WorkflowManager</mappedClass>
   </mapping>
+  <mapping>
+    <requestedClass>org.apache.wiki.url.URLConstructor</requestedClass>
+    <mappedClass>org.apache.wiki.url.DefaultURLConstructor</mappedClass>
+  </mapping>  
+  <mapping>
+    <requestedClass>org.apache.wiki.content.PageRenamer</requestedClass>
+    <mappedClass>org.apache.wiki.content.PageRenamer</mappedClass>
+  </mapping>
+  <mapping>
+    <requestedClass>org.apache.wiki.PageSorter</requestedClass>
+    <mappedClass>org.apache.wiki.PageSorter</mappedClass>
+  </mapping>
+  <mapping>
+    <requestedClass>org.apache.wiki.rss.RSSGenerator</requestedClass>
+    <mappedClass>org.apache.wiki.rss.RSSGenerator</mappedClass>
+  </mapping>
 </classmappings>

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PageSorterTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PageSorterTest.java?rev=1688207&r1=1688206&r2=1688207&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PageSorterTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PageSorterTest.java
Mon Jun 29 13:29:39 2015
@@ -25,6 +25,9 @@ import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.apache.log4j.PropertyConfigurator;
+import org.apache.wiki.api.exceptions.WikiException;
+import org.apache.wiki.util.ClassUtil;
 import org.apache.wiki.util.comparators.HumanComparator;
 import org.apache.wiki.util.comparators.LocaleComparator;
 
@@ -36,60 +39,71 @@ import org.apache.wiki.util.comparators.
  */
 public class PageSorterTest extends TestCase
 {
-    public static Test suite()
+    private Properties props = TestEngine.getTestProperties();
+
+    private TestEngine engine;
+
+	public static Test suite()
     {
         return new TestSuite( PageSorterTest.class );
     }
+    
+    public void setUp() throws Exception
+    {
+        PropertyConfigurator.configure(props);
+        engine = new TestEngine(props);
+    }
+
 
-    public void testPageSorterBadProperty()
+    public void testPageSorterBadProperty() throws WikiException
     {
         // Initialised with a broken property
-        PageSorter sorter = new PageSorter();
+        PageSorter sorter = ClassUtil.getInternalModule(PageSorter.class, engine, props);
         Properties props = new Properties();
         props.put( PageSorter.PROP_PAGE_NAME_COMPARATOR, "haha.this.isnt.a.class" );
-        sorter.initialize( props );
+        sorter.initialize( engine, props );
         assertTrue( sorter.compare( "ab2", "ab10" ) > 0 );
     }
 
-    public void testPageSorterDefaultConstructor()
+    public void testPageSorterDefaultConstructor() throws WikiException
     {
         // Check uninitialised behaviour
-        PageSorter sorter = new PageSorter();
+        PageSorter sorter = ClassUtil.getInternalModule(PageSorter.class, engine, props);
         assertTrue( sorter.compare( "ab2", "ab10" ) > 0 );
     }
 
-    public void testPageSorterHumanComparator()
+    public void testPageSorterHumanComparator() throws WikiException
     {
         // Initialised with the human comparator
-        PageSorter sorter = new PageSorter();
+        PageSorter sorter = ClassUtil.getInternalModule(PageSorter.class, engine, props);
         Properties props = new Properties();
         props.put( PageSorter.PROP_PAGE_NAME_COMPARATOR, HumanComparator.class.getPackage().getName()
+ ".HumanComparator" );
-        sorter.initialize( props );
+        sorter.initialize( engine, props );
         assertTrue( sorter.compare( "ab2", "ab10" ) < 0 );
         props.put( PageSorter.PROP_PAGE_NAME_COMPARATOR, "HumanComparator" );
-        sorter.initialize( props );
+        sorter.initialize( engine, props );
         assertTrue( sorter.compare( "ab2", "ab10" ) < 0 );
     }
 
-    public void testPageSorterLocaleComparator()
+    public void testPageSorterLocaleComparator() throws WikiException
     {
         // Initialised with the human comparator
-        PageSorter sorter = new PageSorter();
+        PageSorter sorter = ClassUtil.getInternalModule(PageSorter.class, engine, props);
         Properties props = new Properties();
         props.put( PageSorter.PROP_PAGE_NAME_COMPARATOR, LocaleComparator.class.getPackage().getName()
+ ".LocaleComparator" );
-        sorter.initialize( props );
+        sorter.initialize( engine, props );
         assertTrue( sorter.compare( "ab2", "ab10" ) > 0 );
         props.put( PageSorter.PROP_PAGE_NAME_COMPARATOR, "LocaleComparator" );
-        sorter.initialize( props );
+        sorter.initialize( engine, props );
         assertTrue( sorter.compare( "ab2", "ab10" ) > 0 );
     }
 
-    public void testPageSorterNoProperty()
+    public void testPageSorterNoProperty() throws WikiException
     {
         // Initialised without the necessary property
-        PageSorter sorter = new PageSorter();
+        PageSorter sorter = ClassUtil.getInternalModule(PageSorter.class, engine, props);
         Properties props = new Properties();
-        sorter.initialize( props );
+        sorter.initialize( engine, props );
         assertTrue( sorter.compare( "ab2", "ab10" ) > 0 );
     }
 }

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java?rev=1688207&r1=1688206&r2=1688207&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java
Mon Jun 29 13:29:39 2015
@@ -414,7 +414,7 @@ public class TestEngine extends WikiEngi
         props.put( AuthenticationManager.PROP_LOGIN_THROTTLING, "false" );
         if (pageDir != null) {
 	        props.setProperty( AbstractFileProvider.PROP_PAGEDIR,
-	                           pageDir.replaceAll( "\\d", StringUtils.EMPTY )
+	                           pageDir // TODO: .replaceAll( "\\d", StringUtils.EMPTY )
 	                           + System.currentTimeMillis() );
         }
         return props;

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/VariableManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/VariableManagerTest.java?rev=1688207&r1=1688206&r2=1688207&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/VariableManagerTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/VariableManagerTest.java
Mon Jun 29 13:29:39 2015
@@ -19,12 +19,13 @@
 
 package org.apache.wiki;
 
-import junit.framework.*;
+import java.util.Properties;
 
-import java.io.*;
-import java.util.*;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
 
-import org.apache.log4j.*;
+import org.apache.log4j.PropertyConfigurator;
 import org.apache.wiki.api.exceptions.NoSuchVariableException;
 
 public class VariableManagerTest extends TestCase

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/util/XmlUtilTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/util/XmlUtilTest.java?rev=1688207&r1=1688206&r2=1688207&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/util/XmlUtilTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/util/XmlUtilTest.java
Mon Jun 29 13:29:39 2015
@@ -61,7 +61,7 @@ public class XmlUtilTest extends TestCas
      	assertEquals( 0, elements.size() );
      	
      	elements = XmlUtil.parse( ClassUtil.MAPPINGS, "/classmappings/mapping" );
-     	assertEquals( 19, elements.size() );
+     	assertEquals( 23, elements.size() );
     }
     
     public void testParseFromStream() throws FileNotFoundException {



Mime
View raw message