jford       2004/02/19 21:45:25

  Modified:    portal/src/test/org/apache/jetspeed/services/registry
                        TestRegistry.java
  Log:
  Added test for dublin core
  
  Revision  Changes    Path
  1.11      +31 -1     
jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/registry/TestRegistry.java
  
  Index: TestRegistry.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/registry/TestRegistry.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TestRegistry.java 5 Feb 2004 17:47:19 -0000       1.10
  +++ TestRegistry.java 20 Feb 2004 05:45:25 -0000      1.11
  @@ -65,6 +65,7 @@
   
   import org.apache.jetspeed.Jetspeed;
   import org.apache.jetspeed.cps.CommonPortletServices;
  +import org.apache.jetspeed.om.common.DublinCore;
   import org.apache.jetspeed.om.common.portlet.ContentTypeComposite;
   import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
   import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
  @@ -187,6 +188,11 @@
               pac.setName(APP_1_NAME);
               pac.setDescription("This is a Registry Test Portlet.");
               pac.setVersion("1.0");
  +            
  +            DublinCore dc = pac.getDublinCore();
  +            dc.addTitle(Jetspeed.getDefaultLocale(), "Test title 1");
  +            dc.addTitle(Jetspeed.getDefaultLocale(), "Test title 2");
  +            dc.addTitle(Jetspeed.getDefaultLocale(), "Test title 3");
   
               wac.setContextRoot("/root");
               wac.addDescription(Jetspeed.getDefaultLocale(), "This is an english 
desrcitpion");
  @@ -278,6 +284,30 @@
               throw e;
           }
   
  +    }
  +    
  +    public void testDublinCore() throws Throwable
  +    {
  +        // JetspeedPortletRegistry.clearCache();
  +        // test that portlet application exists
  +        // plugin.clearCache();
  +        try
  +        {
  +            JetspeedPortletRegistry.beginTransaction();
  +            MutablePortletApplication appExists = 
JetspeedPortletRegistry.getPortletApplication(APP_1_NAME);
  +            assertNotNull(appExists);
  +            
  +            DublinCore dc = appExists.getDublinCore();
  +            
  +            assertEquals(dc.getTitles().size(), 3);
  +            
  +            JetspeedPortletRegistry.commitTransaction();
  +        }
  +        catch(Throwable e)
  +        {
  +            JetspeedPortletRegistry.rollbackTransaction();
  +            throw e;
  +        }
       }
   
       public void testAddingPortlet() throws Throwable
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to