portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/tools/pamanager TestPortletDescriptor.java
Date Thu, 04 Mar 2004 21:18:45 GMT
weaver      2004/03/04 13:18:45

  Modified:    portal/src/test/org/apache/jetspeed/tools/pamanager
                        TestPortletDescriptor.java
  Log:
  reverting to ojb-Rc4 and PB.
  
  This test now works
  
  Revision  Changes    Path
  1.14      +30 -16    jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/tools/pamanager/TestPortletDescriptor.java
  
  Index: TestPortletDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/tools/pamanager/TestPortletDescriptor.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TestPortletDescriptor.java	29 Feb 2004 05:10:03 -0000	1.13
  +++ TestPortletDescriptor.java	4 Mar 2004 21:18:45 -0000	1.14
  @@ -67,6 +67,7 @@
   import org.apache.commons.logging.impl.Log4jFactory;
   import org.apache.jetspeed.components.AbstractComponentAwareTestCase;
   import org.apache.jetspeed.components.ComponentAwareTestSuite;
  +import org.apache.jetspeed.components.persistence.store.PersistenceStore;
   import org.apache.jetspeed.components.portletregsitry.PortletRegistryComponent;
   import org.apache.jetspeed.cps.CommonPortletServices;
   import org.apache.jetspeed.om.common.MutableLanguage;
  @@ -75,6 +76,7 @@
   import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
   import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
   import org.apache.jetspeed.om.common.preference.PreferenceComposite;
  +import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
   import org.apache.jetspeed.persistence.PersistencePlugin;
   import org.apache.jetspeed.persistence.PersistenceService;
   import org.apache.log4j.PropertyConfigurator;
  @@ -342,26 +344,32 @@
   
       }
   
  -    public void xtestWritingToDB() throws Exception
  +    public void testWritingToDB() throws Exception
       {
  +        PersistenceStore store = registry.getPersistenceStore();
  +        store.getTransaction().begin();
           MutablePortletApplication app = registry.getPortletApplication("HW_App");
           if (app != null)
  -        {                
  -            registry.removeApplication(app);                           
  +        {            
  +            registry.removeApplication(app);
  +            store.getTransaction().commit();
  +            store.getTransaction().begin();
           }
           app = PortletDescriptorUtilities.loadPortletDescriptor("./test/testdata/deploy/portlet2.xml",
"HW_App");
  -
  +        
           app.setName("HW_App");
  +                
  +        store.getTransaction().begin();
   	    registry.registerPortletApplication(app);
  -     
  -      
  -        PersistenceService ps = (PersistenceService) CommonPortletServices.getPortalService(PersistenceService.SERVICE_NAME);
  -        PersistencePlugin plugin = ps.getDefaultPersistencePlugin();
  -        
  -
  +	    store.getTransaction().commit();
  +	   // store.invalidateAll();
  +	    
  +	    store.getTransaction().begin();
           PortletDefinition pd = registry.getPortletDefinitionByUniqueName("HW_App::PreferencePortlet");
  -        assertNotNull(pd);
  -
  +        store.getTransaction().commit();
  +        assertNotNull(pd);       
  +       
  +        
           assertNotNull(pd.getPreferenceSet());
   
           Preference pref1 = pd.getPreferenceSet().get("pref1");
  @@ -377,9 +385,15 @@
           }
   
           assertTrue(count > 0);
  -
  -     	
  -        registry.removeApplication(app);
  +        
  +        store.getTransaction().begin();
  +        pd = registry.getPortletDefinitionByUniqueName("HW_App::PickANumberPortlet");
  +        store.getTransaction().commit();
  +        assertNotNull(pd);
  +        
  +        store.getTransaction().begin();
  +        registry.removeApplication(app);        
  +        store.getTransaction().commit();
   			
        
   
  
  
  

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


Mime
View raw message