jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dvit...@apache.org
Subject svn commit: r1687036 - in /jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki: ./ filters/ i18n/ plugin/ search/ util/
Date Tue, 23 Jun 2015 11:39:37 GMT
Author: dvittor
Date: Tue Jun 23 11:39:36 2015
New Revision: 1687036

URL: http://svn.apache.org/r1687036
Log:
[2.10.2-svn-18] Introducing the PicoContainer for Dependency Injection into the WikiEngine.

Modified:
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PageManagerTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PropertyReaderTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/VariableManagerTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/filters/DefaultFilterManagerTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/i18n/InternationalizationManagerTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/DefaultPluginManagerTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/PageViewPluginTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/RecentChangesPluginTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/UndefinedPagesPluginTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/util/TextUtilTest.java

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PageManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PageManagerTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PageManagerTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PageManagerTest.java
Tue Jun 23 11:39:36 2015
@@ -26,7 +26,10 @@ import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
 import org.apache.log4j.PropertyConfigurator;
+import org.apache.wiki.api.engine.FilterManager;
+import org.apache.wiki.filters.DefaultFilterManager;
 import org.apache.wiki.providers.CachingProvider;
+import org.apache.wiki.util.ClassUtil;
 
 public class PageManagerTest extends TestCase
 {
@@ -54,7 +57,7 @@ public class PageManagerTest extends Tes
         throws Exception
     {
         props.setProperty( "jspwiki.usePageCache", "true" );
-        PageManager m = new PageManager( engine, props );
+        PageManager m = (PageManager)ClassUtil.getMappedObject(PageManager.class.getName(),
engine, props);
 
         assertTrue( m.getProvider() instanceof CachingProvider );
     }
@@ -63,7 +66,7 @@ public class PageManagerTest extends Tes
         throws Exception
     {
         props.setProperty( "jspwiki.usePageCache", "false" );
-        PageManager m = new PageManager( engine, props );
+        PageManager m = (PageManager)ClassUtil.getMappedObject(PageManager.class.getName(),
engine, props);
 
         assertTrue( !(m.getProvider() instanceof CachingProvider) );
     }

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PropertyReaderTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PropertyReaderTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PropertyReaderTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/PropertyReaderTest.java
Tue Jun 23 11:39:36 2015
@@ -20,6 +20,7 @@ package org.apache.wiki;
 
 import java.util.Properties;
 
+import org.apache.wiki.providers.AbstractFileProvider;
 import org.apache.wiki.util.PropertyReader;
 
 import junit.framework.Test;
@@ -34,16 +35,16 @@ public class PropertyReaderTest extends
         
         p.put("var.basedir", "/p/mywiki");
 
-        p.put("jspwiki.fileSystemProvider.pageDir", "$basedir/www/");
+        p.put(AbstractFileProvider.PROP_PAGEDIR, "$basedir/www/");
         p.put("jspwiki.basicAttachmentProvider.storageDir", "$basedir/www/");
         p.put("jspwiki.workDir", "$basedir/wrk/");
         p.put("jspwiki.xyz", "test basedir"); //don't touch this
 
         PropertyReader.expandVars(p);
         
-        assertTrue( p.getProperty("jspwiki.fileSystemProvider.pageDir").equals("/p/mywiki/www/")
);
+        assertTrue( p.getProperty(AbstractFileProvider.PROP_PAGEDIR).equals("/p/mywiki/www/")
);
         assertTrue( p.getProperty("jspwiki.basicAttachmentProvider.storageDir").equals("/p/mywiki/www/")
);
-        assertTrue( p.getProperty("jspwiki.fileSystemProvider.pageDir").equals("/p/mywiki/www/")
);
+        assertTrue( p.getProperty(AbstractFileProvider.PROP_PAGEDIR).equals("/p/mywiki/www/")
);
         assertTrue( p.getProperty("jspwiki.workDir").endsWith("/p/mywiki/wrk/") );
         assertTrue( p.getProperty("jspwiki.xyz").endsWith("test basedir") ); //don't touch
this
         
@@ -59,7 +60,7 @@ public class PropertyReaderTest extends
         //this time, declare the var at the end... (should overwrite this one);
         p.put("var.basedir", "xxx");
         
-        p.put("jspwiki.fileSystemProvider.pageDir", "$basedir/www/");
+        p.put(AbstractFileProvider.PROP_PAGEDIR, "$basedir/www/");
         p.put("jspwiki.basicAttachmentProvider.storageDir", "$basedir/www/");
         p.put("jspwiki.workDir", "$basedir/wrk/");
         p.put("jspwiki.xyz", "test basedir"); //don't touch this
@@ -70,9 +71,9 @@ public class PropertyReaderTest extends
         
         PropertyReader.expandVars(p);
         
-        assertTrue( p.getProperty("jspwiki.fileSystemProvider.pageDir").equals("/p/mywiki/www/")
);
+        assertTrue( p.getProperty(AbstractFileProvider.PROP_PAGEDIR).equals("/p/mywiki/www/")
);
         assertTrue( p.getProperty("jspwiki.basicAttachmentProvider.storageDir").equals("/p/mywiki/www/")
);
-        assertTrue( p.getProperty("jspwiki.fileSystemProvider.pageDir").equals("/p/mywiki/www/")
);
+        assertTrue( p.getProperty(AbstractFileProvider.PROP_PAGEDIR).equals("/p/mywiki/www/")
);
         assertTrue( p.getProperty("jspwiki.workDir").endsWith("/p/mywiki/wrk/") );
         assertTrue( p.getProperty("jspwiki.xyz").endsWith("test basedir") ); //don't touch
this
         

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=1687036&r1=1687035&r2=1687036&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
Tue Jun 23 11:39:36 2015
@@ -410,11 +410,13 @@ public class TestEngine extends WikiEngi
      */
     private static Properties cleanTestProps( Properties props )
     {
-        String pageDir = props.getProperty( "jspwiki.fileSystemProvider.pageDir" );
+        String pageDir = props.getProperty( AbstractFileProvider.PROP_PAGEDIR );
         props.put( AuthenticationManager.PROP_LOGIN_THROTTLING, "false" );
-        props.setProperty( "jspwiki.fileSystemProvider.pageDir",
-                           pageDir.replaceAll( "\\d", StringUtils.EMPTY )
-                           + System.currentTimeMillis() );
+        if (pageDir != null) {
+	        props.setProperty( AbstractFileProvider.PROP_PAGEDIR,
+	                           pageDir.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=1687036&r1=1687035&r2=1687036&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
Tue Jun 23 11:39:36 2015
@@ -45,7 +45,7 @@ public class VariableManagerTest extends
         Properties props = TestEngine.getTestProperties();
         PropertyConfigurator.configure(props);
 
-        m_variableManager = new VariableManager( props );
+        m_variableManager = new VariableManager( );
         TestEngine testEngine = new TestEngine( props );
         m_context = new WikiContext( testEngine,
                                      new WikiPage( testEngine, PAGE_NAME ) );

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/filters/DefaultFilterManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/filters/DefaultFilterManagerTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/filters/DefaultFilterManagerTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/filters/DefaultFilterManagerTest.java
Tue Jun 23 11:39:36 2015
@@ -47,8 +47,9 @@ public class DefaultFilterManagerTest ex
     }
 
     public void testInitFilters() throws Exception {
-        FilterManager m = new DefaultFilterManager( engine, props );
-
+        DefaultFilterManager m = new DefaultFilterManager( );
+        m.initialize(engine, props);
+        
         List l = m.getFilterList();
 
         assertEquals("Wrong number of filters", 2, l.size());
@@ -64,7 +65,8 @@ public class DefaultFilterManagerTest ex
     }
 
     public void testInitParams() throws Exception {
-        FilterManager m = new DefaultFilterManager( engine, props );
+        DefaultFilterManager m = new DefaultFilterManager( );
+        m.initialize(engine, props);
 
         List l = m.getFilterList();
 

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/i18n/InternationalizationManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/i18n/InternationalizationManagerTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/i18n/InternationalizationManagerTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/i18n/InternationalizationManagerTest.java
Tue Jun 23 11:39:36 2015
@@ -24,7 +24,7 @@ import junit.framework.TestCase;
 
 public class InternationalizationManagerTest extends TestCase
 {
-    InternationalizationManager i18n = new InternationalizationManager( null );
+    InternationalizationManager i18n = new InternationalizationManager( );
     
     protected void setUp() throws Exception
     {

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/DefaultPluginManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/DefaultPluginManagerTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/DefaultPluginManagerTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/DefaultPluginManagerTest.java
Tue Jun 23 11:39:36 2015
@@ -53,7 +53,8 @@ public class DefaultPluginManagerTest ex
     {
         engine = new TestEngine(props);
         context = new WikiContext( engine, new WikiPage(engine, "Testpage") );
-        manager = new DefaultPluginManager( engine, props );
+        manager = new DefaultPluginManager();
+        manager.initialize(engine, props);
     }
 
     public void tearDown() throws ProviderException
@@ -86,7 +87,8 @@ public class DefaultPluginManagerTest ex
         throws Exception
     {
         props.setProperty( DefaultPluginManager.PROP_SEARCHPATH, "com.foo" );
-        DefaultPluginManager m = new DefaultPluginManager( engine, props );
+        DefaultPluginManager m = new DefaultPluginManager( );
+        m.initialize(engine, props);
         String res = m.execute( context,
                                 "{INSERT SamplePlugin2 WHERE text=foobar}");
 
@@ -98,7 +100,8 @@ public class DefaultPluginManagerTest ex
         throws Exception
     {
         props.setProperty( DefaultPluginManager.PROP_SEARCHPATH, "com.foo" );
-        DefaultPluginManager m = new DefaultPluginManager( engine, props );
+        DefaultPluginManager m = new DefaultPluginManager( );
+        m.initialize(engine, props);
         String res = m.execute( context,
                                 "{INSERT SamplePlugin3 WHERE text=foobar}");
 
@@ -111,7 +114,8 @@ public class DefaultPluginManagerTest ex
         throws Exception
     {
         props.setProperty( DefaultPluginManager.PROP_SEARCHPATH, "com.foo,blat.blaa" );
-        DefaultPluginManager m = new DefaultPluginManager( engine, props );
+        DefaultPluginManager m = new DefaultPluginManager(  );
+        m.initialize(engine, props);
         String res = m.execute( context,
                                 "{INSERT SamplePlugin WHERE text=foobar}");
 

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/PageViewPluginTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/PageViewPluginTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/PageViewPluginTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/PageViewPluginTest.java
Tue Jun 23 11:39:36 2015
@@ -29,6 +29,7 @@ import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiPage;
 import org.apache.wiki.api.engine.PluginManager;
+import org.apache.wiki.util.ClassUtil;
 
 public class PageViewPluginTest extends TestCase
 
@@ -55,7 +56,7 @@ public class PageViewPluginTest extends
         testEngine.saveText( "TestPage01", "this is test page 01 [{PageViewPlugin}]" );
         testEngine.saveText( "TestPage02", "this is test page 02 [{PageViewPlugin}]" );
 
-        manager = new DefaultPluginManager( testEngine, props );
+        manager = (PluginManager)ClassUtil.getMappedObject(DefaultPluginManager.class.getName(),
testEngine, props);
     }
 
     public void tearDown()

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/RecentChangesPluginTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/RecentChangesPluginTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/RecentChangesPluginTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/RecentChangesPluginTest.java
Tue Jun 23 11:39:36 2015
@@ -30,6 +30,7 @@ import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiPage;
 import org.apache.wiki.api.engine.PluginManager;
+import org.apache.wiki.util.ClassUtil;
 
 public class RecentChangesPluginTest extends TestCase {
     Properties props = TestEngine.getTestProperties();
@@ -49,7 +50,7 @@ public class RecentChangesPluginTest ext
         testEngine.saveText("TestPage03", "Some Text for testing 03");
         testEngine.saveText("TestPage04", "Some Text for testing 04");
 
-        manager = new DefaultPluginManager(testEngine, props);
+        manager = (PluginManager)ClassUtil.getMappedObject(DefaultPluginManager.class.getName(),
testEngine, props);
     }
 
     public void tearDown() {

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java
Tue Jun 23 11:39:36 2015
@@ -31,6 +31,7 @@ import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiPage;
 import org.apache.wiki.api.engine.PluginManager;
 import org.apache.wiki.api.exceptions.PluginException;
+import org.apache.wiki.util.ClassUtil;
 
 public class ReferringPagesPluginTest extends TestCase
 {
@@ -60,7 +61,7 @@ public class ReferringPagesPluginTest ex
         engine.saveText( "Foobar7", "Reference to [TestPage]." );
 
         context = new WikiContext( engine, engine.newHttpRequest(), new WikiPage(engine,"TestPage")
);
-        manager = new DefaultPluginManager( engine, props );
+        manager = (PluginManager)ClassUtil.getMappedObject(DefaultPluginManager.class.getName(),
engine, props);
     }
 
     public void tearDown()

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java
Tue Jun 23 11:39:36 2015
@@ -30,6 +30,7 @@ import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiPage;
 import org.apache.wiki.api.engine.PluginManager;
+import org.apache.wiki.util.ClassUtil;
 
 public class ReferringUndefinedPagesPluginTest extends TestCase {
     Properties props = TestEngine.getTestProperties();
@@ -49,7 +50,8 @@ public class ReferringUndefinedPagesPlug
 		testEngine.saveText("TestPage03", "Some Text for testing 03 which refers [NonExistingPageC]
");
 
         context = new WikiContext( testEngine, testEngine.newHttpRequest(), new WikiPage(testEngine,"TestPage")
);
-        manager = new DefaultPluginManager( testEngine, props );	}
+        manager = (PluginManager)ClassUtil.getMappedObject(DefaultPluginManager.class.getName(),
testEngine, props);
+	}
 
 	public void tearDown() {
 		testEngine.deleteTestPage("TestPage01");

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/UndefinedPagesPluginTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/UndefinedPagesPluginTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/UndefinedPagesPluginTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/plugin/UndefinedPagesPluginTest.java
Tue Jun 23 11:39:36 2015
@@ -31,6 +31,7 @@ import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiPage;
 import org.apache.wiki.api.engine.PluginManager;
 import org.apache.wiki.api.exceptions.PluginException;
+import org.apache.wiki.util.ClassUtil;
 
 public class UndefinedPagesPluginTest extends TestCase
 {
@@ -54,7 +55,7 @@ public class UndefinedPagesPluginTest ex
         testEngine.saveText( "Foobar", "Reference to [Foobar 2], [Foobars]" );
 
         context = new WikiContext( testEngine, new WikiPage(testEngine, "TestPage") );
-        manager = new DefaultPluginManager( testEngine, props );
+        manager = (PluginManager)ClassUtil.getMappedObject(DefaultPluginManager.class.getName(),
testEngine, props);
     }
 
     public void tearDown()

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
Tue Jun 23 11:39:36 2015
@@ -30,6 +30,7 @@ import net.sourceforge.stripes.mock.Mock
 
 import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiContext;
+import org.apache.wiki.providers.AbstractFileProvider;
 
 public class SearchManagerTest extends TestCase {
 	
@@ -42,12 +43,12 @@ public class SearchManagerTest extends T
     protected void setUp() throws Exception {
         Properties props = TestEngine.getTestProperties();
         String workDir = props.getProperty( "jspwiki.workDir" );
-        String workRepo = props.getProperty( "jspwiki.fileSystemProvider.pageDir" );
+        String workRepo = props.getProperty( AbstractFileProvider.PROP_PAGEDIR );
         
         props.setProperty( SearchManager.PROP_SEARCHPROVIDER, "LuceneSearchProvider" );
         props.setProperty( "jspwiki.lucene.initialdelay", "1" );
         props.setProperty( "jspwiki.workDir", workDir + System.currentTimeMillis() );
-        props.setProperty( "jspwiki.fileSystemProvider.pageDir", workRepo + System.currentTimeMillis()
);
+        props.setProperty( AbstractFileProvider.PROP_PAGEDIR, workRepo + System.currentTimeMillis()
);
 
         CacheManager.getInstance().removeAllCaches();
         m_engine = new TestEngine( props );

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/util/TextUtilTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/util/TextUtilTest.java?rev=1687036&r1=1687035&r2=1687036&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/util/TextUtilTest.java
(original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/util/TextUtilTest.java
Tue Jun 23 11:39:36 2015
@@ -26,6 +26,7 @@ import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
 import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
+import org.apache.wiki.providers.AbstractFileProvider;
 
 public class TextUtilTest extends TestCase
 {
@@ -414,9 +415,9 @@ public class TextUtilTest extends TestCa
 
     public void testGetCanonicalFilePathProperty()
     {
-        String[] values = { "jspwiki.fileSystemProvider.pageDir", " ." + File.separator +
"data" + File.separator + "private " };
+        String[] values = { AbstractFileProvider.PROP_PAGEDIR, " ." + File.separator + "data"
+ File.separator + "private " };
         Properties props = TextUtil.createProperties(values);
-        String path = TextUtil.getCanonicalFilePathProperty(props, "jspwiki.fileSystemProvider.pageDir",
"NA");
+        String path = TextUtil.getCanonicalFilePathProperty(props, AbstractFileProvider.PROP_PAGEDIR,
"NA");
         assertTrue( path.endsWith( File.separator + "data" + File.separator + "private" )
);
         assertFalse( path.endsWith( "." + File.separator + "data" + File.separator + "private"
) );
     }
@@ -426,7 +427,7 @@ public class TextUtilTest extends TestCa
         String defaultValue = System.getProperty( "user.home" ) + File.separator + "jspwiki-files";
         String[] values = {};
         Properties props = TextUtil.createProperties(values);
-        String path = TextUtil.getCanonicalFilePathProperty(props, "jspwiki.fileSystemProvider.pageDir",
defaultValue);
+        String path = TextUtil.getCanonicalFilePathProperty(props, AbstractFileProvider.PROP_PAGEDIR,
defaultValue);
         assertTrue(path.endsWith("jspwiki-files"));
     }
 



Mime
View raw message