portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morci...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/util/template TestJetspeedLinkFactory.java
Date Fri, 08 Aug 2003 18:28:04 GMT
morciuch    2003/08/08 11:28:04

  Modified:    src/java/org/apache/jetspeed/cache TestFileCache.java
               src/java/org/apache/jetspeed/capability
                        TestCapabilityMap.java
               src/java/org/apache/jetspeed/services/idgenerator
                        TestIdGenerator.java
               src/java/org/apache/jetspeed/services/portletcache
                        TestTurbineCache.java
               src/java/org/apache/jetspeed/services/profiler
                        TestProfilerService.java
               src/java/org/apache/jetspeed/services/psmlmanager
                        TestDbCriteria.java TestMarshalPsml.java
               src/java/org/apache/jetspeed/services/registry
                        TestMarshallRegistry.java
                        TestRegistryCategories.java
                        TestRegistryPersistence.java
               src/java/org/apache/jetspeed/services/security
                        TestGroupManagement.java
                        TestPermissionManagement.java
                        TestPortalAuthentication.java
                        TestRoleManagement.java TestSecurityCache.java
                        TestUserManagement.java
               src/java/org/apache/jetspeed/services/security/registry
                        TestAccessController.java
               src/java/org/apache/jetspeed/services/security/turbine
                        TestAccessController.java
               src/java/org/apache/jetspeed/test HeadlessBaseTest.java
               src/java/org/apache/jetspeed/util
                        TestOverwriteProperties.java TestValidation.java
               src/java/org/apache/jetspeed/util/rewriter
                        FrameRewriterTest.java
               src/java/org/apache/jetspeed/util/template
                        TestJetspeedLinkFactory.java
  Added:       src/java/org/apache/jetspeed/test JetspeedTestCase.java
  Log:
  Patch by Harald Ommang to get around log4j warnings when running unittests (see Bugzilla bug# 19906)
  
  Revision  Changes    Path
  1.3       +4 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/cache/TestFileCache.java
  
  Index: TestFileCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/cache/TestFileCache.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestFileCache.java	14 Nov 2002 06:58:38 -0000	1.2
  +++ TestFileCache.java	8 Aug 2003 18:28:03 -0000	1.3
  @@ -63,8 +63,9 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.util.FileCopy;
   import org.apache.jetspeed.util.Streams;
   import org.apache.turbine.util.StringUtils;
  @@ -77,7 +78,7 @@
    * @version $Id$
    */
   
  -public class TestFileCache extends TestCase implements FileCacheEventListener
  +public class TestFileCache extends JetspeedTestCase implements FileCacheEventListener
   {    
       String refreshedEntry = null;
   
  
  
  
  1.2       +6 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/capability/TestCapabilityMap.java
  
  Index: TestCapabilityMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/capability/TestCapabilityMap.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestCapabilityMap.java	7 Nov 2002 20:17:41 -0000	1.1
  +++ TestCapabilityMap.java	8 Aug 2003 18:28:03 -0000	1.2
  @@ -57,10 +57,12 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
   
   import org.apache.turbine.util.TurbineConfig;
   import org.apache.turbine.util.StringUtils;
  +
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.capability.CapabilityMapFactory;
   import org.apache.jetspeed.capability.CapabilityMap;
   import org.apache.jetspeed.services.Registry;
  @@ -75,9 +77,9 @@
    * @version $Id$
    */
   
  -public class TestCapabilityMap extends TestCase
  +public class TestCapabilityMap extends JetspeedTestCase
   {
  -
  +    
       /**
        * Defines the testcase name for JUnit.
        *
  
  
  
  1.4       +3 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/services/idgenerator/TestIdGenerator.java
  
  Index: TestIdGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/idgenerator/TestIdGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestIdGenerator.java	4 Mar 2003 00:05:08 -0000	1.3
  +++ TestIdGenerator.java	8 Aug 2003 18:28:03 -0000	1.4
  @@ -60,10 +60,10 @@
   
   // Cactus and Junit imports
   import junit.framework.Test;
  -import junit.framework.TestCase;
   import junit.framework.TestSuite;
   
   // Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.services.idgenerator.JetspeedIdGenerator;
   
   import org.apache.turbine.util.TurbineConfig;
  @@ -75,7 +75,7 @@
    * @author <a href="paulsp@apache.org">Paul Spencer</a>
    * @version $Id$
    */
  -public class TestIdGenerator extends TestCase {
  +public class TestIdGenerator extends JetspeedTestCase {
       
       private static int ID_TEST_TRIES = 10000;
   
  
  
  
  1.6       +5 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/services/portletcache/TestTurbineCache.java
  
  Index: TestTurbineCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/portletcache/TestTurbineCache.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestTurbineCache.java	24 Mar 2002 13:58:11 -0000	1.5
  +++ TestTurbineCache.java	8 Aug 2003 18:28:03 -0000	1.6
  @@ -57,7 +57,6 @@
   
   // Cactus and Junit imports
   import junit.framework.Test;
  -import junit.framework.TestCase;
   import junit.framework.TestSuite;
   
   // Turbine imports
  @@ -70,13 +69,16 @@
   import org.apache.turbine.util.TurbineConfig;
   import org.apache.turbine.util.StringUtils;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
  +
   /**
    * TestTurbineCache
    *
    * @author <a href="paulsp@apache.org">Paul Spencer</a>
    * @version $Id$
    */
  -public class TestTurbineCache extends TestCase {
  +public class TestTurbineCache extends JetspeedTestCase {
       
       private static final String cacheKey = new String("CacheKey");
       private static final String cacheKey_2 = new String("CacheKey_2");
  
  
  
  1.5       +4 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler/TestProfilerService.java
  
  Index: TestProfilerService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/profiler/TestProfilerService.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestProfilerService.java	4 Mar 2003 00:05:09 -0000	1.4
  +++ TestProfilerService.java	8 Aug 2003 18:28:03 -0000	1.5
  @@ -59,8 +59,9 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.om.profile.*;
   import org.apache.jetspeed.om.profile.psml.*;
   
  @@ -69,7 +70,6 @@
   import org.apache.turbine.util.TurbineConfig;
   import org.apache.turbine.util.StringUtils;
   
  -
   /**
    * TestProfilerService
    *
  @@ -77,7 +77,7 @@
    * @version $Id$
    */
   
  -public class TestProfilerService extends TestCase {
  +public class TestProfilerService extends JetspeedTestCase {
   
       /**
        * Defines the testcase name for JUnit.
  
  
  
  1.3       +4 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/TestDbCriteria.java
  
  Index: TestDbCriteria.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/TestDbCriteria.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestDbCriteria.java	4 Mar 2003 00:05:09 -0000	1.2
  +++ TestDbCriteria.java	8 Aug 2003 18:28:03 -0000	1.3
  @@ -57,12 +57,13 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
   
   
   import org.apache.turbine.util.TurbineConfig;
   import org.apache.turbine.util.StringUtils;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.om.profile.ProfileLocator;
   import org.apache.jetspeed.om.profile.BaseProfile;
   
  @@ -75,7 +76,7 @@
    * @version $Id$
    */
   
  -public class TestDbCriteria extends TestCase {    
  +public class TestDbCriteria extends JetspeedTestCase {    
   
   
       /** the column name for the PSML_ID field */
  
  
  
  1.13      +4 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/TestMarshalPsml.java
  
  Index: TestMarshalPsml.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/psmlmanager/TestMarshalPsml.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TestMarshalPsml.java	4 Mar 2003 00:05:09 -0000	1.12
  +++ TestMarshalPsml.java	8 Aug 2003 18:28:03 -0000	1.13
  @@ -63,7 +63,6 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
   
   //castor support
   import org.exolab.castor.xml.Unmarshaller;
  @@ -89,6 +88,7 @@
   import org.apache.jetspeed.om.profile.Reference;
   import org.apache.jetspeed.om.profile.Skin;
   import org.apache.jetspeed.om.profile.Security;
  +import org.apache.jetspeed.test.JetspeedTestCase;
   
   // Turbine imports
   import org.apache.turbine.util.TurbineConfig;
  @@ -101,8 +101,8 @@
    * @version $Id$
    */
   //public class TestMarshalPsml extends ServletTestCase {
  -public class TestMarshalPsml extends TestCase {    
  -
  +public class TestMarshalPsml extends JetspeedTestCase {    
  +    
       /**
        * Defines the testcase name for JUnit.
        *
  
  
  
  1.8       +3 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/TestMarshallRegistry.java
  
  Index: TestMarshallRegistry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/TestMarshallRegistry.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestMarshallRegistry.java	30 Oct 2002 15:52:39 -0000	1.7
  +++ TestMarshallRegistry.java	8 Aug 2003 18:28:03 -0000	1.8
  @@ -65,7 +65,6 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
   
   //castor support
   import org.exolab.castor.xml.Unmarshaller;
  @@ -73,6 +72,7 @@
   import org.xml.sax.InputSource;
   
   // Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.om.registry.CachedParameter;
   import org.apache.jetspeed.om.registry.Category;
   import org.apache.jetspeed.om.registry.ContentURL;
  @@ -95,9 +95,8 @@
    * @version $Id$
    */
   
  -public class TestMarshallRegistry extends TestCase
  +public class TestMarshallRegistry extends JetspeedTestCase
   {
  -
       /**
        * Defines the testcase name for JUnit.
        *
  
  
  
  1.10      +4 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/TestRegistryCategories.java
  
  Index: TestRegistryCategories.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/TestRegistryCategories.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TestRegistryCategories.java	6 Aug 2003 15:14:15 -0000	1.9
  +++ TestRegistryCategories.java	8 Aug 2003 18:28:03 -0000	1.10
  @@ -59,8 +59,9 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.om.registry.*;
   
   import org.apache.turbine.util.TurbineConfig;
  @@ -76,7 +77,7 @@
    * @version $Id$
    */
   
  -public class TestRegistryCategories extends TestCase {    
  +public class TestRegistryCategories extends JetspeedTestCase {
   
       /**
        * Defines the testcase name for JUnit.
  
  
  
  1.5       +4 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/TestRegistryPersistence.java
  
  Index: TestRegistryPersistence.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/TestRegistryPersistence.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestRegistryPersistence.java	5 Aug 2003 19:08:35 -0000	1.4
  +++ TestRegistryPersistence.java	8 Aug 2003 18:28:03 -0000	1.5
  @@ -57,8 +57,9 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.om.registry.base.*;
   
   import ojb.broker.PersistenceBroker;
  @@ -78,7 +79,7 @@
    * @version $Id$
    */
   
  -public class TestRegistryPersistence extends TestCase {    
  +public class TestRegistryPersistence extends JetspeedTestCase {    
   
       /**
        * Defines the testcase name for JUnit.
  
  
  
  1.5       +5 -5      jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestGroupManagement.java
  
  Index: TestGroupManagement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestGroupManagement.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestGroupManagement.java	4 Mar 2003 00:05:11 -0000	1.4
  +++ TestGroupManagement.java	8 Aug 2003 18:28:03 -0000	1.5
  @@ -60,13 +60,13 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
  -
   
   import org.apache.turbine.services.TurbineServices;
   import org.apache.turbine.util.TurbineConfig;
   import org.apache.turbine.util.StringUtils;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.om.security.Group;
   import org.apache.jetspeed.om.security.JetspeedGroupFactory;
   
  @@ -77,8 +77,8 @@
    * @version $Id$
    */
   
  -public class TestGroupManagement extends TestCase {    
  -
  +public class TestGroupManagement extends JetspeedTestCase {    
  +    
       /**
        * Defines the testcase name for JUnit.
        *
  
  
  
  1.6       +4 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestPermissionManagement.java
  
  Index: TestPermissionManagement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestPermissionManagement.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestPermissionManagement.java	4 Mar 2003 00:05:11 -0000	1.5
  +++ TestPermissionManagement.java	8 Aug 2003 18:28:03 -0000	1.6
  @@ -60,13 +60,13 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
  -
   
   import org.apache.turbine.services.TurbineServices;
   import org.apache.turbine.util.TurbineConfig;
   import org.apache.turbine.util.StringUtils;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.om.security.Permission;
   import org.apache.jetspeed.om.security.JetspeedPermissionFactory;
   
  @@ -79,7 +79,7 @@
    * @version $Id$
    */
   
  -public class TestPermissionManagement extends TestCase {    
  +public class TestPermissionManagement extends JetspeedTestCase {    
   
       /**
        * Defines the testcase name for JUnit.
  
  
  
  1.5       +4 -5      jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestPortalAuthentication.java
  
  Index: TestPortalAuthentication.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestPortalAuthentication.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestPortalAuthentication.java	4 Mar 2003 00:05:11 -0000	1.4
  +++ TestPortalAuthentication.java	8 Aug 2003 18:28:03 -0000	1.5
  @@ -57,16 +57,15 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
  -
   
   import org.apache.turbine.services.TurbineServices;
   import org.apache.turbine.util.TurbineConfig;
   import org.apache.turbine.util.StringUtils;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.om.security.JetspeedUser;
   
  -
   /**
    * Unit test for PortalAuthentication interface
    * 
  @@ -74,7 +73,7 @@
    * @version $Id$
    */
   
  -public class TestPortalAuthentication extends TestCase {    
  +public class TestPortalAuthentication extends JetspeedTestCase {    
   
       /**
        * Defines the testcase name for JUnit.
  
  
  
  1.6       +4 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestRoleManagement.java
  
  Index: TestRoleManagement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestRoleManagement.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestRoleManagement.java	4 Mar 2003 00:05:11 -0000	1.5
  +++ TestRoleManagement.java	8 Aug 2003 18:28:03 -0000	1.6
  @@ -60,13 +60,13 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
  -
   
   import org.apache.turbine.services.TurbineServices;
   import org.apache.turbine.util.TurbineConfig;
   import org.apache.turbine.util.StringUtils;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.om.security.Role;
   import org.apache.jetspeed.om.security.JetspeedRoleFactory;
   
  @@ -77,7 +77,7 @@
    * @version $Id$
    */
   
  -public class TestRoleManagement extends TestCase {    
  +public class TestRoleManagement extends JetspeedTestCase {    
   
       /**
        * Defines the testcase name for JUnit.
  
  
  
  1.6       +4 -5      jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestSecurityCache.java
  
  Index: TestSecurityCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestSecurityCache.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestSecurityCache.java	21 Apr 2003 20:14:00 -0000	1.5
  +++ TestSecurityCache.java	8 Aug 2003 18:28:03 -0000	1.6
  @@ -57,14 +57,13 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
  -
   
   import org.apache.turbine.services.TurbineServices;
   import org.apache.turbine.util.TurbineConfig;
   import org.apache.turbine.util.StringUtils;
   
  -
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.services.JetspeedSecurity;
   import org.apache.jetspeed.om.security.Role;
   import org.apache.jetspeed.om.security.Permission;
  @@ -77,7 +76,7 @@
    * @version $Id$
    */
   
  -public class TestSecurityCache extends TestCase {    
  +public class TestSecurityCache extends JetspeedTestCase {    
   
       /**
        * Defines the testcase name for JUnit.
  
  
  
  1.7       +5 -5      jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestUserManagement.java
  
  Index: TestUserManagement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/TestUserManagement.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestUserManagement.java	4 Mar 2003 00:05:11 -0000	1.6
  +++ TestUserManagement.java	8 Aug 2003 18:28:03 -0000	1.7
  @@ -59,13 +59,13 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
  -
   
   import org.apache.turbine.services.TurbineServices;
   import org.apache.turbine.util.TurbineConfig;
   import org.apache.turbine.util.StringUtils;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.services.JetspeedUserManagement;
   import org.apache.jetspeed.om.security.JetspeedUser;
   import org.apache.jetspeed.om.security.JetspeedUserFactory;
  @@ -78,8 +78,8 @@
    * @version $Id$
    */
   
  -public class TestUserManagement extends TestCase {    
  -
  +public class TestUserManagement extends JetspeedTestCase {    
  +    
       /**
        * Defines the testcase name for JUnit.
        *
  
  
  
  1.5       +4 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/registry/TestAccessController.java
  
  Index: TestAccessController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/registry/TestAccessController.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestAccessController.java	4 Mar 2003 00:05:12 -0000	1.4
  +++ TestAccessController.java	8 Aug 2003 18:28:03 -0000	1.5
  @@ -58,6 +58,7 @@
   import java.util.Vector;
   
   // Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.om.profile.Entry;
   import org.apache.jetspeed.om.profile.psml.PsmlEntry;
   import org.apache.jetspeed.om.BaseSecurityReference;
  @@ -83,7 +84,6 @@
   import junit.awtui.TestRunner;
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
   
   /**
    * TestAccessController
  @@ -91,9 +91,9 @@
    * @author <a href="paulsp@apache.org">Paul Spencer</a>
    * @version $Id$
    */
  -public class TestAccessController extends TestCase
  +public class TestAccessController extends JetspeedTestCase
   {
  -    
  + 
       private static String ADMIN_PORTLET = "GlobalAdminPortlet"; // Portlet accessable by Admin user, role = admin
       private static SecurityReference adminSecurityRef = new BaseSecurityReference();
       private static String ALL_PORTLET = "HelloVelocity";  // Portlet accessable by Anonymous user
  
  
  
  1.5       +3 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/turbine/TestAccessController.java
  
  Index: TestAccessController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/turbine/TestAccessController.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestAccessController.java	25 Apr 2003 22:47:56 -0000	1.4
  +++ TestAccessController.java	8 Aug 2003 18:28:03 -0000	1.5
  @@ -56,6 +56,7 @@
   
   
   // Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.om.profile.Entry;
   import org.apache.jetspeed.om.profile.psml.PsmlEntry;
   import org.apache.jetspeed.om.security.JetspeedUser;
  @@ -79,7 +80,6 @@
   import junit.awtui.TestRunner;
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
   
   /**
    * TestAccessController
  @@ -87,9 +87,8 @@
    * @author <a href="paulsp@apache.org">Paul Spencer</a>
    * @version $Id$
    */
  -public class TestAccessController extends TestCase
  +public class TestAccessController extends JetspeedTestCase
   {
  -    
       private static String ADMIN_PORTLET = "GlobalAdminPortlet"; // Portlet accessable by Admin user, role = admin
       private static String ALL_PORTLET = "HelloVelocity";  // Portlet accessable by Anonymous user
       private static String TEST_GROUP = "Jetspeed";
  
  
  
  1.4       +2 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/test/HeadlessBaseTest.java
  
  Index: HeadlessBaseTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/test/HeadlessBaseTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HeadlessBaseTest.java	19 May 2003 23:17:49 -0000	1.3
  +++ HeadlessBaseTest.java	8 Aug 2003 18:28:03 -0000	1.4
  @@ -57,7 +57,6 @@
   import java.io.FileReader;
   
   import junit.framework.AssertionFailedError;
  -import junit.framework.TestCase;
   import junit.framework.TestResult;
   
   import org.apache.commons.configuration.Configuration;
  @@ -78,7 +77,7 @@
    *  
    * @version $Id$
    */
  -public abstract class HeadlessBaseTest extends TestCase
  +public abstract class HeadlessBaseTest extends JetspeedTestCase
   {
       
       public static final String WEBAPP_PATH = "webapp.path";
  
  
  
  1.1                  jakarta-jetspeed/src/java/org/apache/jetspeed/test/JetspeedTestCase.java
  
  Index: JetspeedTestCase.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" or
   *    "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;
  
  // JUnit classes
  import junit.framework.TestCase;
  
  // Log4j classes
  import org.apache.log4j.Logger;
  import org.apache.log4j.Level;
  import org.apache.log4j.ConsoleAppender;
  import org.apache.log4j.SimpleLayout;
  
  /**
   * @author <a href="mailto:harald@ommang.com">Harald Ommang</a>
   *
   * Base abstract class for testcases with static initialization used to
   * avoid Log4J configuration warnings
   *
   * @version $Id: JetspeedTestCase.java,v 1.1 2003/08/08 18:28:03 morciuch Exp $
   */
  public abstract class JetspeedTestCase extends TestCase
  {
  
  	static
  	{
  		// Done
  		ConsoleAppender ca = new ConsoleAppender(new SimpleLayout());
  		Logger root = Logger.getRootLogger();
  		root.setLevel(Level.INFO);
  		root.addAppender(ca);
  	}
  
  	public JetspeedTestCase(String name)
  	{
  		super(name);
  	}    
      
  }
  
  
  
  
  1.4       +1 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/util/TestOverwriteProperties.java
  
  Index: TestOverwriteProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/TestOverwriteProperties.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestOverwriteProperties.java	5 Aug 2003 19:08:04 -0000	1.3
  +++ TestOverwriteProperties.java	8 Aug 2003 18:28:03 -0000	1.4
  @@ -1 +1 @@
  -/* ====================================================================
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 2000-2001 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" or
 *    "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.util;

import java.io.*;

// Junit imports
import junit.framework.Test;
import junit.framework.TestSuite;
import junit.framework.TestCase;

import org.apache.turbine.util.StringUtils;
import org.apache.tools.ant.util.FileUtils;

/**
 *
 * @author <a href="epugh@upstate.com">Eric Pugh</a>
 */

public class TestOverwriteProperties extends TestCase
{

    private static String SRC_JETSPEED_RESOURCES = "../test/testdata/conf/SrcJetspeedResources.properties";
    private static String JETSPEED_RESOURCES = "../test/testdata/conf/JetspeedResources.properties";
    private static String MERGE_JETSPEED_RESOURCES = "../test/testdata/conf/MergeJetspeedResources.properties";
    private static String MERGE_REMOVE_JETSPEED_RESOURCES = "../test/testdata/conf/MergeRemoveJetspeedResources.properties";
    private static String MERGE_ADD_JETSPEED_RESOURCES = "../test/testdata/conf/MergeAddJetspeedResources.properties";
    private static String RESULT_MERGE_JETSPEED_RESOURCES = "../test/testdata/conf/ResultMergeJetspeedResources.properties";
    private static String RESULT_MERGE_REMOVE_JETSPEED_RESOURCES = "../test/testdata/conf/ResultMergeRemoveJetspeedResources.properties";
    private static String RESULT_MERGE_ADD_JETSPEED_RESOURCES = "../test/testdata/conf/ResultMergeAddJetspeedResources.properties";

    private static String INCLUDE_ROOT = "../test/testdata/conf/";

    private File SRC_JETSPEED_RESOURCES_FILE = null;
    private File JETSPEED_RESOURCES_FILE = null;
    private File MERGE_JETSPEED_RESOURCES_FILE = null;
    private File MERGE_REMOVE_JETSPEED_RESOURCES_FILE = null;
    private File MERGE_ADD_JETSPEED_RESOURCES_FILE = null;
    private File RESULT_MERGE_JETSPEED_RESOURCES_FILE = null;
    private File RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE = null;
    private File RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE = null;

    private File INCLUDE_ROOT_DIR = null;

    private FileUtils fileUtils = FileUtils.newFileUtils();

    /**
     * Defines the testcase name for JUnit.
     *
     * @param name the testcase's name.
     */
    public TestOverwriteProperties( String name )
    {
        super( name );
    }

    /**
     * Start the tests.
     *
     * @param args the arguments. Not used
     */
    public static void main(String args[])
    {
        junit.awtui.TestRunner.main( new String[] { TestOverwriteProperties.class.getName()} );
    }

    /**
     * Creates the test suite.
     *
     * @return a test suite (<code>TestSuite</code>) that includes all methods
     *         starting with "test"
     */
    public static Test suite()
    {
        // All methods starting with "test" will be executed in the test suite.
        return new TestSuite( TestOverwriteProperties.class );
    }

    public void setUp() throws Exception{

        SRC_JETSPEED_RESOURCES_FILE = new File(SRC_JETSPEED_RESOURCES);

        assertTrue("Check SRC_JETSPEED_RESOURCES_FILE exists:" + SRC_JETSPEED_RESOURCES_FILE,SRC_JETSPEED_RESOURCES_FILE.exists());

        JETSPEED_RESOURCES_FILE = new File(JETSPEED_RESOURCES);

        if (JETSPEED_RESOURCES_FILE.exists())
        {
            assertTrue("Check JETSPEED_RESOURCES_FILE exists, then delete it:" + JETSPEED_RESOURCES_FILE,JETSPEED_RESOURCES_FILE.delete());
        }

        fileUtils.copyFile(SRC_JETSPEED_RESOURCES_FILE,JETSPEED_RESOURCES_FILE);

        assertTrue("Check JETSPEED_RESOURCES_FILE exists:" + JETSPEED_RESOURCES_FILE,JETSPEED_RESOURCES_FILE.exists());

        MERGE_JETSPEED_RESOURCES_FILE = new File(MERGE_JETSPEED_RESOURCES);

        assertTrue("Check MERGE_JETSPEED_RESOURCES_FILE exists:" + MERGE_JETSPEED_RESOURCES_FILE,MERGE_JETSPEED_RESOURCES_FILE.exists());

        MERGE_REMOVE_JETSPEED_RESOURCES_FILE = new File(MERGE_REMOVE_JETSPEED_RESOURCES);

        assertTrue("Check MERGE_REMOVE_JETSPEED_RESOURCES_FILE exists:" + MERGE_REMOVE_JETSPEED_RESOURCES_FILE,MERGE_REMOVE_JETSPEED_RESOURCES_FILE.exists());

        MERGE_ADD_JETSPEED_RESOURCES_FILE = new File(MERGE_ADD_JETSPEED_RESOURCES);

        assertTrue("Check MERGE_ADD_JETSPEED_RESOURCES_FILE exists:" + MERGE_ADD_JETSPEED_RESOURCES_FILE,MERGE_ADD_JETSPEED_RESOURCES_FILE.exists());

        RESULT_MERGE_JETSPEED_RESOURCES_FILE = new File(RESULT_MERGE_JETSPEED_RESOURCES);

        assertTrue("Check RESULT_MERGE_JETSPEED_RESOURCES_FILE exists:" + RESULT_MERGE_JETSPEED_RESOURCES_FILE,RESULT_MERGE_JETSPEED_RESOURCES_FILE.exists());

        RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE = new File(RESULT_MERGE_REMOVE_JETSPEED_RESOURCES);

        assertTrue("Check RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE exists:" + RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE,RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE.exists());

        RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE = new File(RESULT_MERGE_ADD_JETSPEED_RESOURCES);

        assertTrue("Check RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE exists:" + RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE,RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE.exists());

        INCLUDE_ROOT_DIR = new File(INCLUDE_ROOT);

        assertTrue("Check include root dir exists:" + INCLUDE_ROOT_DIR,INCLUDE_ROOT_DIR.exists());

        assertTrue(INCLUDE_ROOT_DIR.isDirectory());

    }

    /**
     * Tests overwriting property
     * @throws Exception
     */
    public void testOverwriteProperty() throws Exception
    {

        try
        {
            String args[] = new String[]{JETSPEED_RESOURCES_FILE.toString(),MERGE_JETSPEED_RESOURCES.toString(),INCLUDE_ROOT.toString()};
            OverwriteProperties.main(args);
            assertTrue("Make sure our merge worked properly.",fileUtils.contentEquals(JETSPEED_RESOURCES_FILE,RESULT_MERGE_JETSPEED_RESOURCES_FILE));
        }
        catch (Exception e)
        {
            fail(StringUtils.stackTrace(e));
        }
    }



    /**
     * Tests removing properties
     * @throws Exception
     */
    public void testRemoveProperties() throws Exception
    {
        try
        {
            String args[] = new String[]{JETSPEED_RESOURCES_FILE.toString(),MERGE_REMOVE_JETSPEED_RESOURCES.toString(),INCLUDE_ROOT.toString()};
            OverwriteProperties.main(args);
            assertTrue("Make sure our merge worked properly.",fileUtils.contentEquals(JETSPEED_RESOURCES_FILE,RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE));
        }
        catch (Exception e)
        {
            fail(StringUtils.stackTrace(e));
        }
    }

    /**
     * Tests adding properties
     * @throws Exception
     */
    public void testAddProperties() throws Exception
    {
        try
        {
            String args[] = new String[]{JETSPEED_RESOURCES_FILE.toString(),MERGE_ADD_JETSPEED_RESOURCES.toString(),INCLUDE_ROOT.toString()};
            OverwriteProperties.main(args);
            assertTrue("Make sure our merge worked properly.",fileUtils.contentEquals(JETSPEED_RESOURCES_FILE,RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE));
        }
        catch (Exception e)
        {
            fail(StringUtils.stackTrace(e));
        }
    }

    public void tearDown()
    {
        if (JETSPEED_RESOURCES_FILE.exists())
        {
            //JETSPEED_RESOURCES_FILE.delete();
        }
    }
}
  \ No newline at end of file
  +/* ====================================================================
 * 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" or
 *    "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.util;

import java.io.*;

// Junit imports
import junit.framework.Test;
import junit.framework.TestSuite;

import org.apache.turbine.util.StringUtils;
import org.apache.tools.ant.util.FileUtils;

// Jetspeed imports
import org.apache.jetspeed.test.JetspeedTestCase;

/**
 *
 * @author <a href="epugh@upstate.com">Eric Pugh</a>
 */

public class TestOverwriteProperties extends JetspeedTestCase
{

    private static String SRC_JETSPEED_RESOURCES = "../test/testdata/conf/SrcJetspeedResources.properties";
    private static String JETSPEED_RESOURCES = "../test/testdata/conf/JetspeedResources.properties";
    private static String MERGE_JETSPEED_RESOURCES = "../test/testdata/conf/MergeJetspeedResources.properties";
    private static String MERGE_REMOVE_JETSPEED_RESOURCES = "../test/testdata/conf/MergeRemoveJetspeedResources.properties";
    private static String MERGE_ADD_JETSPEED_RESOURCES = "../test/testdata/conf/MergeAddJetspeedResources.properties";
    private static String RESULT_MERGE_JETSPEED_RESOURCES = "../test/testdata/conf/ResultMergeJetspeedResources.properties";
    private static String RESULT_MERGE_REMOVE_JETSPEED_RESOURCES = "../test/testdata/conf/ResultMergeRemoveJetspeedResources.properties";
    private static String RESULT_MERGE_ADD_JETSPEED_RESOURCES = "../test/testdata/conf/ResultMergeAddJetspeedResources.properties";

    private static String INCLUDE_ROOT = "../test/testdata/conf/";

    private File SRC_JETSPEED_RESOURCES_FILE = null;
    private File JETSPEED_RESOURCES_FILE = null;
    private File MERGE_JETSPEED_RESOURCES_FILE = null;
    private File MERGE_REMOVE_JETSPEED_RESOURCES_FILE = null;
    private File MERGE_ADD_JETSPEED_RESOURCES_FILE = null;
    private File RESULT_MERGE_JETSPEED_RESOURCES_FILE = null;
    private File RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE = null;
    private File RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE = null;

    private File INCLUDE_ROOT_DIR = null;

    private FileUtils fileUtils = FileUtils.newFileUtils();

    /**
     * Defines the testcase name for JUnit.
     *
     * @param name the testcase's name.
     */
    public TestOverwriteProperties( String name )
    {
        super( name );
    }

    /**
     * Start the tests.
     *
     * @param args the arguments. Not used
     */
    public static void main(String args[])
    {
        junit.awtui.TestRunner.main( new String[] { TestOverwriteProperties.class.getName()} );
    }

    /**
     * Creates the test suite.
     *
     * @return a test suite (<code>TestSuite</code>) that includes all methods
     *         starting with "test"
     */
    public static Test suite()
    {
        // All methods starting with "test" will be executed in the test suite.
        return new TestSuite( TestOverwriteProperties.class );
    }

    public void setUp() throws Exception{

        SRC_JETSPEED_RESOURCES_FILE = new File(SRC_JETSPEED_RESOURCES);

        assertTrue("Check SRC_JETSPEED_RESOURCES_FILE exists:" + SRC_JETSPEED_RESOURCES_FILE,SRC_JETSPEED_RESOURCES_FILE.exists());

        JETSPEED_RESOURCES_FILE = new File(JETSPEED_RESOURCES);

        if (JETSPEED_RESOURCES_FILE.exists())
        {
            assertTrue("Check JETSPEED_RESOURCES_FILE exists, then delete it:" + JETSPEED_RESOURCES_FILE,JETSPEED_RESOURCES_FILE.delete());
        }

        fileUtils.copyFile(SRC_JETSPEED_RESOURCES_FILE,JETSPEED_RESOURCES_FILE);

        assertTrue("Check JETSPEED_RESOURCES_FILE exists:" + JETSPEED_RESOURCES_FILE,JETSPEED_RESOURCES_FILE.exists());

        MERGE_JETSPEED_RESOURCES_FILE = new File(MERGE_JETSPEED_RESOURCES);

        assertTrue("Check MERGE_JETSPEED_RESOURCES_FILE exists:" + MERGE_JETSPEED_RESOURCES_FILE,MERGE_JETSPEED_RESOURCES_FILE.exists());

        MERGE_REMOVE_JETSPEED_RESOURCES_FILE = new File(MERGE_REMOVE_JETSPEED_RESOURCES);

        assertTrue("Check MERGE_REMOVE_JETSPEED_RESOURCES_FILE exists:" + MERGE_REMOVE_JETSPEED_RESOURCES_FILE,MERGE_REMOVE_JETSPEED_RESOURCES_FILE.exists());

        MERGE_ADD_JETSPEED_RESOURCES_FILE = new File(MERGE_ADD_JETSPEED_RESOURCES);

        assertTrue("Check MERGE_ADD_JETSPEED_RESOURCES_FILE exists:" + MERGE_ADD_JETSPEED_RESOURCES_FILE,MERGE_ADD_JETSPEED_RESOURCES_FILE.exists());

        RESULT_MERGE_JETSPEED_RESOURCES_FILE = new File(RESULT_MERGE_JETSPEED_RESOURCES);

        assertTrue("Check RESULT_MERGE_JETSPEED_RESOURCES_FILE exists:" + RESULT_MERGE_JETSPEED_RESOURCES_FILE,RESULT_MERGE_JETSPEED_RESOURCES_FILE.exists());

        RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE = new File(RESULT_MERGE_REMOVE_JETSPEED_RESOURCES);

        assertTrue("Check RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE exists:" + RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE,RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE.exists());

        RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE = new File(RESULT_MERGE_ADD_JETSPEED_RESOURCES);

        assertTrue("Check RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE exists:" + RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE,RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE.exists());

        INCLUDE_ROOT_DIR = new File(INCLUDE_ROOT);

        assertTrue("Check include root dir exists:" + INCLUDE_ROOT_DIR,INCLUDE_ROOT_DIR.exists());

        assertTrue(INCLUDE_ROOT_DIR.isDirectory());

    }

    /**
     * Tests overwriting property
     * @throws Exception
     */
    public void testOverwriteProperty() throws Exception
    {

        try
        {
            String args[] = new String[]{JETSPEED_RESOURCES_FILE.toString(),MERGE_JETSPEED_RESOURCES.toString(),INCLUDE_ROOT.toString()};
            OverwriteProperties.main(args);
            assertTrue("Make sure our merge worked properly.",fileUtils.contentEquals(JETSPEED_RESOURCES_FILE,RESULT_MERGE_JETSPEED_RESOURCES_FILE));
        }
        catch (Exception e)
        {
            fail(StringUtils.stackTrace(e));
        }
    }



    /**
     * Tests removing properties
     * @throws Exception
     */
    public void testRemoveProperties() throws Exception
    {
        try
        {
            String args[] = new String[]{JETSPEED_RESOURCES_FILE.toString(),MERGE_REMOVE_JETSPEED_RESOURCES.toString(),INCLUDE_ROOT.toString()};
            OverwriteProperties.main(args);
            assertTrue("Make sure our merge worked properly.",fileUtils.contentEquals(JETSPEED_RESOURCES_FILE,RESULT_MERGE_REMOVE_JETSPEED_RESOURCES_FILE));
        }
        catch (Exception e)
        {
            fail(StringUtils.stackTrace(e));
        }
    }

    /**
     * Tests adding properties
     * @throws Exception
     */
    public void testAddProperties() throws Exception
    {
        try
        {
            String args[] = new String[]{JETSPEED_RESOURCES_FILE.toString(),MERGE_ADD_JETSPEED_RESOURCES.toString(),INCLUDE_ROOT.toString()};
            OverwriteProperties.main(args);
            assertTrue("Make sure our merge worked properly.",fileUtils.contentEquals(JETSPEED_RESOURCES_FILE,RESULT_MERGE_ADD_JETSPEED_RESOURCES_FILE));
        }
        catch (Exception e)
        {
            fail(StringUtils.stackTrace(e));
        }
    }

    public void tearDown()
    {
        if (JETSPEED_RESOURCES_FILE.exists())
        {
            //JETSPEED_RESOURCES_FILE.delete();
        }
    }
}
  \ No newline at end of file
  
  
  
  1.4       +4 -3      jakarta-jetspeed/src/java/org/apache/jetspeed/util/TestValidation.java
  
  Index: TestValidation.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/TestValidation.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestValidation.java	31 Mar 2003 00:30:32 -0000	1.3
  +++ TestValidation.java	8 Aug 2003 18:28:03 -0000	1.4
  @@ -57,8 +57,9 @@
   // Junit imports
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import junit.framework.TestCase;
   
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   
   /**
    * Command Line Test Validation routines.
  @@ -67,7 +68,7 @@
    * @version $Id$
    */
   
  -public class TestValidation extends TestCase
  +public class TestValidation extends JetspeedTestCase
   {
       /**
        * Defines the testcase name for JUnit.
  
  
  
  1.4       +4 -2      jakarta-jetspeed/src/java/org/apache/jetspeed/util/rewriter/FrameRewriterTest.java
  
  Index: FrameRewriterTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/rewriter/FrameRewriterTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FrameRewriterTest.java	4 Mar 2003 00:05:16 -0000	1.3
  +++ FrameRewriterTest.java	8 Aug 2003 18:28:03 -0000	1.4
  @@ -54,14 +54,16 @@
   package org.apache.jetspeed.util.rewriter;
   
   import junit.framework.Test;
  -import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import java.io.Reader;
   import java.io.StringReader;
   import java.io.FileReader;
   import java.io.BufferedReader;
   
  -public class FrameRewriterTest extends TestCase 
  +// Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
  +
  +public class FrameRewriterTest extends JetspeedTestCase 
   {
       static public Test suite()
       {
  
  
  
  1.4       +3 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/TestJetspeedLinkFactory.java
  
  Index: TestJetspeedLinkFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/TestJetspeedLinkFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestJetspeedLinkFactory.java	4 Mar 2003 00:05:16 -0000	1.3
  +++ TestJetspeedLinkFactory.java	8 Aug 2003 18:28:03 -0000	1.4
  @@ -60,11 +60,11 @@
   
   // Cactus and Junit imports
   import junit.framework.Test;
  -import junit.framework.TestCase;
   import junit.framework.TestSuite;
   import junit.awtui.TestRunner;
   
   // Jetspeed imports
  +import org.apache.jetspeed.test.JetspeedTestCase;
   import org.apache.jetspeed.services.resources.JetspeedResources;
   import org.apache.jetspeed.util.template.JetspeedLink;
   
  @@ -80,9 +80,8 @@
    * @author <a href="paulsp@apache.org">Paul Spencer</a>
    * @version $Id$
    */
  -public class TestJetspeedLinkFactory extends TestCase
  +public class TestJetspeedLinkFactory extends JetspeedTestCase
   {
  -    
       /**
        * Configuration object to run Turbine outside a servlet container
        * ( uses turbine.properties )
  
  
  

Mime
View raw message