portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r721971 - in /portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade: components/jetspeed-cm/src/main/java/org/apache/jetspeed/cache/impl/ components/jetspeed-file-cache/src/main/java/org/apache/jetspeed/cache/file/ components/jetspee...
Date Mon, 01 Dec 2008 05:44:53 GMT
Author: rwatler
Date: Sun Nov 30 21:44:52 2008
New Revision: 721971

URL: http://svn.apache.org/viewvc?rev=721971&view=rev
Log:
- add shutdown protocol to page managers and handlers
- remove cache listeners on shutdown to eliminate cross talk between non-forked page manager
test cases
- fix remove listener cache bug
- fix database page manager localized field object model regression related to registry refactoring
- revert accidental import modification related to preferences refactoring


Modified:
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-cm/src/main/java/org/apache/jetspeed/cache/impl/EhCacheImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-file-cache/src/main/java/org/apache/jetspeed/cache/file/FileCache.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/PageLocalizedFieldImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCreateUserHomePagesFromRoles.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestMappings.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureCastorXmlPageManager.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/DocumentHandler.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/FolderHandler.java

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-cm/src/main/java/org/apache/jetspeed/cache/impl/EhCacheImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-cm/src/main/java/org/apache/jetspeed/cache/impl/EhCacheImpl.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-cm/src/main/java/org/apache/jetspeed/cache/impl/EhCacheImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-cm/src/main/java/org/apache/jetspeed/cache/impl/EhCacheImpl.java
Sun Nov 30 21:44:52 2008
@@ -154,13 +154,14 @@
                return this;
            }
         };
-        
+
+        this.cacheEventListenersMap.put(listener, cacheEventListener);
         ehcache.getCacheEventNotificationService().registerListener(cacheEventListener);
     }
     
     public void removeEventListener(JetspeedCacheEventListener listener, boolean local)
     {
-        CacheEventListener cacheEventListener = this.cacheEventListenersMap.get(listener);
+        CacheEventListener cacheEventListener = this.cacheEventListenersMap.remove(listener);
         
         if (cacheEventListener != null)
             ehcache.getCacheEventNotificationService().unregisterListener(cacheEventListener);

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-file-cache/src/main/java/org/apache/jetspeed/cache/file/FileCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-file-cache/src/main/java/org/apache/jetspeed/cache/file/FileCache.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-file-cache/src/main/java/org/apache/jetspeed/cache/file/FileCache.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-file-cache/src/main/java/org/apache/jetspeed/cache/file/FileCache.java
Sun Nov 30 21:44:52 2008
@@ -18,7 +18,9 @@
 package org.apache.jetspeed.cache.file;
 
 import java.util.Date;
+import java.util.Hashtable;
 import java.util.List;
+import java.util.Map;
 import java.io.File;
 import java.io.FileNotFoundException;
 
@@ -44,6 +46,7 @@
 
     private FileCacheScanner scanner = null;
     private JetspeedCache cache = null;
+    private Map<FileCacheEventListener,JetspeedCacheEventListener> listeners = new
Hashtable<FileCacheEventListener,JetspeedCacheEventListener>();
 
     private final static Log log = LogFactory.getLog(FileCache.class);
 
@@ -226,11 +229,25 @@
             {
             }
         };
-
+        listeners.put(listener, cacheEventListener);
         this.cache.addEventListener(cacheEventListener, true);
     }
 
     /**
+     * Remove a File Cache Event Listener 
+     *
+     * @param listener the event listener
+     */
+    public void removeListener(final FileCacheEventListener listener)
+    {
+        JetspeedCacheEventListener cacheEventListener = listeners.remove(listener);
+        if (cacheEventListener != null)
+        {
+            this.cache.removeEventListener(cacheEventListener, true);
+        }
+    }
+
+    /**
      * Start the file Scanner running at the current scan rate.
      *
      */

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/PageLocalizedFieldImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/PageLocalizedFieldImpl.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/PageLocalizedFieldImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/PageLocalizedFieldImpl.java
Sun Nov 30 21:44:52 2008
@@ -17,6 +17,7 @@
 package org.apache.jetspeed.om.page;
 
 import org.apache.jetspeed.om.portlet.impl.LocalizedFieldImpl;
+import org.apache.jetspeed.util.JetspeedLongObjectID;
 
 /**
  * @author <a href="mailto:jford@apache.org">Jeremy Ford</a>
@@ -24,4 +25,13 @@
  */
 public class PageLocalizedFieldImpl extends LocalizedFieldImpl
 {
+    protected JetspeedLongObjectID id;
+    
+    /**
+     * getId - access object id
+     */
+    public JetspeedLongObjectID getId()
+    {
+        return id;
+    }   
 }

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java
Sun Nov 30 21:44:52 2008
@@ -694,6 +694,14 @@
         // nothing to reset by default
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#shutdown()
+     */
+    public void shutdown()
+    {
+        // nothing to shutdown by default
+    }
+
     /**
      * notifyNewNode - notify page manager event listeners of
      *                 new node event

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/CastorFileSystemDocumentHandler.java
Sun Nov 30 21:44:52 2008
@@ -779,4 +779,12 @@
         this.handlerFactory = factory;
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.document.DocumentHandler#shutdown()
+     */
+    public void shutdown()
+    {
+        // disconnect cache listener
+        fileCache.removeListener(this);
+    }    
 }

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/DocumentHandlerFactoryImpl.java
Sun Nov 30 21:44:52 2008
@@ -202,4 +202,17 @@
     {
         constraintsEnabled = enabled;
     }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.document.DocumentHandlerFactory#shutdown()
+     */
+    public void shutdown()
+    {
+        // propagate to handlers        
+        Iterator handlersIter = handlers.values().iterator();
+        while (handlersIter.hasNext())
+        {
+            ((DocumentHandler)handlersIter.next()).shutdown();
+        }
+    }    
 }

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/document/psml/FileSystemFolderHandler.java
Sun Nov 30 21:44:52 2008
@@ -665,6 +665,14 @@
         }
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.document.FolderHandler#shutdown()
+     */
+    public void shutdown()
+    {
+        // disconnect cache listener
+        fileCache.removeListener(this);
+    }    
 
     /**
      * <p>

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
Sun Nov 30 21:44:52 2008
@@ -446,6 +446,15 @@
     }
 
     /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#shutdown()
+     */
+    public void shutdown()
+    {
+        // delegate
+        delegator.shutdown();
+    }
+
+     /* (non-Javadoc)
      * @see org.apache.jetspeed.page.PageManager#getPage(java.lang.String)
      */
     public Page getPage(String path) throws PageNotFoundException, NodeException

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
Sun Nov 30 21:44:52 2008
@@ -908,6 +908,20 @@
         fileCache.evictAll();
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#shutdown()
+     */
+    public void shutdown()
+    {
+        // propagate to super
+        super.shutdown();
+        // disconnect cache listener
+        fileCache.removeListener(this);
+        // propagate to handlers
+        handlerFactory.shutdown();
+        folderHandler.shutdown();
+    }
+
     /**
      * <p>
      * getNodeFolder - get folder implementation associated with specifed path

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java
Sun Nov 30 21:44:52 2008
@@ -81,7 +81,6 @@
 import org.apache.jetspeed.security.spi.impl.FragmentPermission;
 import org.apache.jetspeed.security.spi.impl.JetspeedPermissionFactory;
 import org.apache.jetspeed.security.spi.impl.PagePermission;
-import org.apache.jetspeed.cache.JetspeedCache;
 import org.apache.jetspeed.cache.impl.EhCacheImpl;
 
 /**
@@ -136,7 +135,7 @@
             dirHelper.copyFrom(webappPagesDirFile, noCVSorSVNorBackups);
 
             IdGenerator idGen = new JetspeedIdGenerator(65536,"P-","");
-            FileCache cache = new FileCache(new EhCacheImpl(CacheManager.getInstance().getEhcache("pageFileCache")),
10);
+            FileCache cache = new FileCache(new EhCacheImpl( CacheManager.getInstance().getEhcache("pageFileCache")),
10);
             
             DocumentHandler psmlHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml",
Page.DOCUMENT_TYPE, PageImpl.class, baseDir + "target/testdata/" + pagesDirName, cache);
             DocumentHandler linkHandler = new CastorFileSystemDocumentHandler("/JETSPEED-INF/castor/page-mapping.xml",
Link.DOCUMENT_TYPE, LinkImpl.class, baseDir + "target/testdata/" + pagesDirName, cache);
@@ -152,6 +151,19 @@
 
             return new CastorXmlPageManager(idGen, handlerFactory, folderHandler, cache,
permissionsEnabled, constraintsEnabled);
         }
+        
+        /**
+         * shutdownCastorXmlPageManager
+         * 
+         * shutdown page manager and free cache between test invocations
+         */
+        static void shutdownCastorXMLPageManager(CastorXmlPageManager pageManager)
+        {
+            // reset to clear cache
+            pageManager.reset();
+            // shutdown page manager and handlers
+            pageManager.shutdown();
+        }
 
         /**
          * makeListFromCSV

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCastorXmlPageManager.java
Sun Nov 30 21:44:52 2008
@@ -78,6 +78,17 @@
         pageManager = Shared.makeCastorXMLPageManager(getBaseDir(), "pages", false, false);
     }
 
+    /*
+     * (non-Javadoc)
+     * 
+     * @see junit.framework.TestCase#tearDown
+     */
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+        Shared.shutdownCastorXMLPageManager(pageManager);
+    }
+
     /**
      * Defines the testcase name for JUnit.
      * 

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCreateUserHomePagesFromRoles.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCreateUserHomePagesFromRoles.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCreateUserHomePagesFromRoles.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestCreateUserHomePagesFromRoles.java
Sun Nov 30 21:44:52 2008
@@ -46,7 +46,18 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        pageManager = Shared.makeCastorXMLPageManager(getBaseDir(), "secure-pages", false,
true);
+        pageManager = Shared.makeCastorXMLPageManager(getBaseDir(), "pages", false, false);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see junit.framework.TestCase#tearDown
+     */
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+        Shared.shutdownCastorXMLPageManager(pageManager);
     }
 
     /**
@@ -97,8 +108,6 @@
     
     public void testCreateUserHomePagesFromRoles() throws Exception
     {
-        PageManager pageManager = Shared.makeCastorXMLPageManager(getBaseDir(), "pages",
false, false);         
-
         assertTrue("folder1 failed to create", pageManager.folderExists(FOLDER1));
         assertTrue("folder2 failed to create", pageManager.folderExists(FOLDER2));
         assertTrue("folder3 failed to create", pageManager.folderExists(FOLDER3));

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestMappings.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestMappings.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestMappings.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestMappings.java
Sun Nov 30 21:44:52 2008
@@ -21,7 +21,7 @@
 import junit.framework.TestCase;
 
 import org.apache.jetspeed.om.page.Fragment;
-import org.apache.pluto.om.portlet.Preference;
+import org.apache.jetspeed.om.preference.FragmentPreference;
 import org.exolab.castor.mapping.Mapping;
 import org.exolab.castor.xml.Unmarshaller;
 import org.xml.sax.InputSource;
@@ -44,12 +44,12 @@
         
         assertNotNull(fragment);
         assertEquals(1, fragment.getPreferences().size());
-        Preference pref = (Preference) fragment.getPreferences().get(0);
+        FragmentPreference pref = (FragmentPreference) fragment.getPreferences().get(0);
         
         assertEquals("Google", pref.getName());
         assertEquals(false, pref.isReadOnly());
-        Iterator itr = pref.getValues();
-        String value = (String )itr.next();
+        Iterator itr = pref.getValueList().iterator();
+        String value = (String)itr.next();
         assertEquals("http://www.google.com", value );
 
     }

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureCastorXmlPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureCastorXmlPageManager.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureCastorXmlPageManager.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/TestSecureCastorXmlPageManager.java
Sun Nov 30 21:44:52 2008
@@ -27,7 +27,7 @@
  * 
  * @author <a href="rwatler@apache.org">Randy Watler</a>
  * @version $Id$
- */
+*/
 public class TestSecureCastorXmlPageManager extends JetspeedTestCase implements PageManagerTestShared

 {
     protected CastorXmlPageManager pageManager;
@@ -43,6 +43,17 @@
         pageManager = Shared.makeCastorXMLPageManager(getBaseDir(), "secure-pages", false,
true);
     }
 
+    /*
+     * (non-Javadoc)
+     * 
+     * @see junit.framework.TestCase#tearDown
+     */
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+        Shared.shutdownCastorXMLPageManager(pageManager);
+    }
+
     /**
      * Defines the testcase name for JUnit.
      * 

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/document/psml/TestCastorFileSystemDocumentHandler.java
Sun Nov 30 21:44:52 2008
@@ -48,7 +48,7 @@
  */
 public class TestCastorFileSystemDocumentHandler extends JetspeedTestCase
 {
-
+    protected FileCache cache;
     protected CastorFileSystemDocumentHandler folderMetaDataDocumentHandler;
 
     /*
@@ -59,8 +59,8 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        
-        FileCache cache = new FileCache(new EhCacheImpl(CacheManager.getInstance().getEhcache("pageFileCache")),
10);
+
+        cache = new FileCache(new EhCacheImpl(CacheManager.getInstance().getEhcache("pageFileCache")),
10);
         
         folderMetaDataDocumentHandler = new CastorFileSystemDocumentHandler(
             "/JETSPEED-INF/castor/page-mapping.xml",
@@ -75,6 +75,19 @@
         folderMetaDataDocumentHandler.setHandlerFactory(handlerFactory);
     }
 
+    /*
+     * (non-Javadoc)
+     * 
+     * @see junit.framework.TestCase#tearDown
+     */
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+
+        cache.evictAll();
+        folderMetaDataDocumentHandler.shutdown();
+    }
+
     /**
      * Defines the testcase name for JUnit.
      * 

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
Sun Nov 30 21:44:52 2008
@@ -533,6 +533,12 @@
      */
     public void reset();
 
+    /**
+     * shutdown - gracefully shutdown page manager and disconnect
+     * from other singleton components, (e.g. shared caches) 
+     */
+    public void shutdown();
+
     /** 
      * Copy the source page creating and returning a new copy of the page  
      * with the same portlet and fragment collection as the source

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/DocumentHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/DocumentHandler.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/DocumentHandler.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/DocumentHandler.java
Sun Nov 30 21:44:52 2008
@@ -44,4 +44,10 @@
     DocumentHandlerFactory getHandlerFactory();
 
     void setHandlerFactory(DocumentHandlerFactory factory);
+    
+    /**
+     * shutdown - gracefully shutdown handler and disconnect
+     * from other singleton components, (e.g. shared caches) 
+     */
+    public void shutdown();
 }

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/DocumentHandlerFactory.java
Sun Nov 30 21:44:52 2008
@@ -99,4 +99,10 @@
      * @param enabled indicator
      */
     void setPermissionsEnabled(boolean enabled);
+    
+    /**
+     * shutdown - gracefully shutdown handlers and disconnect
+     * from other singleton components, (e.g. shared caches) 
+     */
+    public void shutdown();
 }

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/FolderHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/FolderHandler.java?rev=721971&r1=721970&r2=721971&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/FolderHandler.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/document/FolderHandler.java
Sun Nov 30 21:44:52 2008
@@ -163,4 +163,10 @@
      */
     boolean isFolder(String path);
     
+    
+   /**
+     * shutdown - gracefully shutdown handler and disconnect
+     * from other singleton components, (e.g. shared caches) 
+     */
+    public void shutdown();
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message