portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pau...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/portletcache TestTurbineCache.java
Date Sun, 24 Mar 2002 13:58:11 GMT
paulsp      02/03/24 05:58:11

  Modified:    build    build.xml
               src/java/org/apache/jetspeed/services/idgenerator
                        TestIdGenerator.java
               src/java/org/apache/jetspeed/services/portletcache
                        TestTurbineCache.java
  Log:
  o The target "unittest" is dependant on "compile", i.e. the source will be
    compiled before testing.
  o IdGeneratator tests have been moved to the "unittest".
  o Cache tests has been move to the "unittest-cache"
  o The target "unittest-all" runs all unit test
  
  Revision  Changes    Path
  1.129     +32 -9     jakarta-jetspeed/build/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/build/build.xml,v
  retrieving revision 1.128
  retrieving revision 1.129
  diff -u -r1.128 -r1.129
  --- build.xml	23 Mar 2002 13:49:10 -0000	1.128
  +++ build.xml	24 Mar 2002 13:58:10 -0000	1.129
  @@ -631,8 +631,6 @@
   
               <!-- Cactus unit tests -->
               <test name="org.apache.jetspeed.modules.actions.TestJLoginUser"/>
  -            <test name="org.apache.jetspeed.services.portletcache.TestTurbineCache"/>
  -            <test name="org.apache.jetspeed.services.idgenerator.TestIdGenerator"/>
   
           </junit>
       </target>
  @@ -659,8 +657,6 @@
   
               <!-- Cactus unit tests -->
               <test name="org.apache.jetspeed.modules.actions.TestJLoginUser"/>
  -            <test name="org.apache.jetspeed.services.portletcache.TestTurbineCache"/>
  -            <test name="org.apache.jetspeed.services.idgenerator.TestIdGenerator"/>
   				
           </junit>
       </target>
  @@ -768,29 +764,56 @@
       </target>
   
       <!-- =================================================================== -->
  +    <!-- Run the client JUnit test cases (non-cactus) on the Caching system -->
  +    <!-- =================================================================== -->
  +    <target name="unittest-all" depends="unittest, unittest-cache"
  +            description="Run all unit test"/>
  +
  +    <!-- =================================================================== -->
       <!-- Run the client JUnit test cases (non-cactus)                        -->
       <!-- =================================================================== -->
  -    <target name="unittest">
  +    <target name="unittest" depends="compile"
  +            description="General unit tests">
   
           <junit printsummary="yes" haltonfailure="yes" haltonerror="yes" fork="yes">
   
               <classpath>
                   <pathelement location="${build.dest.dir}"/>
                   <path refid="classpath"/>
  -                
                   <pathelement location="${junit.jar}"/>
  -                <pathelement location="${cactus-23.jar}"/>                
  -
               </classpath>
   
               <formatter type="plain" usefile="false"/>            
   
               <!-- JUnit unit tests -->
  -				<test name="org.apache.jetspeed.services.psmlmanager.TestMarshalPsml"/>
  +            <test name="org.apache.jetspeed.services.psmlmanager.TestMarshalPsml"/>
  +            <test name="org.apache.jetspeed.services.idgenerator.TestIdGenerator"/>
   				
           </junit>
       </target>
   
  +
  +    <!-- =================================================================== -->
  +    <!-- Run the client JUnit test cases (non-cactus) on the Caching system -->
  +    <!-- =================================================================== -->
  +    <target name="unittest-cache" depends="compile"
  +            description="Caching subsystem unit tests.  These unit tests generally take
a more time to execute then the general unit tests">
  +
  +        <junit printsummary="yes" haltonfailure="yes" haltonerror="yes" fork="yes">
  +
  +            <classpath>
  +                <pathelement location="${build.dest.dir}"/>
  +                <path refid="classpath"/>
  +                <pathelement location="${junit.jar}"/>
  +            </classpath>
  +
  +            <formatter type="plain" usefile="false"/>            
  +
  +            <!-- JUnit unit tests -->
  +            <test name="org.apache.jetspeed.services.portletcache.TestTurbineCache"/>
  +				
  +        </junit>
  +    </target>
   
   
       <!-- =================================================================== -->
  
  
  
  1.2       +29 -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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestIdGenerator.java	23 Mar 2002 13:49:10 -0000	1.1
  +++ TestIdGenerator.java	24 Mar 2002 13:58:11 -0000	1.2
  @@ -60,25 +60,51 @@
   
   // Cactus and Junit imports
   import junit.framework.Test;
  +import junit.framework.TestCase;
   import junit.framework.TestSuite;
  -import org.apache.cactus.ServletTestCase;
   
   // Jetspeed imports
   import org.apache.jetspeed.services.idgenerator.JetspeedIdGenerator;
   
   // Turbine imports
   import org.apache.turbine.services.TurbineServices;
  +import org.apache.turbine.util.TurbineConfig;
  +import org.apache.turbine.util.StringUtils;
   
   /**
    * TestIdGenerator
    *
    * @author <a href="paulsp@apache.org">Paul Spencer</a>
  - * @version $Id: TestIdGenerator.java,v 1.1 2002/03/23 13:49:10 paulsp Exp $
  + * @version $Id: TestIdGenerator.java,v 1.2 2002/03/24 13:58:11 paulsp Exp $
    */
  -public class TestIdGenerator extends ServletTestCase {
  +public class TestIdGenerator extends TestCase {
       
       private static int ID_TEST_TRIES = 10000;
   
  +    /**
  +     * Configuration object to run Turbine outside a servlet container
  +     * ( uses turbine.properties )
  +     */
  +    private static TurbineConfig config = null;
  +    
  +    /**
  +     * Sets up TurbineConfig using the system property:
  +     * <pre>turbine.properties</pre>
  +     */
  +    static
  +    {
  +        try
  +        {
  +            config = new TurbineConfig( "../webapp",
  +            "/WEB-INF/conf/TurbineResources.properties");
  +            config.init();
  +        }
  +        catch (Exception e)
  +        {
  +            fail(StringUtils.stackTrace(e));
  +        }
  +    }
  +    
       /**
        * Defines the testcase name for JUnit.
        *
  
  
  
  1.5       +29 -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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestTurbineCache.java	4 Feb 2002 19:54:40 -0000	1.4
  +++ TestTurbineCache.java	24 Mar 2002 13:58:11 -0000	1.5
  @@ -57,8 +57,8 @@
   
   // Cactus and Junit imports
   import junit.framework.Test;
  +import junit.framework.TestCase;
   import junit.framework.TestSuite;
  -import org.apache.cactus.ServletTestCase;
   
   // Turbine imports
   import org.apache.turbine.services.TurbineServices;
  @@ -67,20 +67,46 @@
   import org.apache.turbine.services.cache.ObjectExpiredException;
   import org.apache.turbine.services.cache.Refreshable;
   import org.apache.turbine.services.cache.RefreshableCachedObject;
  +import org.apache.turbine.util.TurbineConfig;
  +import org.apache.turbine.util.StringUtils;
   
   /**
    * TestTurbineCache
    *
    * @author <a href="paulsp@apache.org">Paul Spencer</a>
  - * @version $Id: TestTurbineCache.java,v 1.4 2002/02/04 19:54:40 paulsp Exp $
  + * @version $Id: TestTurbineCache.java,v 1.5 2002/03/24 13:58:11 paulsp Exp $
    */
  -public class TestTurbineCache extends ServletTestCase {
  +public class TestTurbineCache extends TestCase {
       
       private static final String cacheKey = new String("CacheKey");
       private static final String cacheKey_2 = new String("CacheKey_2");
       private static final long TURBINE_CACHE_REFRESH = 5000; // in millis
       private static final long TEST_EXPIRETIME = TURBINE_CACHE_REFRESH + 1000;
       private static final long TEST_TIMETOLIVE = TEST_EXPIRETIME * 5;
  +
  +    /**
  +     * Configuration object to run Turbine outside a servlet container
  +     * ( uses turbine.properties )
  +     */
  +    private static TurbineConfig config = null;
  +    
  +    /**
  +     * Sets up TurbineConfig using the system property:
  +     * <pre>turbine.properties</pre>
  +     */
  +    static
  +    {
  +        try
  +        {
  +            config = new TurbineConfig( "../webapp",
  +            "/WEB-INF/conf/TurbineResources.properties");
  +            config.init();
  +        }
  +        catch (Exception e)
  +        {
  +            fail(StringUtils.stackTrace(e));
  +        }
  +    }
   
       /**
        * Defines the testcase name for JUnit.
  
  
  

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


Mime
View raw message