jtaylor     2002/08/01 05:53:33

  Modified:    .        project-b5.xml
               src/test/org/apache/jcs/access TestCacheAccess.java
               src/test/org/apache/jcs/servlet ListTestCacheServlet.java
  Added:       .        maven.xml
               src/test TestDiskCache.ccf TestDiskCacheCon.ccf
                        TestTCPLateralCache.ccf cache.ccf log4j.properties
  Log:
  Changes to get tests working again, everything builds and tests under maven-b5
  now, except that the tests hang after completion.
  
  Revision  Changes    Path
  1.3       +11 -0     jakarta-turbine-jcs/project-b5.xml
  
  Index: project-b5.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-jcs/project-b5.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project-b5.xml    20 Jul 2002 01:19:17 -0000      1.2
  +++ project-b5.xml    1 Aug 2002 12:53:33 -0000       1.3
  @@ -110,6 +110,11 @@
         <version>1.3-dev</version>
       </dependency>
   
  +    <dependency>
  +      <id>junit</id>
  +      <version>3.7</version>
  +    </dependency>
  +
       <!-- Required for the server in JCS -->
   
       <dependency>
  @@ -130,6 +135,12 @@
           <include>**/TestDiskCacheConcurrent.java</include>
           <include>**/TestTCPLateralCache.java</include>
         </includes>
  +      <resources>
  +        <includes>
  +          <include>**/*.properties</include>
  +          <include>**/*.ccf</include>
  +        </includes>
  +      </resources>
       </unitTest>
   
       <jars></jars>
  
  
  
  1.1                  jakarta-turbine-jcs/maven.xml
  
  Index: maven.xml
  ===================================================================
  <project default="java:jar">
  
    <preGoal name="test:test">
  
      <!-- Work area for unit tests -->
      
      <mkdir dir="target/test-sandbox/logs"/>
  
    </preGoal>
  
  </project>
  
  
  
  1.1                  jakarta-turbine-jcs/src/test/TestDiskCache.ccf
  
  Index: TestDiskCache.ccf
  ===================================================================
  # Cache configuration for the 'TestDiskCache' test. The memory cache has a
  # a maximum of 100 objects, so objects should get pushed into the disk cache
  
  jcs.default=indexedDiskCache
  jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.default.cacheattributes.MaxObjects=100
  
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  # SYSTEM GROUP ID CACHE
  jcs.system.groupIdCache=indexedDiskCache
  
jcs.system.groupIdCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
  
jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  
  ##### CACHE REGIONS FOR TEST
  
  jcs.region.indexedRegion1=indexedDiskCache
  
jcs.region.indexedRegion1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.region.indexedRegion1.cacheattributes.MaxObjects=100
  
jcs.region.indexedRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  jcs.region.indexedRegion2=indexedDiskCache
  
jcs.region.indexedRegion2.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.region.indexedRegion2.cacheattributes.MaxObjects=100
  
jcs.region.indexedRegion2.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  jcs.region.indexedRegion3=indexedDiskCache
  
jcs.region.indexedRegion3.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.region.indexedRegion3.cacheattributes.MaxObjects=100
  
jcs.region.indexedRegion3.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  jcs.region.indexedRegion4=indexedDiskCache2
  
jcs.region.indexedRegion4.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.region.indexedRegion4.cacheattributes.MaxObjects=100
  
jcs.region.indexedRegion4.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  
  ##### AUXILIARY CACHES
  
  # Indexed Disk Cache
  
jcs.auxiliary.indexedDiskCache=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
  
jcs.auxiliary.indexedDiskCache.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
  
jcs.auxiliary.indexedDiskCache.attributes.DiskPath=target/test-sandbox/indexed-disk-cache
  
  # Indexed Disk Cache
  
jcs.auxiliary.indexedDiskCache2=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
  
jcs.auxiliary.indexedDiskCache2.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
  
jcs.auxiliary.indexedDiskCache2.attributes.DiskPath=target/test-sandbox/indexed-disk-cache2
  
  
  
  1.1                  jakarta-turbine-jcs/src/test/TestDiskCacheCon.ccf
  
  Index: TestDiskCacheCon.ccf
  ===================================================================
  # Cache configuration for the 'TestDiskCache' test. The memory cache has a
  # a maximum of 100 objects, so objects should get pushed into the disk cache
  
  jcs.default=indexedDiskCache
  jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.default.cacheattributes.MaxObjects=100
  
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  # SYSTEM GROUP ID CACHE
  jcs.system.groupIdCache=indexedDiskCache
  
jcs.system.groupIdCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
  
jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  
  ##### CACHE REGIONS FOR TEST
  
  jcs.region.indexedRegion1=indexedDiskCache
  
jcs.region.indexedRegion1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.region.indexedRegion1.cacheattributes.MaxObjects=100
  
jcs.region.indexedRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  jcs.region.indexedRegion2=indexedDiskCache
  
jcs.region.indexedRegion2.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.region.indexedRegion2.cacheattributes.MaxObjects=100
  
jcs.region.indexedRegion2.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  jcs.region.indexedRegion3=indexedDiskCache
  
jcs.region.indexedRegion3.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.region.indexedRegion3.cacheattributes.MaxObjects=100
  
jcs.region.indexedRegion3.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  jcs.region.indexedRegion4=indexedDiskCache
  
jcs.region.indexedRegion4.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.region.indexedRegion4.cacheattributes.MaxObjects=100
  
jcs.region.indexedRegion4.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  
  ##### AUXILIARY CACHES
  
  # Indexed Disk Cache
  
jcs.auxiliary.indexedDiskCache=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
  
jcs.auxiliary.indexedDiskCache.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
  
jcs.auxiliary.indexedDiskCache.attributes.DiskPath=target/test-sandbox/indexed-disk-cache-conc
  
  
  
  
  1.1                  jakarta-turbine-jcs/src/test/TestTCPLateralCache.ccf
  
  Index: TestTCPLateralCache.ccf
  ===================================================================
  # Cache configuration for the 'TestDiskCache' test. The memory cache has a
  # a maximum of 100 objects, so objects should get pushed into the disk cache
  
  jcs.default=
  jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.default.cacheattributes.MaxObjects=10000
  
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  # SYSTEM GROUP ID CACHE
  jcs.system.groupIdCache=
  
jcs.system.groupIdCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
  
jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  
  ##### CACHE REGIONS FOR TEST
  
  jcs.region.testTcpRegion1=LTCP
  
jcs.region.testTcpRegion1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.region.testTcpRegion1.cacheattributes.MaxObjects=10000
  
jcs.region.testTcpRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  
  ##### AUXILIARY CACHES
  
  # simple Lateral TCP auxiliary
  jcs.auxiliary.LTCP=org.apache.jcs.auxiliary.lateral.LateralCacheFactory
  jcs.auxiliary.LTCP.attributes=org.apache.jcs.auxiliary.lateral.LateralCacheAttributes
  jcs.auxiliary.LTCP.attributes.TransmissionTypeName=TCP
  jcs.auxiliary.LTCP.attributes.TcpServers=localhost:1111
  jcs.auxiliary.LTCP.attributes.TcpListenerPort=1110
  jcs.auxiliary.LTCP.attributes.PutOnlyMode=true
  
  
  
  1.1                  jakarta-turbine-jcs/src/test/cache.ccf
  
  Index: cache.ccf
  ===================================================================
  # JCS Config for unit testing, just a simple memory only cache
  
  jcs.default=
  jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.default.cacheattributes.MaxObjects=1000
  
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  jcs.system.groupIdCache=
  
jcs.system.groupIdCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
  
jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
   
  jcs.region.testCache1=
  jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
  jcs.region.testCache1.cacheattributes.MaxObjects=1000
  
jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
  
  
  
  
  1.1                  jakarta-turbine-jcs/src/test/log4j.properties
  
  Index: log4j.properties
  ===================================================================
  # For unit testing, all output goes to bin/test/logs/jcs.log
  
  log4j.category.org.apache.jcs = DEBUG, jcs
  log4j.appender.jcs = org.apache.log4j.FileAppender
  log4j.appender.jcs.file = target/test-sandbox/logs/jcs.log
  log4j.appender.jcs.layout = org.apache.log4j.PatternLayout
  log4j.appender.jcs.layout.conversionPattern = %d [%t] %-5p %c - %m%n
  log4j.appender.jcs.append = false
  
  
  
  1.5       +23 -22    
jakarta-turbine-jcs/src/test/org/apache/jcs/access/TestCacheAccess.java
  
  Index: TestCacheAccess.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/test/org/apache/jcs/access/TestCacheAccess.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestCacheAccess.java      14 May 2002 15:25:49 -0000      1.4
  +++ TestCacheAccess.java      1 Aug 2002 12:53:33 -0000       1.5
  @@ -60,17 +60,18 @@
   
   import java.util.Enumeration;
   import java.util.StringTokenizer;
  +import java.util.Iterator;
   
   import org.apache.jcs.access.exception.CacheException;
   
   import org.apache.jcs.engine.behavior.IElementAttributes;
   import org.apache.jcs.engine.ElementAttributes;
  -import org.apache.jcs.engine.control.group.GroupCacheHub;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
   import org.apache.jcs.engine.control.event.TestElementEventHandler;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   
   
   
  @@ -110,27 +111,27 @@
                   //cache_control= GroupCacheAccess.getGroupAccess( "testGroupCache" 
);
   
                   // start the local cache witht he appropriate props file
  -                GroupCacheHub.getInstance( args[0] );
  +                CompositeCacheManager.getInstance( args[0] );
   
                   cache_control = GroupCacheAccess.getGroupAccess( "testCache1" );
   
                   // not necessary if you don't set default element attributes
  -                try
  -                {
  -                    cache_control.defineGroup( "gr" );
  -                }
  -                catch ( CacheException ce )
  -                {
  -                    p( ce.toString() + " /n" + ce.getMessage() );
  -                }
  -                try
  -                {
  -                    cache_control.defineGroup( "gr2" );
  -                }
  -                catch ( CacheException ce )
  -                {
  -                    p( ce.toString() + " /n" + ce.getMessage() );
  -                }
  +//                try
  +//                {
  +//                    cache_control.defineGroup( "gr" );
  +//                }
  +//                catch ( CacheException ce )
  +//                {
  +//                    p( ce.toString() + " /n" + ce.getMessage() );
  +//                }
  +//                try
  +//                {
  +//                    cache_control.defineGroup( "gr2" );
  +//                }
  +//                catch ( CacheException ce )
  +//                {
  +//                    p( ce.toString() + " /n" + ce.getMessage() );
  +//                }
   
                   GroupCacheAccess cache_control2 = GroupCacheAccess.getGroupAccess( 
"testCache2" );
                   p( "cache_control = " + cache_control );
  @@ -741,11 +742,11 @@
       /** Gets the attributeNames attribute of the TestCacheAccess class */
       static void getAttributeNames( String groupName )
       {
  -        Enumeration enum = cache_control.getAttributeNames( groupName );
  -        p( "enum = " + enum );
  -        while ( enum.hasMoreElements() )
  +        Iterator iter = cache_control.getGroupKeys( groupName ).iterator();
  +
  +        while ( iter.hasNext() )
           {
  -            p( "=" + ( String ) enum.nextElement() );
  +            p( "=" + ( String ) iter.next() );
           }
       }
   }
  
  
  
  1.5       +0 -1      
jakarta-turbine-jcs/src/test/org/apache/jcs/servlet/ListTestCacheServlet.java
  
  Index: ListTestCacheServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/test/org/apache/jcs/servlet/ListTestCacheServlet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ListTestCacheServlet.java 23 May 2002 15:22:23 -0000      1.4
  +++ ListTestCacheServlet.java 1 Aug 2002 12:53:33 -0000       1.5
  @@ -29,7 +29,6 @@
   import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
   
   import org.apache.jcs.engine.control.CompositeCacheManager;
  -import org.apache.jcs.engine.control.group.GroupCacheHub;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  
  
  

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

Reply via email to