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 we...@apache.org on 2004/02/04 22:35:26 UTC

cvs commit: jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/page TestPageDBPersistence.java TestPageXmlPersistence.java

weaver      2004/02/04 13:35:26

  Modified:    portal/src/test/org/apache/jetspeed/spi/services/prefs
                        TestPropertyManagerService.java
                        TestPreferences.java
               portal/src/test/org/apache/jetspeed/tools TestWebXML.java
               portal/src/test/org/apache/jetspeed/services/idgenerator
                        TestIdGenerator.java
               portal/src/test/org/apache/jetspeed/aggregator
                        TestAggregator.java
               portal/src/test/org/apache/jetspeed/services/persistence
                        TestPersistenceService.java
               portal/src/test/org/apache/jetspeed/tools/pamanager
                        TestPortletDescriptor.java
               portal/src/test/org/apache/jetspeed/deployment
                        TestSimpleDeployment.java
               portal/src/test/org/apache/jetspeed/om/page
                        TestPageObjectModel.java
               portal/src/test/org/apache/jetspeed/cache/file
                        TestFileCache.java
               portal/src/test/org/apache/jetspeed/pipeline
                        TestPipeline.java
               portal/src/test/org/apache/jetspeed/services/jmx
                        TestJMX.java
               portal/src/test/org/apache/jetspeed/profiler
                        TestProfiler.java
               portal/src/test/org/apache/jetspeed/test JetspeedTest.java
               portal/src/test/org/apache/jetspeed/services/registry
                        TestRegistry.java
               portal/src/test/org/apache/jetspeed/container/url
                        TestPortletURL.java
               portal/src/test/org/apache/jetspeed/capability
                        TestCapability.java
               portal/src/test/org/apache/jetspeed/security
                        TestSecurityHelper.java
               portal/src/test/org/apache/jetspeed/services/page
                        TestPageDBPersistence.java
                        TestPageXmlPersistence.java
  Added:       portal/src/test/org/apache/jetspeed/test
                        JetspeedTestSuite.java
  Log:
  We now use JetspeedTestSuite intead of TestSuite.  This allows us to prestart the Engine plus we now only start the engine once per suite instead of once per case
  
  Revision  Changes    Path
  1.3       +4 -3      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/spi/services/prefs/TestPropertyManagerService.java
  
  Index: TestPropertyManagerService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/spi/services/prefs/TestPropertyManagerService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestPropertyManagerService.java	27 Dec 2003 17:02:36 -0000	1.2
  +++ TestPropertyManagerService.java	4 Feb 2004 21:35:24 -0000	1.3
  @@ -67,6 +67,7 @@
   import org.apache.jetspeed.cps.CommonPortletServices;
   import org.apache.jetspeed.spi.services.prefs.impl.PropertyException;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   
   /**
    * <p>Unit testing for {@link PropertyManagerService}.</p>
  @@ -105,7 +106,7 @@
       /**
        * @see junit.framework.TestCase#setUp()
        */
  -    public void setUp()
  +    public void setUp() throws Exception
       {
           super.setUp();
           destroyPropertySetDefTestObject(true);
  @@ -114,7 +115,7 @@
       /**
        * @see junit.framework.TestCase#tearDown()
        */
  -    public void tearDown()
  +    public void tearDown() throws Exception
       {
           super.tearDown();
           destroyPropertySetDefTestObject(true);
  @@ -127,7 +128,7 @@
        */
       public static Test suite()
       {
  -        return new TestSuite(TestPropertyManagerService.class);
  +        return new JetspeedTestSuite(TestPropertyManagerService.class);
       }
   
       /**
  
  
  
  1.4       +4 -3      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/spi/services/prefs/TestPreferences.java
  
  Index: TestPreferences.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/spi/services/prefs/TestPreferences.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestPreferences.java	27 Dec 2003 17:02:36 -0000	1.3
  +++ TestPreferences.java	4 Feb 2004 21:35:24 -0000	1.4
  @@ -70,6 +70,7 @@
   import org.apache.jetspeed.cps.CommonPortletServices;
   import org.apache.jetspeed.spi.services.prefs.impl.PropertyException;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   
   /**
    * <p>Unit testing for {@link Preferences}.</p>
  @@ -108,7 +109,7 @@
       /**
        * @see junit.framework.TestCase#setUp()
        */
  -    public void setUp()
  +    public void setUp() throws Exception
       {
           super.setUp();
           destroyPropertySetDefTestObject();
  @@ -117,7 +118,7 @@
       /**
        * @see junit.framework.TestCase#tearDown()
        */
  -    public void tearDown()
  +    public void tearDown() throws Exception
       {
           super.tearDown();
           destroyPropertySetDefTestObject();
  @@ -130,7 +131,7 @@
        */
       public static Test suite()
       {
  -        return new TestSuite(TestPreferences.class);
  +        return new JetspeedTestSuite(TestPreferences.class);
       }
   
       /**
  
  
  
  1.2       +4 -2      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/tools/TestWebXML.java
  
  Index: TestWebXML.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/tools/TestWebXML.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestWebXML.java	28 Jul 2003 23:47:55 -0000	1.1
  +++ TestWebXML.java	4 Feb 2004 21:35:25 -0000	1.2
  @@ -53,6 +53,8 @@
    */
   package org.apache.jetspeed.tools;
   
  +import org.apache.jetspeed.test.JetspeedTestSuite;
  +
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  @@ -81,7 +83,7 @@
        */
       public static Test suite() 
       {
  -        return new TestSuite(TestWebXML.class);
  +        return new JetspeedTestSuite(TestWebXML.class);
       }
   
       /**
  
  
  
  1.2       +3 -2      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/idgenerator/TestIdGenerator.java
  
  Index: TestIdGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/idgenerator/TestIdGenerator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestIdGenerator.java	28 Jul 2003 23:47:54 -0000	1.1
  +++ TestIdGenerator.java	4 Feb 2004 21:35:25 -0000	1.2
  @@ -60,6 +60,7 @@
   import junit.framework.TestSuite;
   
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   
   /**
    * TestIdGenerator
  @@ -104,7 +105,7 @@
       public static Test suite() 
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite( TestIdGenerator.class );
  +        return new JetspeedTestSuite( TestIdGenerator.class );
       }
       
       /**
  
  
  
  1.4       +3 -2      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/aggregator/TestAggregator.java
  
  Index: TestAggregator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/aggregator/TestAggregator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestAggregator.java	4 Dec 2003 04:52:09 -0000	1.3
  +++ TestAggregator.java	4 Feb 2004 21:35:25 -0000	1.4
  @@ -57,6 +57,7 @@
   import junit.framework.TestSuite;
   
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   
   import org.apache.jetspeed.request.RequestContext;
   import org.apache.jetspeed.request.RequestContextFactory;
  @@ -86,7 +87,7 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestAggregator.class);
  +        return new JetspeedTestSuite(TestAggregator.class);
       }
   
       /**
  
  
  
  1.11      +33 -31    jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/persistence/TestPersistenceService.java
  
  Index: TestPersistenceService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/persistence/TestPersistenceService.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TestPersistenceService.java	8 Dec 2003 18:28:07 -0000	1.10
  +++ TestPersistenceService.java	4 Feb 2004 21:35:25 -0000	1.11
  @@ -58,9 +58,6 @@
   import java.util.Locale;
   
   import junit.framework.Test;
  -import junit.framework.TestSuite;
  -
  -import org.apache.commons.configuration.Configuration;
   import org.apache.jetspeed.cps.CommonPortletServices;
   import org.apache.jetspeed.om.common.MutableLanguage;
   import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
  @@ -75,6 +72,7 @@
   import org.apache.jetspeed.persistence.PersistenceService;
   import org.apache.jetspeed.persistence.TransactionStateException;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   import org.apache.pluto.om.common.Language;
   import org.apache.pluto.om.portlet.PortletDefinition;
   import org.apache.pluto.om.servlet.WebApplicationDefinition;
  @@ -88,8 +86,11 @@
   public class TestPersistenceService extends JetspeedTest
   {
   
  +    private static final String TEST_APP_1 = "test adding object";
       private PersistenceService service;
   
  +    private PersistencePlugin plugin;
  +
       /**
        * @param testName
        */
  @@ -101,16 +102,16 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestPersistenceService.class);
  +        return new JetspeedTestSuite(TestPersistenceService.class);
       }
   
       /**
        * @see org.apache.jetspeed.test.JetspeedTest#overrideProperties(org.apache.commons.configuration.Configuration)
        */
  -    public void overrideProperties(Configuration properties)
  -    {
  -        super.overrideProperties(properties);
  -    }
  +//    public void overrideProperties(Configuration properties)
  +//    {
  +//        super.overrideProperties(properties);
  +//    }
   
       public void testInit() throws Exception
       {
  @@ -119,7 +120,7 @@
   
       public void testDefaultPlugin()
       {
  -        PersistencePlugin plugin = getService().getPersistencePlugin("jetspeed-test");
  +        
           assertNotNull(plugin);
       }
   
  @@ -171,7 +172,7 @@
   
       public void testAddingLangaugeToPortlet() throws Exception
       {
  -        PersistencePlugin plugin = service.getPersistencePlugin("jetspeed-test");
  +        
   
           try
           {
  @@ -210,7 +211,7 @@
       {
           initTestObject();
   
  -        PersistencePlugin plugin = getService().getPersistencePlugin("jetspeed-test");
  +        
   
           PortletApplicationDefinitionImpl app;
           try
  @@ -249,13 +250,13 @@
       }
   
       public void testAdd2atATime() throws TransactionStateException
  -    {
  -        PersistencePlugin plugin = getService().getPersistencePlugin("jetspeed-test");
  +    {        
           MutablePortletApplication app1 = new PortletApplicationDefinitionImpl();
   
           try
           {
               plugin.beginTransaction();
  +            
               plugin.prepareForUpdate(app1);
               app1.setName("This is app 1 of 2");
               app1.setVersion("1.0");
  @@ -291,7 +292,7 @@
   
       public void testGet2atATime() throws TransactionStateException
       {
  -        PersistencePlugin plugin = getService().getPersistencePlugin("jetspeed-test");
  +       
           LookupCriteria lc1 = plugin.newLookupCriteria();
           lc1.addEqualTo("name", "This is app 1 of 2");
           MutablePortletApplication app1 =
  @@ -339,7 +340,7 @@
   
           assertNotNull(app);
   
  -        PersistencePlugin plugin = getService().getPersistencePlugin("jetspeed-test");
  +        
   
           try
           {
  @@ -376,9 +377,9 @@
   
           assertNotNull(app);
           
  -        PersistencePlugin plugin = getService().getPersistencePlugin("jetspeed-test");
  +        
           LookupCriteria c = plugin.newLookupCriteria();
  -        c.addEqualTo("name", "test adding object");
  +        c.addEqualTo("name", TEST_APP_1);
           Object query = plugin.generateQuery(PortletApplicationDefinitionImpl.class, c);
           plugin.deleteByQuery(query);
   
  @@ -400,14 +401,14 @@
       protected void initTestObject()
       {
   
  -        PersistencePlugin plugin = getService().getPersistencePlugin("jetspeed-test");
  +        
           try
           {
   
               plugin.beginTransaction();
               MutablePortletApplication app = new PortletApplicationDefinitionImpl();
               plugin.prepareForUpdate(app);
  -            app.setName("test adding object");
  +            app.setName(TEST_APP_1);
               app.setVersion("1.0");
               app.setDescription("This is a test from persistence layer");
               // create a web application
  @@ -449,7 +450,7 @@
   
       protected Language getEnglishLanguage()
       {
  -        PersistencePlugin plugin = service.getPersistencePlugin("jetspeed-test");
  +        
           MutableLanguage lang = new LanguageImpl();
   
           lang.setTitle("Portlet Title");
  @@ -462,9 +463,9 @@
   
       protected PortletApplicationDefinitionImpl getTestObject1()
       {
  -        PersistencePlugin plugin = getService().getPersistencePlugin("jetspeed-test");
  +        
           LookupCriteria c = plugin.newLookupCriteria();
  -        c.addEqualTo("name", "test adding object");
  +        c.addEqualTo("name", TEST_APP_1);
   
           Object obj =
               plugin.getObjectByQuery(
  @@ -476,13 +477,12 @@
   
       protected void destroyTestObject()
       {
  -        PersistencePlugin plugin = getService().getPersistencePlugin("jetspeed-test");
  +        
           LookupCriteria c = plugin.newLookupCriteria();
  -        c.addEqualTo("name", "test adding object");
  + 		c.addEqualTo("name",  TEST_APP_1);
  + 		Object query = plugin.generateQuery(PortletApplicationDefinitionImpl.class, c);
           Collection removeUs =
  -            plugin.getCollectionByQuery(
  -                PortletApplicationDefinitionImpl.class,
  -                plugin.generateQuery(PortletApplicationDefinitionImpl.class, c));
  +            plugin.getCollectionByQuery(PortletApplicationDefinitionImpl.class, query);
   
           Iterator itr = removeUs.iterator();
           try
  @@ -513,18 +513,20 @@
       /**com
        * @see junit.framework.TestCase#tearDown()
        */
  -    public void tearDown()
  +    public void tearDown() throws Exception
       {
  +		destroyTestObject();
           super.tearDown();
  -        destroyTestObject();
  +        
       }
   
       /**
        * @see junit.framework.TestCase#setUp()
        */
  -    public void setUp()
  +    public void setUp() throws Exception
       {
           super.setUp();
  +		plugin = getService().getDefaultPersistencePlugin();
           destroyTestObject();
       }
   
  
  
  
  1.11      +22 -9     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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TestPortletDescriptor.java	12 Jan 2004 06:45:26 -0000	1.10
  +++ TestPortletDescriptor.java	4 Feb 2004 21:35:25 -0000	1.11
  @@ -63,6 +63,7 @@
   
   import org.apache.commons.configuration.Configuration;
   import org.apache.jetspeed.cps.CommonPortletServices;
  +import org.apache.jetspeed.exception.RegistryException;
   import org.apache.jetspeed.om.common.MutableLanguage;
   import org.apache.jetspeed.om.common.ParameterComposite;
   import org.apache.jetspeed.om.common.portlet.ContentTypeComposite;
  @@ -74,6 +75,7 @@
   import org.apache.jetspeed.persistence.TransactionStateException;
   import org.apache.jetspeed.registry.JetspeedPortletRegistry;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   import org.apache.pluto.om.common.DisplayName;
   import org.apache.pluto.om.common.LanguageSet;
   import org.apache.pluto.om.common.ParameterSet;
  @@ -122,16 +124,16 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestPortletDescriptor.class);
  +        return new JetspeedTestSuite(TestPortletDescriptor.class);
       }
   
       /*
        * Overrides the database properties
        */
  -    public void overrideProperties(Configuration properties)
  -    {
  -        super.overrideProperties(properties);
  -    }
  +//    public void overrideProperties(Configuration properties)
  +//    {
  +//        super.overrideProperties(properties);
  +//    }
   
       public void testLoadPortletApplicationTree() throws Exception
       {
  @@ -323,12 +325,23 @@
           app = PortletDescriptorUtilities.loadPortletDescriptor("./test/testdata/deploy/portlet2.xml", "HW_App");
   
           app.setName("HW_App");
  -        JetspeedPortletRegistry.registerPortletApplication(app);
  +		try
  +        {
  +            JetspeedPortletRegistry.beginTransaction();
  +            JetspeedPortletRegistry.registerPortletApplication(app);
  +            JetspeedPortletRegistry.commitTransaction();
  +        }
  +        catch (Exception e)
  +        {
  +			JetspeedPortletRegistry.rollbackTransaction();
  +			throw e;
  +        }
  +      
           PersistenceService ps = (PersistenceService) CommonPortletServices.getPortalService(PersistenceService.SERVICE_NAME);
           PersistencePlugin plugin = ps.getDefaultPersistencePlugin();
  -        plugin.clearCache();
  +        
   
  -        PortletDefinition pd = JetspeedPortletRegistry.getPortletDefinitionByUniqueName("PreferencePortlet");
  +        PortletDefinition pd = JetspeedPortletRegistry.getPortletDefinitionByUniqueName("HW_App::PreferencePortlet");
           assertNotNull(pd);
   
           assertNotNull(pd.getPreferenceSet());
  
  
  
  1.4       +11 -12    jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/deployment/TestSimpleDeployment.java
  
  Index: TestSimpleDeployment.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/deployment/TestSimpleDeployment.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestSimpleDeployment.java	15 Jan 2004 22:26:22 -0000	1.3
  +++ TestSimpleDeployment.java	4 Feb 2004 21:35:25 -0000	1.4
  @@ -11,9 +11,7 @@
   
   import junit.framework.AssertionFailedError;
   import junit.framework.Test;
  -import junit.framework.TestSuite;
   
  -import org.apache.commons.configuration.Configuration;
   import org.apache.jetspeed.deployment.fs.FileSystemScanner;
   import org.apache.jetspeed.deployment.fs.JARObjectHandlerImpl;
   import org.apache.jetspeed.deployment.impl.DeployDecoratorEventListener;
  @@ -22,6 +20,7 @@
   import org.apache.jetspeed.deployment.simpleregistry.impl.InMemoryRegistryImpl;
   import org.apache.jetspeed.registry.JetspeedPortletRegistry;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   import org.apache.jetspeed.tools.pamanager.FileSystemPAM;
   import org.apache.jetspeed.tools.pamanager.PortletApplicationException;
   import org.apache.jetspeed.util.DirectoryUtils;
  @@ -75,13 +74,13 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestSimpleDeployment.class);
  +        return new JetspeedTestSuite(TestSimpleDeployment.class);
       }
   
  -    public void overrideProperties(Configuration properties)
  -    {
  -        super.overrideProperties(properties);
  -    }
  +//    public void overrideProperties(Configuration properties)
  +//    {
  +//        super.overrideProperties(properties);
  +//    }
   
       public void testDeploy() throws Exception
       {
  @@ -99,7 +98,7 @@
           DeploymentEventDispatcher ded = new DeploymentEventDispatcher(deployRoot);
           SimpleRegistry registry = new InMemoryRegistryImpl();
           DeployDecoratorEventListener ddel = new DeployDecoratorEventListener(registry);
  -        DeployPortletAppEventListener dpal = new DeployPortletAppEventListener(webAppsDir, testDb, new FileSystemPAM());
  +        DeployPortletAppEventListener dpal = new DeployPortletAppEventListener(webAppsDir, new FileSystemPAM());
           ded.addDeploymentListener(ddel);
           ded.addDeploymentListener(dpal);
           HashMap handlers = new HashMap();
  @@ -137,7 +136,7 @@
               testDb = new File("./test/db/hsql/Registry").getCanonicalPath();
               // remove any prior left overs
               
  -			FileSystemPAM pam = new FileSystemPAM(testDb);
  +			FileSystemPAM pam = new FileSystemPAM();
   			
   			pam.undeploy(webAppsDir, TEST_PORTLET_APP_NAME);	
           }
  @@ -152,11 +151,11 @@
       /**
        * @see junit.framework.TestCase#tearDown()
        */
  -    public void tearDown()
  +    public void tearDown() throws Exception
       {
           
           super.tearDown();
  -		FileSystemPAM pam = new FileSystemPAM(testDb);
  +		FileSystemPAM pam = new FileSystemPAM();
   		try
           {
               pam.undeploy(webAppsDir, TEST_PORTLET_APP_NAME);
  
  
  
  1.3       +3 -4      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/om/page/TestPageObjectModel.java
  
  Index: TestPageObjectModel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/om/page/TestPageObjectModel.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestPageObjectModel.java	8 Aug 2003 22:05:55 -0000	1.2
  +++ TestPageObjectModel.java	4 Feb 2004 21:35:25 -0000	1.3
  @@ -60,8 +60,7 @@
   import junit.framework.TestSuite;
   
   import org.apache.jetspeed.test.JetspeedTest;
  -import org.apache.jetspeed.om.page.Page;
  -import org.apache.jetspeed.om.page.Fragment;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   import org.apache.jetspeed.om.page.psml.FragmentImpl;
   import org.apache.jetspeed.om.page.psml.PageImpl;
   
  @@ -108,7 +107,7 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite( TestPageObjectModel.class );
  +        return new JetspeedTestSuite( TestPageObjectModel.class );
       }
   
       private Page buildBasePage()
  
  
  
  1.2       +3 -2      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/cache/file/TestFileCache.java
  
  Index: TestFileCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/cache/file/TestFileCache.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestFileCache.java	28 Jul 2003 23:47:54 -0000	1.1
  +++ TestFileCache.java	4 Feb 2004 21:35:25 -0000	1.2
  @@ -66,6 +66,7 @@
   import org.apache.commons.io.StreamUtils;
   import org.apache.commons.lang.exception.ExceptionUtils;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   import org.apache.jetspeed.util.FileCopy;
   
   /**
  @@ -107,7 +108,7 @@
       public static Test suite() 
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite( TestFileCache.class );
  +        return new JetspeedTestSuite( TestFileCache.class );
       }
   
       /**
  
  
  
  1.5       +3 -2      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/pipeline/TestPipeline.java
  
  Index: TestPipeline.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/pipeline/TestPipeline.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestPipeline.java	4 Dec 2003 04:52:09 -0000	1.4
  +++ TestPipeline.java	4 Feb 2004 21:35:25 -0000	1.5
  @@ -58,6 +58,7 @@
   
   import org.apache.jetspeed.pipeline.valve.Valve;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   
   /**
    * TestPipeline
  @@ -101,7 +102,7 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestPipeline.class);
  +        return new JetspeedTestSuite(TestPipeline.class);
       }
   
       /**
  
  
  
  1.2       +7 -6      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/jmx/TestJMX.java
  
  Index: TestJMX.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/jmx/TestJMX.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestJMX.java	28 Jul 2003 23:47:54 -0000	1.1
  +++ TestJMX.java	4 Feb 2004 21:35:25 -0000	1.2
  @@ -65,6 +65,7 @@
   import org.apache.commons.configuration.Configuration;
   import org.apache.commons.modeler.ManagedBean;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   /**
    * TestRegistryCategories
    *
  @@ -77,10 +78,10 @@
       /**
        * @see org.apache.jetspeed.test.JetspeedTest#overrideProperties(org.apache.commons.configuration.Configuration)
        */
  -    public void overrideProperties(Configuration properties)
  -    {
  -        super.overrideProperties(properties);
  -    }
  +//    public void overrideProperties(Configuration properties)
  +//    {
  +//        super.overrideProperties(properties);
  +//    }
   
       /**
        * Defines the testcase name for JUnit.
  @@ -115,7 +116,7 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestJMX.class);
  +        return new JetspeedTestSuite(TestJMX.class);
       }
   
       /**
  
  
  
  1.6       +2 -1      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/profiler/TestProfiler.java
  
  Index: TestProfiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/profiler/TestProfiler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestProfiler.java	19 Jan 2004 23:40:02 -0000	1.5
  +++ TestProfiler.java	4 Feb 2004 21:35:25 -0000	1.6
  @@ -78,6 +78,7 @@
   import org.apache.jetspeed.request.RequestContext;
   import org.apache.jetspeed.security.impl.UserPrincipalImpl;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   
   /**
    * TestProfiler
  @@ -123,7 +124,7 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestProfiler.class);
  +        return new JetspeedTestSuite(TestProfiler.class);
       }
   
       protected ProfilerService getService()
  
  
  
  1.2       +27 -99    jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/test/JetspeedTest.java
  
  Index: JetspeedTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/test/JetspeedTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JetspeedTest.java	28 Jul 2003 23:47:55 -0000	1.1
  +++ JetspeedTest.java	4 Feb 2004 21:35:25 -0000	1.2
  @@ -55,21 +55,10 @@
   
   import junit.framework.Test;
   import junit.framework.TestCase;
  -import junit.framework.TestSuite;
   
  -import java.io.File;
  -import java.io.IOException;
  -import java.io.FileInputStream;
  -import java.util.Properties;
  -import java.util.Iterator;
  -import java.util.Map.Entry;
  -
  -import org.apache.commons.configuration.Configuration;
  -import org.apache.commons.configuration.PropertiesConfiguration;
  -import org.apache.jetspeed.Jetspeed;
   import org.apache.jetspeed.engine.Engine;
   import org.apache.jetspeed.engine.JetspeedEngineConstants;
  -import org.apache.jetspeed.exception.JetspeedException;
  +
   
   /**
    * Tests the Jetspeed Engine.
  @@ -78,66 +67,49 @@
    * @since 2.0
    * @version $Id$
    */
  -public abstract class JetspeedTest
  -    extends TestCase
  -    implements JetspeedEngineConstants
  +public abstract class JetspeedTest extends TestCase implements JetspeedEngineConstants
   {
  +	
  +	
  +
  +	
       /**
        * Creates a new instance.
        */
  -    public JetspeedTest(String testName) 
  +    public JetspeedTest(String testName)
       {
           super(testName);
  +		
       }
   
       /**
        * Return the Test
        */
  -    public static Test suite() 
  -    {
  -        return new TestSuite(JetspeedTest.class);
  +    public static Test suite()
  +    {    	
  +        return new JetspeedTestSuite(JetspeedTest.class);
       }
   
       protected Engine engine = null;
  +	protected JetspeedTestSuite jsuite;
   
       /**
        * Setup the test.
        */
  -    public void setUp() 
  +    public void setUp() throws Exception
       {
  -        try
  -        {
  -            if (engine != null)
  -            {
  -                return;
  -            }
  -            String propertiesFilename = getPropertiesFile();
  -            String applicationRoot = getApplicationRoot();
  -            Configuration properties = (Configuration) 
  -                new PropertiesConfiguration(propertiesFilename);
  -            
  -            properties.setProperty(APPLICATION_ROOT_KEY, applicationRoot);
  -            //properties.setProperty(WEBAPP_ROOT_KEY, null);
  -            overrideProperties(properties);
  -            engine = Jetspeed.createEngine(properties, applicationRoot, null);
  -
  -        }
  -        catch (Exception e)
  -        {
  -            e.printStackTrace();
  -            assertTrue("Failed to setup JetspeedTest", false);
  -        }
  +  
  +        super.setUp();
       }
   
  -   
       /**
        * Override to set your own properties file
        *
        */
  -    public String getPropertiesFile()
  -    {
  -        return "./src/webapp/WEB-INF/conf/jetspeed.properties";
  -    }
  +//    public String getPropertiesFile()
  +//    {
  +//        return jsuite.getPropertiesFile();
  +//    }
   
       /**
        * Override to set your own application root
  @@ -145,63 +117,19 @@
        */
       public String getApplicationRoot()
       {
  -        return "./src/webapp";
  +        return jsuite.getApplicationRoot();
       }
   
  -    /*
  -     * Implement this method to override any properties in your test.
  -     * If you override this method in a derived class, call super.overrideProperties to get these settings
  -     * 
  -     * @param properties The base configuration properties for the Jetspeed system.
  -     */
  -    public void overrideProperties(Configuration properties)
  -    {        
  -        String testPropsPath = getApplicationRoot() + "/WEB-INF/conf/test/jetspeed.properties";
  -        try
  -        {
  -            File testFile = new File(testPropsPath);
  -            if (testFile.exists())
  -            {
  -                FileInputStream is = new FileInputStream(testPropsPath);
  -                Properties props = new Properties();
  -                props.load(is);
  -
  -                Iterator it = props.entrySet().iterator();
  -                while (it.hasNext())
  -                {
  -                    Entry entry = (Entry)it.next();
  -                    //if (entry.getValue() != null && ((String)entry.getValue()).length() > 0)
  -                    properties.setProperty((String)entry.getKey(), (String)entry.getValue());                    
  -                }
  -            }
  -        }
  -        catch (IOException e)
  -        {
  -            e.printStackTrace();
  -            assertTrue("Failed to read Test-specific properties", false);            
  -        }
  -    }
  -    
       /**
        * Tear down the test.
        */
  -    public void tearDown() 
  +    public void tearDown() throws Exception
       {
  -        try
  -        {
  -            if (engine != null)
  -            {
  -                Jetspeed.shutdown();
  -            }
  -        }
  -        catch (JetspeedException e)
  -        {
  -            e.printStackTrace();
  -        }
  -        finally
  -        {
  -            engine = null;
  -        }
  +
       }
  +
  +   
  +
  +
   
   }
  
  
  
  1.1                  jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/test/JetspeedTestSuite.java
  
  Index: JetspeedTestSuite.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Jetspeed" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Jetspeed", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.jetspeed.test;
  
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.IOException;
  import java.util.Iterator;
  import java.util.Properties;
  import java.util.Map.Entry;
  
  import junit.framework.Test;
  import junit.framework.TestResult;
  import junit.framework.TestSuite;
  
  import org.apache.commons.configuration.Configuration;
  import org.apache.commons.configuration.PropertiesConfiguration;
  import org.apache.jetspeed.Jetspeed;
  import org.apache.jetspeed.engine.Engine;
  import org.apache.jetspeed.engine.JetspeedEngineConstants;
  import org.apache.jetspeed.exception.JetspeedException;
  
  /**
   * <p>
   * JetspeedTestSuite
   * </p>
   * 
   * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
   * @version $Id: JetspeedTestSuite.java,v 1.1 2004/02/04 21:35:25 weaver Exp $
   *
   */
  public class JetspeedTestSuite extends TestSuite
  {
      protected static Engine engine = null;    
  
      /**
       * 
       */
      public JetspeedTestSuite()
      {
          super();
  		startEngine(getApplicationRoot(), getPropertiesFile());
          
      }
  
      /**
       * @param arg0
       * @param arg1
       */
      public JetspeedTestSuite(Class arg0, String arg1)
      {
          super(arg0, arg1);
  		startEngine(getApplicationRoot(), getPropertiesFile());
          
      }
  
      /**
       * @param arg0
       */
      public JetspeedTestSuite(Class arg0)
      {
          super(arg0);
  		startEngine(getApplicationRoot(), getPropertiesFile());
          
      }
  
      /**
       * @param arg0
       */
      public JetspeedTestSuite(String arg0)
      {
          super(arg0);
  		startEngine(getApplicationRoot(), getPropertiesFile());
          
      }
  
      protected static void startEngine(String applicationRoot, String propertiesFilename)
      {
          try
          {
              if (engine != null)
              {
                  return;
              }
              
              Configuration properties = (Configuration) new PropertiesConfiguration(propertiesFilename);
  
              properties.setProperty(JetspeedEngineConstants.APPLICATION_ROOT_KEY, applicationRoot);
              //properties.setProperty(WEBAPP_ROOT_KEY, null);
              initializeConfiguration(properties, applicationRoot);
              engine = Jetspeed.createEngine(properties, applicationRoot, null);
  
          }
          catch (Exception e)
          {
              e.printStackTrace();
  
          }
      }
      protected static void stopEngine()
      {
          try
          {
              if (engine != null)
              {
                  Jetspeed.shutdown();
              }
          }
          catch (JetspeedException e)
          {
              e.printStackTrace();
          }
          finally
          {
              engine = null;
          }
      }
  
      /**
       * Override to set your own application root
       *
       */
      public String getApplicationRoot()
      {
          return "./src/webapp";
      }
  
      /**
       * Override to set your own properties file
       *
       */
      public String getPropertiesFile()
      {
          return "./src/webapp/WEB-INF/conf/jetspeed.properties";
      }
  
      /*
       * Implement this method to override any properties in your TestSuite.
       * If you override this method in a derived class, call super.overrideProperties to get these settings
       * 
       * @param properties The base configuration properties for the Jetspeed system.
       */
      protected static void initializeConfiguration(Configuration properties, String appRoot)
      {
          String testPropsPath = appRoot + "/WEB-INF/conf/test/jetspeed.properties";
          try
          {
              File testFile = new File(testPropsPath);
              if (testFile.exists())
              {
                  FileInputStream is = new FileInputStream(testPropsPath);
                  Properties props = new Properties();
                  props.load(is);
  
                  Iterator it = props.entrySet().iterator();
                  while (it.hasNext())
                  {
                      Entry entry = (Entry) it.next();
                      //if (entry.getValue() != null && ((String)entry.getValue()).length() > 0)
                      properties.setProperty((String) entry.getKey(), (String) entry.getValue());
                  }
              }
          }
          catch (IOException e)
          {
              e.printStackTrace();
          }
      }
  
      /**
       * @see junit.framework.Test#run(junit.framework.TestResult)
       */
      public void run(TestResult arg0)
      {
          try
          {            
              super.run(arg0);
          }
          finally
          {
              stopEngine();
          }
      }
  
      /**
       * @see junit.framework.TestSuite#runTest(junit.framework.Test, junit.framework.TestResult)
       */
      public void runTest(Test arg0, TestResult arg1)
      {
          if(arg0 instanceof JetspeedTest)
          {
          	JetspeedTest jtest = (JetspeedTest) arg0;
          	jtest.engine = engine;
          	jtest.jsuite = this;
          }
          super.runTest(arg0, arg1);
      }
  
  }
  
  
  
  1.8       +349 -109  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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestRegistry.java	12 Jan 2004 07:04:20 -0000	1.7
  +++ TestRegistry.java	4 Feb 2004 21:35:25 -0000	1.8
  @@ -55,27 +55,36 @@
   
   import java.util.Collection;
   import java.util.Iterator;
  +import java.util.List;
   import java.util.Locale;
   
   import javax.portlet.PortletMode;
   
   import junit.framework.AssertionFailedError;
   import junit.framework.Test;
  -import junit.framework.TestSuite;
   
  -import org.apache.commons.configuration.Configuration;
   import org.apache.jetspeed.Jetspeed;
  +import org.apache.jetspeed.cps.CommonPortletServices;
   import org.apache.jetspeed.om.common.portlet.ContentTypeComposite;
   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.common.servlet.MutableWebApplication;
  +
  +import org.apache.jetspeed.persistence.LookupCriteria;
  +import org.apache.jetspeed.persistence.PersistencePlugin;
  +import org.apache.jetspeed.persistence.PersistenceService;
   import org.apache.jetspeed.persistence.TransactionStateException;
  +
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
  +
   import org.apache.pluto.om.common.Description;
   import org.apache.pluto.om.common.DisplayName;
   import org.apache.pluto.om.common.ParameterSetCtrl;
   import org.apache.pluto.om.portlet.ContentType;
  +import org.apache.pluto.om.portlet.PortletApplicationDefinition;
  +import org.apache.pluto.om.portlet.PortletDefinition;
   import org.apache.pluto.om.servlet.WebApplicationDefinition;
   import org.apache.jetspeed.registry.JetspeedPortletRegistry;
   /**
  @@ -89,10 +98,61 @@
    */
   public class TestRegistry extends JetspeedTest
   {
  +    private static final String PORTLET_0_CLASS = "com.portlet.MyClass0";
  +    private static final String PORTLET_0_NAME = "Portlet 0";
  +    private static final String PORTLET_1_CLASS = "com.portlet.MyClass";
  +    private static final String PORTLET_1_NAME = "Portlet 1";
  +    private static final String PORTLET_1_UID = "com.portlet.MyClass.Portlet 1";
  +    private static final String PORTLET_0_UID = "com.portlet.MyClass0.Portlet 0";
  +    private static final String MODE_HELP = "HELP";
  +    private static final String MODE_VIEW = "VIEW";
  +    private static final String MODE_EDIT = "EDIT";
  +
  +    private static int testPasses = 0;
  +
  +    PersistencePlugin plugin;
  +
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestRegistry.class);
  +        JetspeedTestSuite testSuite = new JetspeedTestSuite(TestRegistry.class);
  +        List allPortletDefinitions = JetspeedPortletRegistry.getAllPortletDefinitions();
  +        List allPortletApps = JetspeedPortletRegistry.getPortletApplications();
  +        removeCollection(allPortletApps);
  +        removeCollection(allPortletDefinitions);
  +        return testSuite;
  +
  +    }
  +
  +    protected static void removeCollection(Collection col)
  +    {
  +        PersistenceService ps = (PersistenceService) CommonPortletServices.getPortalService(PersistenceService.SERVICE_NAME);
  +        PersistencePlugin plugin = ps.getDefaultPersistencePlugin();
  +        Iterator itr = col.iterator();
  +
  +        while (itr.hasNext())
  +        {
  +
  +            try
  +            {
  +                plugin.beginTransaction();
  +                plugin.prepareForDelete(itr.next());
  +                plugin.commitTransaction();
  +            }
  +            catch (Exception e)
  +            {
  +                try
  +                {
  +                    plugin.rollbackTransaction();
  +                }
  +                catch (TransactionStateException e1)
  +                {
  +                    e1.printStackTrace();
  +                }
  +                System.out.println("Suite initialization failed");
  +                e.printStackTrace();
  +            }
  +        }
       }
   
       public static final String APP_1_NAME = "RegistryTestPortlet";
  @@ -107,49 +167,65 @@
       /**
        * @see org.apache.jetspeed.test.JetspeedTest#overrideProperties(org.apache.commons.configuration.Configuration)
        */
  -    public void overrideProperties(Configuration properties)
  -    {
  -        super.overrideProperties(properties);
  -    }
  +    //    public void overrideProperties(Configuration properties)
  +    //    {
  +    //        super.overrideProperties(properties);
  +    //    }
   
  -    public void testBuildBaseApp()
  +    protected void buildTestPortletApp()
       {
  -        clean();
  -        MutablePortletApplication pac = JetspeedPortletRegistry.newPortletApplication();
  -        MutableWebApplication wac = JetspeedPortletRegistry.newWebApplication();
  -
  -        pac.setName(APP_1_NAME);
  -        pac.setDescription("This is a Registry Test Portlet.");
  -        pac.setVersion("1.0");
  -
  -        wac.setContextRoot("/root");
  -        wac.addDescription(Jetspeed.getDefaultLocale(), "This is an english desrcitpion");
  -        wac.addDisplayName(Jetspeed.getDefaultLocale(), "This is an english display name");
  -
  -        pac.setWebApplicationDefinition(wac);
  -
  -        //add a portlet
  -        PortletDefinitionComposite portlet0 = JetspeedPortletRegistry.newPortletDefinition();
  -
  -        portlet0.setClassName("com.portlet.MyClass0");
  -        portlet0.setPortletIdentifier("com.portlet.MyClass0.Portlet 0");
  -        portlet0.setName("Portlet 0");
  -        pac.addPortletDefinition(portlet0);
  -
           try
           {
  -            JetspeedPortletRegistry.registerPortletApplication(pac);
  +            JetspeedPortletRegistry.beginTransaction();
  +            MutablePortletApplication pac =
  +                (MutablePortletApplication) JetspeedPortletRegistry.getNewObjectInstance(PortletApplicationDefinition.class, true);
  +            MutableWebApplication wac =
  +                (MutableWebApplication) JetspeedPortletRegistry.getNewObjectInstance(WebApplicationDefinition.class, true);
  +
  +            pac.setName(APP_1_NAME);
  +            pac.setDescription("This is a Registry Test Portlet.");
  +            pac.setVersion("1.0");
  +
  +            wac.setContextRoot("/root");
  +            wac.addDescription(Jetspeed.getDefaultLocale(), "This is an english desrcitpion");
  +            wac.addDisplayName(Jetspeed.getDefaultLocale(), "This is an english display name");
  +
  +            pac.setWebApplicationDefinition(wac);
  +
  +            //add a portlet
  +            PortletDefinitionComposite portlet0 =
  +                (PortletDefinitionComposite) JetspeedPortletRegistry.getNewObjectInstance(PortletDefinition.class, true);
  +
  +            portlet0.setClassName(PORTLET_0_CLASS);
  +            portlet0.setPortletIdentifier(PORTLET_0_UID);
  +            portlet0.setName(PORTLET_0_NAME);
  +            pac.addPortletDefinition(portlet0);
  +
  +            //JetspeedPortletRegistry.registerPortletApplication(pac);
  +            JetspeedPortletRegistry.commitTransaction();
  +            //            plugin.invalidateObject(pac);
  +            //			plugin.invalidateObject(portlet0);
  +
           }
           catch (Throwable e)
           {
  -
               e.printStackTrace();
  +            try
  +            {
  +                JetspeedPortletRegistry.rollbackTransaction();
  +            }
  +            catch (TransactionStateException e1)
  +            {
  +                e1.printStackTrace();
  +            }
  +
  +            throw new AssertionFailedError(e.toString());
           }
       }
   
       public void testAddApplication()
       {
  -
  +        // JetspeedPortletRegistry.clearCache();
           // test that portlet application exists
           MutablePortletApplication appExists = JetspeedPortletRegistry.getPortletApplication(APP_1_NAME);
           assertNotNull(appExists);
  @@ -158,70 +234,110 @@
           WebApplicationDefinition wad = appExists.getWebApplicationDefinition();
           assertNotNull(wad);
   
  +        assertNotNull(wad.getDescription(Jetspeed.getDefaultLocale()));
  +        assertNotNull(wad.getDisplayName(Jetspeed.getDefaultLocale()));
  +
  +        PortletDefinition checkPd = appExists.getPortletDefinitionByName(PORTLET_0_NAME);
  +
  +        assertNotNull(appExists.getName() + " did not have a portlet named \"" + PORTLET_0_NAME + "\"", checkPd);
  +
  +        String checkName = checkPd.getName();
  +
  +        checkPd = null;
  +
  +        // JetspeedPortletRegistry.clearCache();
  +
  +        PortletDefinitionComposite pdc0 =
  +            (PortletDefinitionComposite) JetspeedPortletRegistry.getPortletDefinitionByIndetifier(PORTLET_0_UID);
  +
  +        PortletDefinitionComposite pdc2 =
  +            (PortletDefinitionComposite) JetspeedPortletRegistry.getPortletDefinitionByUniqueName(
  +                APP_1_NAME + "::" + PORTLET_0_NAME);
  +
  +        assertNotNull("Could not locate PortletDefinition with unique name \"" + APP_1_NAME + "::" + PORTLET_0_UID + "\"", pdc2);
  +
  +        assertNotNull(pdc0);
  +        assertEquals(checkName, pdc0.getName());
  +        assertNotNull(pdc0.getName() + " does not have a PortletApplicationDefinition.", pdc0.getPortletApplicationDefinition());
  +
       }
   
  -    public void testAddingPortlet()
  +    public void testAddingPortlet() throws TransactionStateException
       {
           try
           {
  +            // JetspeedPortletRegistry.clearCache();
  +
               MutablePortletApplication app = JetspeedPortletRegistry.getPortletApplication(APP_1_NAME);
  -                        
  +
               assertNotNull(app);
  -			JetspeedPortletRegistry.beginTransaction();
  -			JetspeedPortletRegistry.updatePortletApplication(app);
  +            JetspeedPortletRegistry.beginTransaction();
  +            JetspeedPortletRegistry.writeLock(app);
   
               //add a portlet
  -            PortletDefinitionComposite portlet1 = JetspeedPortletRegistry.newPortletDefinition();
  +            PortletDefinitionComposite portlet1 =
  +                (PortletDefinitionComposite) JetspeedPortletRegistry.getNewObjectInstance(PortletDefinition.class, true);
   
  -            portlet1.setClassName("com.portlet.MyClass");
  -            portlet1.setName("Portlet 1");
  -            portlet1.setPortletIdentifier("com.portlet.MyClass.Portlet 1");
  +            portlet1.setClassName(PORTLET_1_CLASS);
  +            portlet1.setName(PORTLET_1_NAME);
  +            portlet1.setPortletIdentifier(PORTLET_1_UID);
               app.addPortletDefinition(portlet1);
   
               portlet1.addDisplayName(Jetspeed.getDefaultLocale(), "Portlet 1 Display Name");
               portlet1.addDescription(Jetspeed.getDefaultLocale(), "Portlet 1 Description");
   
  -			JetspeedPortletRegistry.commitTransaction();            
  +            JetspeedPortletRegistry.commitTransaction();
  +
  +            // JetspeedPortletRegistry.clearCache();
  +            //  plugin.invalidateObject(app);
  +            // plugin.invalidateObject(portlet1);
           }
           catch (Throwable e)
           {
  -			try
  +            e.printStackTrace();
  +            try
               {
                   JetspeedPortletRegistry.rollbackTransaction();
               }
               catch (TransactionStateException e1)
               {
  -                // TODO Auto-generated catch block
  +
                   e1.printStackTrace();
               }
  -            e.printStackTrace();
  +
               throw new AssertionFailedError();
           }
   
  -    }
  -
  -    public void testPortletAdded()
  -    {
  -        // test that portlet application exists
  +        //		test that portlet application exists
           MutablePortletApplication app = JetspeedPortletRegistry.getPortletApplication(APP_1_NAME);
           assertNotNull(app);
  -        assertTrue(((Collection) app.getPortletDefinitionList()).size() == 2);
  +        int count = 0;
  +        Iterator countItr = app.getPortletDefinitionList().iterator();
  +        while (countItr.hasNext())
  +        {
  +            countItr.next();
  +            count++;
  +        }
  +        assertEquals(2, count);
   
  -        PortletDefinitionComposite portlet1 = (PortletDefinitionComposite) app.getPortletDefinitionByName("Portlet 1");
  +        PortletDefinitionComposite portlet1 = (PortletDefinitionComposite) app.getPortletDefinitionByName(PORTLET_1_NAME);
  +
  +        PortletDefinitionComposite portlet1_2 = JetspeedPortletRegistry.getPortletDefinitionByIndetifier(PORTLET_1_UID);
   
           assertNotNull(portlet1);
   
  -        Description desc = portlet1.getDescription(Jetspeed.getDefaultLocale());
  +        DisplayName displayName = portlet1.getDisplayName(Jetspeed.getDefaultLocale());
   
  -        assertNotNull(desc);
  +        assertNotNull("DisplayName for portlet definition was null.", displayName);
   
  -        System.out.println("Default local description for Portlet 1 is " + desc.getDescription());
  +        System.out.println("Default local displayName  for Portlet 1 is " + displayName.getDisplayName());
   
  -        DisplayName displayName = portlet1.getDisplayName(Jetspeed.getDefaultLocale());
  +        Description desc = portlet1.getDescription(Jetspeed.getDefaultLocale());
   
  -        assertNotNull(displayName);
  +        assertNotNull("Description for portlet definition was null.", desc);
  +
  +        System.out.println("Default local description for Portlet 1 is " + desc.getDescription());
   
  -        System.out.println("Default local displayName  for Portlet 1 is " + displayName.getDisplayName());
       }
   
       public void testAddPortletInfo() throws Exception
  @@ -233,11 +349,10 @@
   
               MutablePortletApplication app = JetspeedPortletRegistry.getPortletApplication(APP_1_NAME);
   
  -            
               assertNotNull(app);
               // Mark portlet app for update
  -			JetspeedPortletRegistry.updatePortletApplication(app);
  -            PortletDefinitionComposite pdc = (PortletDefinitionComposite) app.getPortletDefinitionByName("Portlet 0");
  +            JetspeedPortletRegistry.updatePortletApplication(app);
  +            PortletDefinitionComposite pdc = (PortletDefinitionComposite) app.getPortletDefinitionByName(PORTLET_0_NAME);
               assertNotNull(pdc);
   
               // add 2 parameters
  @@ -249,20 +364,21 @@
                   JetspeedPortletRegistry.createLanguage(
                       Locale.getDefault(),
                       "Test Portlet 0",
  -                    "Portlet 0",
  +                    PORTLET_0_NAME,
                       "This is Portlet 0",
                       null));
   
               //add content types
  -            ContentTypeComposite html = JetspeedPortletRegistry.newContentType();
  +            ContentTypeComposite html =
  +                (ContentTypeComposite) JetspeedPortletRegistry.getNewObjectInstance(ContentType.class, true);
               html.setContentType("html/text");
  -            ContentTypeComposite wml = JetspeedPortletRegistry.newContentType();
  -            html.addPortletMode(new PortletMode("EDIT"));
  -            html.addPortletMode(new PortletMode("VIEW"));
  -            html.addPortletMode(new PortletMode("HELP"));
  +            ContentTypeComposite wml = (ContentTypeComposite) JetspeedPortletRegistry.getNewObjectInstance(ContentType.class, true);
  +            html.addPortletMode(new PortletMode(MODE_EDIT));
  +            html.addPortletMode(new PortletMode(MODE_VIEW));
  +            html.addPortletMode(new PortletMode(MODE_HELP));
               wml.setContentType("wml");
  -            wml.addPortletMode(new PortletMode("HELP"));
  -            wml.addPortletMode(new PortletMode("VIEW"));
  +            wml.addPortletMode(new PortletMode(MODE_HELP));
  +            wml.addPortletMode(new PortletMode(MODE_VIEW));
               pdc.addContentType(html);
               pdc.addContentType(wml);
   
  @@ -274,9 +390,11 @@
               pdc.addDescription(Jetspeed.getDefaultLocale(), "Portlet 0 Description");
   
               JetspeedPortletRegistry.commitTransaction();
  +
           }
           catch (Exception e)
           {
  +            e.printStackTrace();
               try
               {
                   JetspeedPortletRegistry.rollbackTransaction();
  @@ -287,32 +405,62 @@
               }
               throw e;
           }
  +
  +        // JetspeedPortletRegistry.clearCache();
  +        doTestContentType();
  +        doTestParameters();
  +        // doTestPreferences();
       }
   
  -    public void testContentType()
  +    protected void doTestContentType()
       {
  +        // JetspeedPortletRegistry.clearCache();
           MutablePortletApplication app = JetspeedPortletRegistry.getPortletApplication(APP_1_NAME);
           assertNotNull(app);
  -        PortletDefinitionComposite pdc = (PortletDefinitionComposite) app.getPortletDefinitionByName("Portlet 0");
  +        PortletDefinitionComposite pdc = (PortletDefinitionComposite) app.getPortletDefinitionByName(PORTLET_0_NAME);
           assertNotNull(pdc);
   
           ContentType html = pdc.getContentTypeSet().get("html/text");
  +        assertNotNull(html);
           if (html == null)
               return;
           System.out.println("Content Type : " + html.getContentType());
           Iterator modes = html.getPortletModes();
  +
  +        boolean modeView = false;
  +        boolean modeHelp = false;
  +        boolean modeEdit = false;
  +
           while (modes.hasNext())
           {
               PortletMode mode = (PortletMode) modes.next();
  +            if (!modeView)
  +            {
  +                modeView = mode.toString().equals(PortletMode.VIEW.toString());
  +            }
  +
  +            if (!modeHelp)
  +            {
  +                modeHelp = mode.toString().equals(PortletMode.HELP.toString());
  +            }
  +
  +            if (!modeEdit)
  +            {
  +                modeEdit = mode.toString().equals(PortletMode.EDIT.toString());
  +            }
               System.out.println("   - Available Mode: " + mode);
           }
  +
  +        assertTrue("All 3 portlet modes for \"html/text\" were not found.", (modeEdit && modeView & modeHelp));
       }
   
  -    public void testParameters()
  +    protected void doTestParameters() throws Exception
       {
  +        // JetspeedPortletRegistry.clearCache();
  +        System.out.println("Number of parameters in the DB " + JetspeedPortletRegistry.getPortletInitParameters(null).size());
           MutablePortletApplication app = JetspeedPortletRegistry.getPortletApplication(APP_1_NAME);
           assertNotNull(app);
  -        PortletDefinitionComposite pdc = (PortletDefinitionComposite) app.getPortletDefinitionByName("Portlet 0");
  +        PortletDefinitionComposite pdc = (PortletDefinitionComposite) app.getPortletDefinitionByName(PORTLET_0_NAME);
           assertNotNull(pdc);
   
           Iterator itr = pdc.getInitParameterSet().iterator();
  @@ -321,71 +469,128 @@
               itr.next();
   
           assertTrue(count == 2);
  +        System.out.println("Testing cascading delete of parameters.  Removing Portlet Application now...");
  +        JetspeedPortletRegistry.beginTransaction();
  +        JetspeedPortletRegistry.removeApplication(app);
  +        JetspeedPortletRegistry.commitTransaction();
  +
  +        int paramSize = JetspeedPortletRegistry.getPortletInitParameters(null).size();
  +        assertEquals("Not all parameters were deleted.  " + paramSize + " left remain.", 0, paramSize);
  +
       }
   
  -    public void testPreferences()
  +    public void testPreferences() throws Exception
       {
  -        Collection portlets = JetspeedPortletRegistry.getAllPortletDefinitions();
  -        MutablePortletApplication app = JetspeedPortletRegistry.getPortletApplication(APP_1_NAME);
  -        PortletDefinitionComposite pdc =
  -            (PortletDefinitionComposite) JetspeedPortletRegistry.getPortletDefinitionByIndetifier("com.portlet.MyClass0.Portlet 0");
  -        Iterator itr = pdc.getPreferenceSet().iterator();
  -        int count = 0;
  -        while (itr.hasNext())
  +        try
           {
  -            count++;
  -            PreferenceComposite pref = (PreferenceComposite) itr.next();
  -            System.out.println("Preference: " + pref.getName());
   
  -            assertNotNull(pref.getDescription(Jetspeed.getDefaultLocale()));
  +            PortletDefinitionComposite pdc = null;
  +            PortletDefinitionComposite pdc1 =
  +                (PortletDefinitionComposite) JetspeedPortletRegistry.getPortletDefinitionByIndetifier(PORTLET_0_UID);
   
  -            System.out.println("Preference Description: " + pref.getDescription(Jetspeed.getDefaultLocale()));
  +            // JetspeedPortletRegistry.clearCache();
   
  -            Iterator prefValues = pref.getValues();
  -            while (prefValues.hasNext())
  +            pdc =
  +                (PortletDefinitionComposite) JetspeedPortletRegistry.getPortletDefinitionByUniqueName(
  +                    APP_1_NAME + "::" + PORTLET_0_NAME);
  +
  +            assertNotNull("Could not locate PortletDefinition with unique name \"" + APP_1_NAME + "::" + PORTLET_0_UID + "\"", pdc);
  +
  +            JetspeedPortletRegistry.beginTransaction();
  +
  +            JetspeedPortletRegistry.writeLock(pdc);
  +
  +            // ((ParameterSetCtrl) pdc.getInitParameterSet()).add("param 1", "value 1");
  +            // ((ParameterSetCtrl) pdc.getInitParameterSet()).add("param 2", "value 2");
  +            PreferenceComposite pc =
  +                (PreferenceComposite) JetspeedPortletRegistry.getNewObjectInstance(PreferenceComposite.DEFAULT_PREFERENCE, true);
  +            pc.setName("preference 1");
  +            pc.addValue("value 1");
  +            pc.addValue("value 2");
  +            pc.addDescription(Jetspeed.getDefaultLocale(), "Preference Description");
  +            pdc.addPreference(pc);
  +
  +            JetspeedPortletRegistry.commitTransaction();
  +
  +            // plugin.invalidateObject(pdc);
  +            // plugin.invalidateObject(pc);
  +            pdc = (PortletDefinitionComposite) JetspeedPortletRegistry.getPortletDefinitionByIndetifier(PORTLET_0_UID);
  +            assertNotNull("Portlet definition \"com.portlet.MyClass0.Portlet 0\" does not exist.", pdc);
  +            assertNotNull("PreferenceSet for \"com.portlet.MyClass0.Portlet 0\" should not be null", pdc.getPreferenceSet());
  +            Iterator itr = pdc.getPreferenceSet().iterator();
  +            int count = 0;
  +            while (itr.hasNext())
               {
  -                System.out.println("   -value:" + prefValues.next().toString());
  +                count++;
  +                PreferenceComposite pref = (PreferenceComposite) itr.next();
  +                System.out.println("Preference: " + pref.getName());
  +
  +                assertNotNull(pref.getDescription(Jetspeed.getDefaultLocale()));
  +
  +                System.out.println("Preference Description: " + pref.getDescription(Jetspeed.getDefaultLocale()));
  +
  +                Iterator prefValues = pref.getValues();
  +                while (prefValues.hasNext())
  +                {
  +                    System.out.println("   -value:" + prefValues.next().toString());
  +                }
               }
   
  -        }
  +            PreferenceComposite pref1 = (PreferenceComposite) pdc.getPreferenceSet().get("preference 1");
  +
  +            assertNotNull("could not locate \"preference 1\" ", pref1);
   
  -        PreferenceComposite pref1 = (PreferenceComposite) pdc.getPreferenceSet().get("preference 1");
  +            Iterator valItr = pref1.getValues();
  +            int valueCount = 0;
  +            while (valItr.hasNext())
  +            {
  +                valueCount++;
  +                valItr.next();
  +            }
   
  -        assertNotNull("could not locate \"preference 1\" ", pref1);
  +            assertTrue("\"preference 1\" should have 2 values not " + valueCount, valueCount == 2);
   
  -        Iterator valItr = pref1.getValues();
  -        int valueCount = 0;
  -        while (valItr.hasNext())
  +            assertTrue(count == 1);
  +        }
  +        catch (Exception e)
           {
  -            valueCount++;
  -            valItr.next();
  +            JetspeedPortletRegistry.rollbackTransaction();
  +            throw e;
           }
  -
  -        assertTrue("\"preference 1\" should have 2 values not " + valueCount, valueCount == 2);
  -
  -        assertTrue(count == 1);
       }
   
       public void testCascadeDelete()
       {
           clean();
  -
  +        List allPortletDefinitions = JetspeedPortletRegistry.getAllPortletDefinitions();
  +        Iterator itr = allPortletDefinitions.iterator();
  +        while (itr.hasNext())
  +        {
  +            PortletDefinition pd = (PortletDefinition) itr.next();
  +            System.err.println("Rogue PortletDefinition: " + pd.getId() + ":" + pd.getName());
  +        }
  +        assertEquals("Cascade delete failed, some PortletDefinitions exist.", 0, allPortletDefinitions.size());
       }
   
       /**
        * @see junit.framework.TestCase#tearDown()
        */
  -    public void tearDown()
  +    public void tearDown() throws Exception
       {
  +        clean();
           super.tearDown();
  -
       }
   
       protected void clean()
       {
  -        MutablePortletApplication pac = JetspeedPortletRegistry.getPortletApplication(APP_1_NAME);
  -        if (pac != null)
  +        // // JetspeedPortletRegistry.clearCache();
  +
  +        Iterator itr = JetspeedPortletRegistry.getPortletApplications().iterator();
  +
  +        while (itr.hasNext())
           {
  +            MutablePortletApplication pac = (MutablePortletApplication) itr.next();
  +
               try
               {
                   JetspeedPortletRegistry.beginTransaction();
  @@ -400,21 +605,56 @@
                   }
                   catch (TransactionStateException e1)
                   {
  -                    // TODO Auto-generated catch block
                       e1.printStackTrace();
                   }
                   System.out.println("Unable to tear down test.");
                   e.printStackTrace();
               }
           }
  +
  +        Iterator pitr = JetspeedPortletRegistry.getAllPortletDefinitions().iterator();
  +        while (pitr.hasNext())
  +        {
  +            PortletDefinition pd = (PortletDefinition) pitr.next();
  +            System.err.println("Test pass [" + testPasses + "]: Left over PortletDefinition: " + pd.getId() + ":" + pd.getName());
  +        }
       }
   
       /**
        * @see junit.framework.TestCase#setUp()
        */
  -    public void setUp()
  +    public void setUp() throws Exception
       {
           super.setUp();
  +        PersistenceService ps = (PersistenceService) CommonPortletServices.getPortalService(PersistenceService.SERVICE_NAME);
  +        plugin = ps.getDefaultPersistencePlugin();
  +        clean();
  +        buildTestPortletApp();
  +        testPasses++;
  +    }
  +
  +    protected void clearExtent(Class clazz)
  +    {
  +        LookupCriteria c = plugin.newLookupCriteria();
  +
  +        Collection aColl = plugin.getCollectionByQuery(clazz, plugin.generateQuery(clazz, c));
  +
  +        Iterator anItr = aColl.iterator();
  +
  +        try
  +        {
  +            plugin.beginTransaction();
  +            while (anItr.hasNext())
  +            {
  +                plugin.prepareForDelete(anItr.next());
  +            }
  +            plugin.commitTransaction();
  +        }
  +        catch (TransactionStateException e)
  +        {
  +            System.err.println("Unable to tear down test case!");
  +            e.printStackTrace();
  +        }
   
       }
   
  
  
  
  1.3       +3 -2      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/container/url/TestPortletURL.java
  
  Index: TestPortletURL.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/container/url/TestPortletURL.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestPortletURL.java	15 Jan 2004 23:47:03 -0000	1.2
  +++ TestPortletURL.java	4 Feb 2004 21:35:25 -0000	1.3
  @@ -59,6 +59,7 @@
   import junit.framework.TestSuite;
   
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   
   /**
    * TestPortletURL
  @@ -105,7 +106,7 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestPortletURL.class);
  +        return new JetspeedTestSuite(TestPortletURL.class);
       }
   
   
  
  
  
  1.5       +8 -7      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/capability/TestCapability.java
  
  Index: TestCapability.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/capability/TestCapability.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestCapability.java	6 Jan 2004 19:31:31 -0000	1.4
  +++ TestCapability.java	4 Feb 2004 21:35:26 -0000	1.5
  @@ -61,6 +61,7 @@
   import org.apache.commons.configuration.Configuration;
   import org.apache.jetspeed.cps.CommonPortletServices;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   
   /**
    * Test Capability Service
  @@ -74,10 +75,10 @@
       /**
        * @see org.apache.jetspeed.test.JetspeedTest#overrideProperties(org.apache.commons.configuration.Configuration)
        */
  -    public void overrideProperties(Configuration properties)
  -    {
  -        super.overrideProperties(properties);
  -    }
  +//    public void overrideProperties(Configuration properties)
  +//    {
  +//        super.overrideProperties(properties);
  +//    }
   
       /**
        * Defines the testcase name for JUnit.
  @@ -100,7 +101,7 @@
               new String[] { TestCapability.class.getName()});
       }
   
  -    public void setUp()
  +    public void setUp() throws Exception
       {
           System.out.println("Setup: Testing Capability Service");
           super.setUp();
  @@ -114,7 +115,7 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestCapability.class);
  +        return new JetspeedTestSuite(TestCapability.class);
       }
   
       protected CapabilityService getService()
  
  
  
  1.2       +3 -2      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/security/TestSecurityHelper.java
  
  Index: TestSecurityHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/security/TestSecurityHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestSecurityHelper.java	4 Dec 2003 04:52:09 -0000	1.1
  +++ TestSecurityHelper.java	4 Feb 2004 21:35:26 -0000	1.2
  @@ -65,6 +65,7 @@
   import org.apache.jetspeed.profiler.Profiler;
   import org.apache.jetspeed.security.impl.UserPrincipalImpl;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   
   /**
    * TestSecurityHelper
  @@ -104,7 +105,7 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestSecurityHelper.class);
  +        return new JetspeedTestSuite(TestSecurityHelper.class);
       }
       
       public void testHelpers() throws Exception
  
  
  
  1.2       +3 -2      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/page/TestPageDBPersistence.java
  
  Index: TestPageDBPersistence.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/page/TestPageDBPersistence.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestPageDBPersistence.java	20 Nov 2003 19:02:24 -0000	1.1
  +++ TestPageDBPersistence.java	4 Feb 2004 21:35:26 -0000	1.2
  @@ -60,6 +60,7 @@
   import org.apache.jetspeed.om.page.Fragment;
   import org.apache.jetspeed.om.page.Page;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   
   /**
    * TestPageService
  @@ -105,7 +106,7 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestPageDBPersistence.class);
  +        return new JetspeedTestSuite(TestPageDBPersistence.class);
       }
       
       protected PageManagerService getService()
  
  
  
  1.6       +3 -2      jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/page/TestPageXmlPersistence.java
  
  Index: TestPageXmlPersistence.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/services/page/TestPageXmlPersistence.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestPageXmlPersistence.java	4 Dec 2003 18:23:21 -0000	1.5
  +++ TestPageXmlPersistence.java	4 Feb 2004 21:35:26 -0000	1.6
  @@ -64,6 +64,7 @@
   import org.apache.jetspeed.om.page.Page;
   import org.apache.jetspeed.om.page.Property;
   import org.apache.jetspeed.test.JetspeedTest;
  +import org.apache.jetspeed.test.JetspeedTestSuite;
   
   /**
    * TestPageXmlPersistence
  @@ -110,7 +111,7 @@
       public static Test suite()
       {
           // All methods starting with "test" will be executed in the test suite.
  -        return new TestSuite(TestPageXmlPersistence.class);
  +        return new JetspeedTestSuite(TestPageXmlPersistence.class);
       }
   
       protected PageManagerService getService()
  
  
  

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