You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by at...@apache.org on 2008/08/20 23:56:48 UTC

svn commit: r687484 - in /portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test: java/org/apache/jetspeed/components/portletentity/ java/org/apache/jetspeed/components/portletregistry/ resources/

Author: ate
Date: Wed Aug 20 14:56:48 2008
New Revision: 687484

URL: http://svn.apache.org/viewvc?rev=687484&view=rev
Log:
fixing the registry/preferences tests

Modified:
    portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java
    portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java
    portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java
    portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
    portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/resources/registry-test.xml

Modified: portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java?rev=687484&r1=687483&r2=687484&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletentity/TestPortletEntityDAO.java Wed Aug 20 14:56:48 2008
@@ -21,7 +21,6 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
-import java.util.prefs.Preferences;
 
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
@@ -62,7 +61,7 @@
 
     private static MockJetspeedEngine mockEngine = new MockJetspeedEngine();
 
-    private PersistenceBrokerPortletEntityAccess entityAccess = null;
+    private PortletEntityAccessComponent entityAccess = null;
 
     private PortletRegistry registry;
     
@@ -72,7 +71,7 @@
         mockEngine.setComponentManager(scm);
         Jetspeed.setEngine(mockEngine);
         this.registry = (PortletRegistry) scm.getComponent("portletRegistry");
-        this.entityAccess = (PersistenceBrokerPortletEntityAccess) scm.getComponent("portletEntityAccessImpl");
+        this.entityAccess = (PortletEntityAccessComponent) scm.getComponent("portletEntityAccess");
 
         teardownTestData();
         setupTestData();
@@ -143,7 +142,7 @@
         
         List<String> prefValues = pref.getValuesList();
         
-        assertEquals("1", prefValues.size());
+        assertEquals(1, prefValues.size());
                
         prefValues.set(0, "2");
         pref.setValues(prefValues);
@@ -266,22 +265,8 @@
         {
             registry.removeApplication(pa);
         }
-
-        if (Preferences.systemRoot().nodeExists(MutablePortletApplication.PREFS_ROOT))
-        {
-            Preferences.systemRoot().node(MutablePortletApplication.PREFS_ROOT).removeNode();
-        }
-
-        if (Preferences.userRoot().nodeExists(PortletDefinitionComposite.PORTLETS_PREFS_ROOT))
-        {
-            Preferences.userRoot().node(PortletDefinitionComposite.PORTLETS_PREFS_ROOT).removeNode();
-        }
-
-        if (Preferences.userRoot().nodeExists(MutablePortletEntity.PORTLET_ENTITY_ROOT))
-        {
-            Preferences.userRoot().node(MutablePortletEntity.PORTLET_ENTITY_ROOT).removeNode();
-        }
-
+        
+        // TODO: remove portletPreferences...
     }
 
     private void setupTestData() throws Exception
@@ -318,6 +303,6 @@
     protected String[] getConfigurations()
     {
         return new String[]
-        { "transaction.xml", "registry-test.xml", "prefs.xml", "cache.xml" };
+        { "transaction.xml", "registry-test.xml", "cache.xml" };
     }
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java?rev=687484&r1=687483&r2=687484&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/AbstractRegistryTest.java Wed Aug 20 14:56:48 2008
@@ -201,7 +201,7 @@
     protected String[] getConfigurations()
     {
         return new String[]
-        { "transaction.xml", "prefs.xml", "registry-test.xml", "cache.xml" };
+        { "transaction.xml", "registry-test.xml", "cache.xml" };
     }
 
 }
\ No newline at end of file

Modified: portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java?rev=687484&r1=687483&r2=687484&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestPortletRegistryDAO.java Wed Aug 20 14:56:48 2008
@@ -23,8 +23,10 @@
 
 import javax.portlet.PortletMode;
 
+import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.persistence.store.LockFailedException;
 import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.engine.MockJetspeedEngine;
 import org.apache.jetspeed.om.common.DublinCore;
 import org.apache.jetspeed.om.common.GenericMetadata;
 import org.apache.jetspeed.om.common.JetspeedServiceReference;
@@ -78,12 +80,16 @@
 
     protected PortletRegistry portletRegistry;
 
+    private static MockJetspeedEngine mockEngine = new MockJetspeedEngine();
+
     /*
      * @see TestCase#setUp()
      */
     protected void setUp() throws Exception
     {
         super.setUp();
+        mockEngine.setComponentManager(scm);
+        Jetspeed.setEngine(mockEngine);
         this.portletRegistry = (PortletRegistry) scm.getComponent("portletRegistry");
 
         buildTestData();
@@ -100,6 +106,7 @@
         {
             portletRegistry.removeApplication((PortletApplicationDefinition) itr.next());
         }
+        Jetspeed.setEngine(null);
         super.tearDown();
     }
 
@@ -320,6 +327,6 @@
     protected String[] getConfigurations()
     {
         return new String[]
-        { "transaction.xml", "registry-test.xml", "prefs.xml", "cache.xml" };
+        { "transaction.xml", "registry-test.xml", "cache.xml" };
     }
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java?rev=687484&r1=687483&r2=687484&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/java/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java Wed Aug 20 14:56:48 2008
@@ -22,8 +22,10 @@
 
 import javax.portlet.PortletMode;
 
+import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.persistence.store.LockFailedException;
 import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.engine.MockJetspeedEngine;
 import org.apache.jetspeed.om.common.JetspeedServiceReference;
 import org.apache.jetspeed.om.common.UserAttribute;
 import org.apache.jetspeed.om.common.UserAttributeRef;
@@ -54,12 +56,16 @@
 {
     protected PortletRegistry portletRegistry;
 
+    private static MockJetspeedEngine mockEngine = new MockJetspeedEngine();
+    
     /*
      * @see TestCase#setUp()
      */
     protected void setUp() throws Exception
     {
         super.setUp();
+        mockEngine.setComponentManager(scm);
+        Jetspeed.setEngine(mockEngine);
         this.portletRegistry = (PortletRegistry) scm.getComponent("portletRegistry");
 
         buildTestData();
@@ -170,13 +176,14 @@
         {
             portletRegistry.removeApplication((PortletApplicationDefinition) itr.next());
         }
+        Jetspeed.setEngine(null);
         super.tearDown();
     }
     
     protected String[] getConfigurations()
     {
         return new String[]
-        { "transaction.xml", "registry-test.xml", "prefs.xml", "cache.xml" };
+        { "transaction.xml", "registry-test.xml", "cache.xml" };
     }
     
 }

Modified: portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/resources/registry-test.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/resources/registry-test.xml?rev=687484&r1=687483&r2=687484&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/resources/registry-test.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-869/components/jetspeed-registry/src/test/resources/registry-test.xml Wed Aug 20 14:56:48 2008
@@ -66,6 +66,9 @@
   <!-- Portlet Preferences Implementation -->
   <bean id="PortletPreferencesProviderImpl" class="org.apache.jetspeed.components.portletpreferences.PersistenceBrokerPortletPreferencesProvider"
     init-method="init" destroy-method="destroy">
+    <constructor-arg index="0">
+      <ref bean="preferencesCache" />
+    </constructor-arg>
   </bean>
 
   <bean id="org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider" parent="baseTransactionProxy" name="portletPreferencesProvider"



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