Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9F563C367 for ; Fri, 11 May 2012 19:13:04 +0000 (UTC) Received: (qmail 96464 invoked by uid 500); 11 May 2012 19:13:04 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 96394 invoked by uid 500); 11 May 2012 19:13:04 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 96384 invoked by uid 99); 11 May 2012 19:13:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2012 19:13:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2012 19:12:59 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 400412388847 for ; Fri, 11 May 2012 19:12:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1337332 - in /commons/proper/jcs/branches/generics-interface/src: java/org/apache/jcs/auxiliary/disk/block/ java/org/apache/jcs/auxiliary/disk/indexed/ java/org/apache/jcs/auxiliary/disk/jdbc/ java/org/apache/jcs/auxiliary/disk/jdbc/mysql/... Date: Fri, 11 May 2012 19:12:36 -0000 To: commits@commons.apache.org From: tv@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120511191238.400412388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tv Date: Fri May 11 19:12:35 2012 New Revision: 1337332 URL: http://svn.apache.org/viewvc?rev=1337332&view=rev Log: Ongoing chase for broken tests Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManager.java commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/control/group/GroupAttrName.java commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/utils/struct/LRUMap.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/access/TestCacheAccess.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/LRUMapJCSUnitTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerUnitTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/access/JCSWorkerUnitTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentUnitTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapPerformanceTest.java commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapUnitTest.java Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java (original) +++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java Fri May 11 19:12:35 2012 @@ -220,7 +220,7 @@ public class BlockDiskCache) key ).groupId.equals( groupId ) ) + if ( key instanceof GroupAttrName && ( (GroupAttrName) key ).groupId.equals( groupId ) ) { keys.add( ( (GroupAttrName) key ).attrName ); } @@ -449,7 +449,7 @@ public class BlockDiskCache)key).attrName == null ) { // remove all keys of the same name hierarchy. Iterator> iter = this.keyStore.entrySet().iterator(); @@ -458,7 +458,8 @@ public class BlockDiskCache entry = iter.next(); K k = entry.getKey(); - if ( k instanceof GroupAttrName && ( (GroupAttrName) k ).groupId.equals( key ) ) + if ( k instanceof GroupAttrName && + ((GroupAttrName)k).groupId.equals(((GroupAttrName)key).groupId)) { int[] ded = this.keyStore.get( key ); this.dataFile.freeBlocks( ded ); Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java (original) +++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java Fri May 11 19:12:35 2012 @@ -748,7 +748,7 @@ public class IndexedDiskCache) k ).groupId.equals( groupId ) ) + if ( k instanceof GroupAttrName && ( (GroupAttrName) k ).groupId.equals( groupId ) ) { keys.add( ( (GroupAttrName) k ).attrName ); } @@ -793,9 +793,9 @@ public class IndexedDiskCache)key).attrName == null ) { - removed = performGroupRemoval( (GroupId) key ); + removed = performGroupRemoval( ((GroupAttrName)key).groupId ); } else { @@ -883,7 +883,7 @@ public class IndexedDiskCache) k ).groupId.equals( key ) ) { itemsToRemove.add( k ); } Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java (original) +++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java Fri May 11 19:12:35 2012 @@ -23,7 +23,6 @@ import java.io.Serializable; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.jcs.auxiliary.AuxiliaryCache; import org.apache.jcs.engine.behavior.ICompositeCacheManager; import org.apache.jcs.engine.behavior.IElementSerializer; import org.apache.jcs.engine.logging.behavior.ICacheEventLogger; @@ -110,7 +109,7 @@ public class JDBCDiskCacheManager * @param cacheName * @return The cache value */ - public AuxiliaryCache getCache( String cacheName ) + public JDBCDiskCache getCache( String cacheName ) { JDBCDiskCacheAttributes cattr = (JDBCDiskCacheAttributes) defaultJDBCDiskCacheAttributes.copy(); cattr.setCacheName( cacheName ); @@ -124,9 +123,9 @@ public class JDBCDiskCacheManager * @param tableState * @return AuxiliaryCache */ - protected AuxiliaryCache createJDBCDiskCache( JDBCDiskCacheAttributes cattr, TableState tableState ) + protected JDBCDiskCache createJDBCDiskCache( JDBCDiskCacheAttributes cattr, TableState tableState ) { - AuxiliaryCache raf; + JDBCDiskCache raf; raf = new JDBCDiskCache( cattr, tableState, getCompositeCacheManager() ); return raf; } Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java (original) +++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java Fri May 11 19:12:35 2012 @@ -53,8 +53,8 @@ public abstract class JDBCDiskCacheManag protected static int clients; /** A map of JDBCDiskCache objects to region names. */ - protected static Hashtable> caches = - new Hashtable>(); + protected static Hashtable> caches = + new Hashtable>(); /** * A map of TableState objects to table names. Each cache has a table state object, which is @@ -78,7 +78,7 @@ public abstract class JDBCDiskCacheManag * @param tableState An object used by multiple processes to indicate state. * @return AuxiliaryCache -- a JDBCDiskCache */ - protected abstract AuxiliaryCache createJDBCDiskCache( JDBCDiskCacheAttributes cattr, TableState tableState ); + protected abstract JDBCDiskCache createJDBCDiskCache( JDBCDiskCacheAttributes cattr, TableState tableState ); /** * Creates a JDBCDiskCache for the region if one doesn't exist, else it returns the pre-created @@ -87,15 +87,15 @@ public abstract class JDBCDiskCacheManag * @param cattr * @return The cache value */ - public AuxiliaryCache getCache( JDBCDiskCacheAttributes cattr ) + public JDBCDiskCache getCache( JDBCDiskCacheAttributes cattr ) { - AuxiliaryCache diskCache = null; + JDBCDiskCache diskCache = null; log.debug( "cacheName = " + cattr.getCacheName() ); synchronized ( caches ) { - diskCache = (AuxiliaryCache) caches.get( cattr.getCacheName() ); + diskCache = (JDBCDiskCache) caches.get( cattr.getCacheName() ); if ( diskCache == null ) { @@ -163,7 +163,7 @@ public abstract class JDBCDiskCacheManag */ public void freeCache( String name ) { - JDBCDiskCache raf = (JDBCDiskCache) caches.get( name ); + JDBCDiskCache raf = caches.get( name ); if ( raf != null ) { try @@ -197,11 +197,11 @@ public abstract class JDBCDiskCacheManag } synchronized ( caches ) { - Enumeration> allCaches = caches.elements(); + Enumeration> allCaches = caches.elements(); while ( allCaches.hasMoreElements() ) { - JDBCDiskCache raf = (JDBCDiskCache) allCaches.nextElement(); + JDBCDiskCache raf = allCaches.nextElement(); if ( raf != null ) { try Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManager.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManager.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManager.java (original) +++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManager.java Fri May 11 19:12:35 2012 @@ -26,7 +26,7 @@ import java.util.TimerTask; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.jcs.auxiliary.AuxiliaryCache; +import org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCache; import org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes; import org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheManagerAbstractTemplate; import org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCachePoolAccess; @@ -129,7 +129,7 @@ public class MySQLDiskCacheManager * @param cacheName * @return The cache value */ - public AuxiliaryCache getCache( String cacheName ) + public JDBCDiskCache getCache( String cacheName ) { MySQLDiskCacheAttributes cattr = (MySQLDiskCacheAttributes) defaultJDBCDiskCacheAttributes.copy(); cattr.setCacheName( cacheName ); @@ -144,7 +144,7 @@ public class MySQLDiskCacheManager * @return AuxiliaryCache */ @Override - protected AuxiliaryCache createJDBCDiskCache( JDBCDiskCacheAttributes cattr, TableState tableState ) + protected MySQLDiskCache createJDBCDiskCache( JDBCDiskCacheAttributes cattr, TableState tableState ) { MySQLDiskCache diskCache = new MySQLDiskCache( (MySQLDiskCacheAttributes) cattr, tableState, getCompositeCacheManager() ); Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/control/group/GroupAttrName.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/control/group/GroupAttrName.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/control/group/GroupAttrName.java (original) +++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/control/group/GroupAttrName.java Fri May 11 19:12:35 2012 @@ -49,10 +49,9 @@ public class GroupAttrName to = (GroupAttrName) obj; - return groupId.equals( to.groupId ) && attrName.equals( to.attrName ); + + if (groupId.equals( to.groupId )) + { + if (attrName == null && to.attrName == null) + { + return true; + } + else if (attrName == null || to.attrName == null) + { + return false; + } + + return attrName.equals( to.attrName ); + } + + return false; } /** @@ -76,6 +90,11 @@ public class GroupAttrName)k).groupId.equals(((GroupAttrName)key).groupId)) { list.remove( entry.getValue() ); itr.remove(); @@ -464,7 +464,7 @@ public abstract class AbstractDoulbeLink log.error( "key toString=" + key.toString() ); if ( key instanceof GroupAttrName ) { - GroupAttrName name = (GroupAttrName) key; + GroupAttrName name = (GroupAttrName) key; log.error( "GroupID hashcode=" + name.groupId.hashCode() ); log.error( "GroupID.class=" + name.groupId.getClass() ); log.error( "AttrName hashcode=" + name.attrName.hashCode() ); Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java (original) +++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java Fri May 11 19:12:35 2012 @@ -33,7 +33,6 @@ import org.apache.jcs.engine.CacheConsta import org.apache.jcs.engine.behavior.ICacheElement; import org.apache.jcs.engine.control.CompositeCache; import org.apache.jcs.engine.control.group.GroupAttrName; -import org.apache.jcs.engine.control.group.GroupId; import org.apache.jcs.engine.memory.AbstractMemoryCache; import org.apache.jcs.engine.memory.util.MemoryElementDescriptor; import org.apache.jcs.engine.stats.StatElement; @@ -193,7 +192,7 @@ public class LHMLRUMemoryCache)key).attrName == null ) { // remove all keys of the same name hierarchy. synchronized ( map ) @@ -203,7 +202,8 @@ public class LHMLRUMemoryCache> entry = itr.next(); K k = entry.getKey(); - if ( k instanceof GroupAttrName && ( (GroupAttrName) k ).groupId.equals( key ) ) + if ( k instanceof GroupAttrName && + ((GroupAttrName)k).groupId.equals(((GroupAttrName)key).groupId) ) { itr.remove(); removed = true; Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/utils/struct/LRUMap.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/utils/struct/LRUMap.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/utils/struct/LRUMap.java (original) +++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/utils/struct/LRUMap.java Fri May 11 19:12:35 2012 @@ -455,7 +455,7 @@ public class LRUMap log.error( "key toString=" + key.toString() ); if ( key instanceof GroupAttrName ) { - GroupAttrName name = (GroupAttrName) key; + GroupAttrName name = (GroupAttrName) key; log.error( "GroupID hashcode=" + name.groupId.hashCode() ); log.error( "GroupID.class=" + name.groupId.getClass() ); log.error( "AttrName hashcode=" + name.attrName.hashCode() ); Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/access/TestCacheAccess.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/access/TestCacheAccess.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/access/TestCacheAccess.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/access/TestCacheAccess.java Fri May 11 19:12:35 2012 @@ -696,7 +696,7 @@ public class TestCacheAccess long n_start = System.currentTimeMillis(); try { - Map results = cache_control.getMatching( pattern ); + Map results = cache_control.getMatching( pattern ); if ( show && results != null ) { p( results.toString() ); @@ -951,11 +951,11 @@ public class TestCacheAccess */ public void getAttributeNames( String groupName ) { - Iterator iter = cache_control.getGroupKeys( groupName ).iterator(); + Iterator iter = cache_control.getGroupKeys( groupName ).iterator(); while ( iter.hasNext() ) { - p( "=" + (String) iter.next() ); + p( "=" + iter.next() ); } } } Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/LRUMapJCSUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/LRUMapJCSUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/LRUMapJCSUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/LRUMapJCSUnitTest.java Fri May 11 19:12:35 2012 @@ -16,7 +16,7 @@ public class LRUMapJCSUnitTest // SETUP // DO WORK - LRUMapJCS map = new LRUMapJCS(); + LRUMapJCS map = new LRUMapJCS(); // VERIFY assertEquals( "Should be unlimted", -1, map.getMaxObjects() ); @@ -29,7 +29,7 @@ public class LRUMapJCSUnitTest int expected = 100; // DO WORK - LRUMapJCS map = new LRUMapJCS( expected ); + LRUMapJCS map = new LRUMapJCS( expected ); // VERIFY assertEquals( "Should be expected", expected, map.getMaxObjects() ); @@ -42,7 +42,7 @@ public class LRUMapJCSUnitTest StringWriter stringWriter = new StringWriter(); TestLogConfigurationUtil.configureLogger( stringWriter, LRUMapJCS.class.getName() ); - LRUMapJCS map = new LRUMapJCS(); + LRUMapJCS map = new LRUMapJCS(); String key = "myKey"; String value = "myValue"; Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerUnitTest.java Fri May 11 19:12:35 2012 @@ -27,7 +27,7 @@ public class JDBCDiskCacheManagerUnitTes .getUnconfiguredInstance(), cacheEventLogger, elementSerializer ); // DO WORK - JDBCDiskCache cache = (JDBCDiskCache) manager.getCache( cacheName ); + JDBCDiskCache cache = manager.getCache( cacheName ); // VERIFY assertEquals( "wrong cacheEventLogger", cacheEventLogger, cache.getCacheEventLogger() ); Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java Fri May 11 19:12:35 2012 @@ -27,7 +27,7 @@ public class MySQLDiskCacheManagerUnitTe elementSerializer ); // DO WORK - MySQLDiskCache cache = (MySQLDiskCache) manager.getCache( cacheName ); + MySQLDiskCache cache = (MySQLDiskCache) manager.getCache( cacheName ); // VERIFY assertEquals( "wrong cacheEventLogger", cacheEventLogger, cache.getCacheEventLogger() ); Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java Fri May 11 19:12:35 2012 @@ -1,9 +1,9 @@ package org.apache.jcs.auxiliary.lateral; -import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes; - import junit.framework.TestCase; +import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes; + /** * Tests for LateralCacheNoWaitFacade. */ @@ -16,78 +16,78 @@ public class LateralCacheNoWaitFacadeUni public void testAddThenRemoveNoWait_InList() { // SETUP - LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; + LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); - - LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); - - LateralCache cache = new LateralCache( cattr ); - LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); - + + LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); + + LateralCache cache = new LateralCache( cattr ); + LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); + // DO WORK facade.addNoWait( noWait ); // VERIFY assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) ); - + // DO WORK facade.removeNoWait( noWait ); - + // VERIFY - assertEquals( "Should have 0", 0, facade.noWaits.length ); + assertEquals( "Should have 0", 0, facade.noWaits.length ); assertFalse( "Should not be in the list. ", facade.containsNoWait( noWait ) ); } - + /** * Verify that we can remove an item. */ public void testAddThenRemoveNoWait_InListSize2() { // SETUP - LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; + LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); - - LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); - - LateralCache cache = new LateralCache( cattr ); - LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); - LateralCacheNoWait noWait2 = new LateralCacheNoWait( cache ); - + + LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); + + LateralCache cache = new LateralCache( cattr ); + LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); + LateralCacheNoWait noWait2 = new LateralCacheNoWait( cache ); + // DO WORK facade.addNoWait( noWait ); facade.addNoWait( noWait2 ); // VERIFY - assertEquals( "Should have 2", 2, facade.noWaits.length ); + assertEquals( "Should have 2", 2, facade.noWaits.length ); assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) ); assertTrue( "Should be in the list.", facade.containsNoWait( noWait2 ) ); - + // DO WORK facade.removeNoWait( noWait ); - - // VERIFY - assertEquals( "Should only have 1", 1, facade.noWaits.length ); + + // VERIFY + assertEquals( "Should only have 1", 1, facade.noWaits.length ); assertFalse( "Should not be in the list. ", facade.containsNoWait( noWait ) ); assertTrue( "Should be in the list.", facade.containsNoWait( noWait2 ) ); } - + /** * Verify that we can remove an item. */ public void testAdd_InList() { // SETUP - LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; + LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); - - LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); - - LateralCache cache = new LateralCache( cattr ); - LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); - + + LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); + + LateralCache cache = new LateralCache( cattr ); + LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); + // DO WORK facade.addNoWait( noWait ); facade.addNoWait( noWait ); @@ -96,26 +96,26 @@ public class LateralCacheNoWaitFacadeUni assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) ); assertEquals( "Should only have 1", 1, facade.noWaits.length ); } - + /** * Verify that we can remove an item. */ public void testAddThenRemoveNoWait_NotInList() { // SETUP - LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; + LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); - - LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); - - LateralCache cache = new LateralCache( cattr ); - LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); - + + LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); + + LateralCache cache = new LateralCache( cattr ); + LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); + // DO WORK facade.removeNoWait( noWait ); - + // VERIFY assertFalse( "Should not be in the list.", facade.containsNoWait( noWait ) ); - } + } } Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java Fri May 11 19:12:35 2012 @@ -50,11 +50,11 @@ public class LateralTCPDiscoveryListener { // SETUP String cacheName = "testAddNoWaitFacade_NotInList"; - LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; + LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); - LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); + LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); // DO WORK listener.addNoWaitFacade( cacheName, facade ); @@ -70,15 +70,15 @@ public class LateralTCPDiscoveryListener { // SETUP String cacheName = "testAddNoWaitFacade_FacadeInList"; - LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; + LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); - LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); + LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); - LateralCache cache = new LateralCache( cattr ); - LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); + LateralCache cache = new LateralCache( cattr ); + LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); // DO WORK boolean result = listener.addNoWait( noWait ); @@ -97,8 +97,8 @@ public class LateralTCPDiscoveryListener ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); - LateralCache cache = new LateralCache( cattr ); - LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); + LateralCache cache = new LateralCache( cattr ); + LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); // DO WORK boolean result = listener.addNoWait( noWait ); @@ -117,8 +117,8 @@ public class LateralTCPDiscoveryListener ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); - LateralCache cache = new LateralCache( cattr ); - LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); + LateralCache cache = new LateralCache( cattr ); + LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); // DO WORK boolean result = listener.removeNoWait( noWait ); @@ -134,15 +134,15 @@ public class LateralTCPDiscoveryListener { // SETUP String cacheName = "testAddNoWaitFacade_FacadeInList"; - LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; + LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); - LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); + LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); - LateralCache cache = new LateralCache( cattr ); - LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); + LateralCache cache = new LateralCache( cattr ); + LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); // DO WORK boolean result = listener.removeNoWait( noWait ); @@ -158,15 +158,15 @@ public class LateralTCPDiscoveryListener { // SETUP String cacheName = "testRemoveNoWaitFacade_FacadeInListNoWaitIs"; - LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; + LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); - LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); + LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); - LateralCache cache = new LateralCache( cattr ); - LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); + LateralCache cache = new LateralCache( cattr ); + LateralCacheNoWait noWait = new LateralCacheNoWait( cache ); listener.addNoWait( noWait ); // DO WORK @@ -199,12 +199,12 @@ public class LateralTCPDiscoveryListener lca.setTcpServer( service.getServiceAddress() + ":" + service.getServicePort() ); LateralTCPCacheManager lcm = LateralTCPCacheManager.getInstance( lca, cacheMgr, cacheEventLogger, elementSerializer ); - LateralCacheNoWait noWait = (LateralCacheNoWait) lcm.getCache( cacheName ); + LateralCacheNoWait noWait = (LateralCacheNoWait) lcm.getCache( cacheName ); - LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; + LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); - LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); + LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); // DO WORK @@ -237,12 +237,12 @@ public class LateralTCPDiscoveryListener lca.setTcpServer( service.getServiceAddress() + ":" + service.getServicePort() ); LateralTCPCacheManager lcm = LateralTCPCacheManager.getInstance( lca, cacheMgr, cacheEventLogger, elementSerializer ); - LateralCacheNoWait noWait = (LateralCacheNoWait) lcm.getCache( cacheName ); + LateralCacheNoWait noWait = (LateralCacheNoWait) lcm.getCache( cacheName ); - LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; + LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); - LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); + LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr ); listener.addNoWaitFacade( cacheName, facade ); listener.addDiscoveredService( service ); Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java Fri May 11 19:12:35 2012 @@ -128,7 +128,6 @@ public class RemoteCacheClientTester // incoming calls, // using an anonymous port. UnicastRemoteObject.exportObject( this ); - ee = null; } catch ( ExportException e ) { Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java Fri May 11 19:12:35 2012 @@ -54,7 +54,7 @@ public class RemoteCacheListenerUnitTest // SETUP IRemoteCacheAttributes irca = new RemoteCacheAttributes(); irca.setRemoveUponRemotePut( false ); - ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); + ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); RemoteCacheListener listener = new RemoteCacheListener( irca, cacheMgr ); String cacheName = "testName"; @@ -97,7 +97,7 @@ public class RemoteCacheListenerUnitTest // SETUP IRemoteCacheAttributes irca = new RemoteCacheAttributes(); irca.setRemoveUponRemotePut( true ); - ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); + ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); RemoteCacheListener listener = new RemoteCacheListener( irca, cacheMgr ); String cacheName = "testName"; Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java Fri May 11 19:12:35 2012 @@ -101,7 +101,7 @@ public class TestRemoteCache Thread.sleep( 100 ); - ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); + ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); RemoteCacheAttributes rca = new RemoteCacheAttributes(); rca.setRemoteHost( "localhost" ); Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java Fri May 11 19:12:35 2012 @@ -40,7 +40,7 @@ public class RemoteHttpCacheServiceUnitT throws Exception { // SETUP - MockCompositeCacheManager manager = new MockCompositeCacheManager(); + MockCompositeCacheManager manager = new MockCompositeCacheManager(); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); @@ -69,7 +69,7 @@ public class RemoteHttpCacheServiceUnitT throws Exception { // SETUP - MockCompositeCacheManager manager = new MockCompositeCacheManager(); + MockCompositeCacheManager manager = new MockCompositeCacheManager(); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); @@ -93,7 +93,7 @@ public class RemoteHttpCacheServiceUnitT throws Exception { // SETUP - MockCompositeCacheManager manager = new MockCompositeCacheManager(); + MockCompositeCacheManager manager = new MockCompositeCacheManager(); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); @@ -117,7 +117,7 @@ public class RemoteHttpCacheServiceUnitT throws Exception { // SETUP - MockCompositeCacheManager manager = new MockCompositeCacheManager(); + MockCompositeCacheManager manager = new MockCompositeCacheManager(); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); @@ -141,7 +141,7 @@ public class RemoteHttpCacheServiceUnitT throws Exception { // SETUP - MockCompositeCacheManager manager = new MockCompositeCacheManager(); + MockCompositeCacheManager manager = new MockCompositeCacheManager(); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); @@ -165,7 +165,7 @@ public class RemoteHttpCacheServiceUnitT throws Exception { // SETUP - MockCompositeCacheManager manager = new MockCompositeCacheManager(); + MockCompositeCacheManager manager = new MockCompositeCacheManager(); MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger(); RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java Fri May 11 19:12:35 2012 @@ -36,27 +36,27 @@ public class RemoteHttpCacheSeviceFactor public void testCreateRemoteHttpCacheService_WithLogger() { // SETUP - MockCompositeCacheManager manager = new MockCompositeCacheManager(); + MockCompositeCacheManager manager = new MockCompositeCacheManager(); String className = MockCacheEventLogger.class.getName(); Properties props = new Properties(); props.put( IRemoteHttpCacheConstants.HTTP_CACHE_SERVER_PREFIX + AuxiliaryCacheConfigurator.CACHE_EVENT_LOGGER_PREFIX, className ); - + boolean allowClusterGet = false; props.put( IRemoteHttpCacheConstants.HTTP_CACHE_SERVER_ATTRIBUTES_PROPERTY_PREFIX + ".allowClusterGet", String .valueOf( allowClusterGet ) ); - + manager.setConfigurationProperties( props ); // DO WORK - RemoteHttpCacheService result = RemoteHttpCacheSeviceFactory + RemoteHttpCacheService result = RemoteHttpCacheSeviceFactory .createRemoteHttpCacheService( manager ); // VERIFY assertNotNull( "Should have a service.", result ); } - + /** verify that we get the CacheEventLogger value */ public void testConfigureCacheEventLogger_Present() { Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java Fri May 11 19:12:35 2012 @@ -72,7 +72,7 @@ public class BasicRemoteCacheClientServe throws Exception { // SETUP - MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager(); + MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager(); RemoteCacheAttributes attributes = new RemoteCacheAttributes(); attributes.setRemoteHost( "localhost" ); @@ -109,7 +109,7 @@ public class BasicRemoteCacheClientServe throws Exception { // SETUP - MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager(); + MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager(); RemoteCacheAttributes attributes = new RemoteCacheAttributes(); attributes.setRemoteHost( "localhost" ); @@ -155,7 +155,7 @@ public class BasicRemoteCacheClientServe throws Exception { // SETUP - MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager(); + MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager(); RemoteCacheAttributes attributes = new RemoteCacheAttributes(); attributes.setRemoteHost( "localhost" ); @@ -197,7 +197,7 @@ public class BasicRemoteCacheClientServe throws Exception { // SETUP - MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager(); + MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager(); RemoteCacheAttributes attributes = new RemoteCacheAttributes(); attributes.setRemoteHost( "localhost" ); Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/access/JCSWorkerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/access/JCSWorkerUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/access/JCSWorkerUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/access/JCSWorkerUnitTest.java Fri May 11 19:12:35 2012 @@ -42,7 +42,7 @@ public class JCSWorkerUnitTest public void testSimpleGet() throws Exception { - JCSWorker cachingWorker = new JCSWorker( "example region" ); + JCSWorker cachingWorker = new JCSWorker( "example region" ); // This is the helper. JCSWorkerHelper helper = new AbstractJCSWorkerHelper() @@ -58,11 +58,11 @@ public class JCSWorkerUnitTest String key = "abc"; - Long result = (Long) cachingWorker.getResult( key, helper ); + Long result = cachingWorker.getResult( key, helper ); assertEquals( "Called the wrong number of times", Long.valueOf( 1 ), result ); - // should get it fromthe cache. - Long result2 = (Long) cachingWorker.getResult( key, helper ); + // should get it from the cache. + Long result2 = cachingWorker.getResult( key, helper ); assertEquals( "Called the wrong number of times", Long.valueOf( 1 ), result2 ); } Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java Fri May 11 19:12:35 2012 @@ -113,7 +113,7 @@ public class JCSvsCommonsLRUMapPerforman try { - Map cache = new LRUMap( tries ); + Map cache = new LRUMap( tries ); for ( int j = 0; j < loops; j++ ) { @@ -144,7 +144,7 @@ public class JCSvsCommonsLRUMapPerforman // ///////////////////////////////////////////////////////////// cache2Name = "Commons "; // or LRUMapJCS - Map cache2 = new org.apache.commons.collections.map.LRUMap( tries ); + Map cache2 = new org.apache.commons.collections.map.LRUMap( tries ); // cache2Name = "Hashtable"; // Hashtable cache2 = new Hashtable(); start = System.currentTimeMillis(); Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentTest.java Fri May 11 19:12:35 2012 @@ -63,7 +63,7 @@ public class LRUMapConcurrentTest TestSuite suite = new TestSuite( LRUMapConcurrentTest.class ); // run concurrent tests - final LRUMap map = new LRUMap( 2000 ); + final LRUMap map = new LRUMap( 2000 ); suite.addTest( new LRUMapConcurrentTest( "conc1" ) { @Override @@ -94,7 +94,7 @@ public class LRUMapConcurrentTest // run more concurrent tests final int max2 = 20000; - final LRUMap map2 = new LRUMap( max2 ); + final LRUMap map2 = new LRUMap( max2 ); suite.addTest( new LRUMapConcurrentTest( "concB1" ) { @Override @@ -124,7 +124,7 @@ public class LRUMapConcurrentTest public void testSimpleLoad() throws Exception { - LRUMap map = new LRUMap( items ); + LRUMap map = new LRUMap( items ); for ( int i = 0; i < items; i++ ) { @@ -133,7 +133,7 @@ public class LRUMapConcurrentTest for ( int i = items - 1; i >= 0; i-- ) { - String res = (String) map.get( i + ":key" ); + String res = map.get( i + ":key" ); assertNotNull( "[" + i + ":key] should not be null", res ); } @@ -151,7 +151,7 @@ public class LRUMapConcurrentTest throws Exception { int total = 10; - LRUMap map = new LRUMap( total ); + LRUMap map = new LRUMap( total ); map.setChunkSize( 1 ); // put the max in @@ -160,7 +160,7 @@ public class LRUMapConcurrentTest map.put( i + ":key", "data" + i ); } - Iterator it = map.entrySet().iterator(); + Iterator it = map.entrySet().iterator(); while ( it.hasNext() ) { System.out.println( it.next() ); @@ -170,7 +170,7 @@ public class LRUMapConcurrentTest // get the max out backwards for ( int i = total - 1; i >= 0; i-- ) { - String res = (String) map.get( i + ":key" ); + String res = map.get( i + ":key" ); assertNotNull( "[" + i + ":key] should not be null", res ); } @@ -190,7 +190,7 @@ public class LRUMapConcurrentTest throws Exception { int total = 10000; - LRUMap map = new LRUMap( total ); + LRUMap map = new LRUMap( total ); map.setChunkSize( 1 ); // put the max in @@ -199,7 +199,7 @@ public class LRUMapConcurrentTest map.put( i + ":key", "data" + i ); } - // get the total number, these shoukld be null + // get the total number, these should be null for ( int i = total - 1; i >= 0; i-- ) { assertNull( map.get( i + ":key" ) ); @@ -209,7 +209,7 @@ public class LRUMapConcurrentTest // get the total to total *2 items out, these should be foufn. for ( int i = ( total * 2 ) - 1; i >= total; i-- ) { - String res = (String) map.get( i + ":key" ); + String res = map.get( i + ":key" ); assertNotNull( "[" + i + ":key] should not be null", res ); } @@ -223,7 +223,7 @@ public class LRUMapConcurrentTest * @param items * @throws Exception */ - public void runConcurrentPutGetTests( LRUMap map, int items ) + public void runConcurrentPutGetTests( LRUMap map, int items ) throws Exception { for ( int i = 0; i < items; i++ ) @@ -233,7 +233,7 @@ public class LRUMapConcurrentTest for ( int i = items - 1; i >= 0; i-- ) { - String res = (String) map.get( i + ":key" ); + String res = map.get( i + ":key" ); assertNotNull( "[" + i + ":key] should not be null", res ); } } @@ -246,7 +246,7 @@ public class LRUMapConcurrentTest * @param end * @throws Exception */ - public void runConcurrentRangeTests( LRUMap map, int start, int end ) + public void runConcurrentRangeTests( LRUMap map, int start, int end ) throws Exception { for ( int i = start; i < end; i++ ) @@ -256,7 +256,7 @@ public class LRUMapConcurrentTest for ( int i = end - 1; i >= start; i-- ) { - String res = (String) map.get( i + ":key" ); + String res = map.get( i + ":key" ); assertNotNull( "[" + i + ":key] should not be null", res ); } Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapConcurrentUnitTest.java Fri May 11 19:12:35 2012 @@ -57,7 +57,7 @@ public class LRUMapConcurrentUnitTest TestSuite suite = new TestSuite( LRUMapConcurrentUnitTest.class ); // run concurrent tests - final LRUMap map = new LRUMap( 2000 ); + final LRUMap map = new LRUMap( 2000 ); suite.addTest( new LRUMapConcurrentUnitTest( "conc1" ) { @Override @@ -88,7 +88,7 @@ public class LRUMapConcurrentUnitTest // run more concurrent tests final int max2 = 20000; - final LRUMap map2 = new LRUMap( max2 ); + final LRUMap map2 = new LRUMap( max2 ); suite.addTest( new LRUMapConcurrentUnitTest( "concB1" ) { @Override @@ -120,7 +120,7 @@ public class LRUMapConcurrentUnitTest public void testSimpleLoad() throws Exception { - LRUMap map = new LRUMap( items ); + LRUMap map = new LRUMap( items ); for ( int i = 0; i < items; i++ ) { @@ -129,7 +129,7 @@ public class LRUMapConcurrentUnitTest for ( int i = items - 1; i >= 0; i-- ) { - String res = (String) map.get( i + ":key" ); + String res = map.get( i + ":key" ); assertNotNull( "[" + i + ":key] should not be null", res ); } @@ -140,7 +140,7 @@ public class LRUMapConcurrentUnitTest } /** - * Just make sure that the LRU functions int he most simple case. + * Just make sure that the LRU functions in he most simple case. * * @exception Exception * Description of the Exception @@ -149,7 +149,7 @@ public class LRUMapConcurrentUnitTest throws Exception { int total = 10; - LRUMap map = new LRUMap( total ); + LRUMap map = new LRUMap( total ); map.setChunkSize( 1 ); // put the max in @@ -158,7 +158,7 @@ public class LRUMapConcurrentUnitTest map.put( i + ":key", "data" + i ); } - Iterator it = map.entrySet().iterator(); + Iterator it = map.entrySet().iterator(); while ( it.hasNext() ) { System.out.println( it.next() ); @@ -168,7 +168,7 @@ public class LRUMapConcurrentUnitTest // get the max out backwards for ( int i = total - 1; i >= 0; i-- ) { - String res = (String) map.get( i + ":key" ); + String res = map.get( i + ":key" ); assertNotNull( "[" + i + ":key] should not be null", res ); } @@ -188,7 +188,7 @@ public class LRUMapConcurrentUnitTest throws Exception { int total = 10000; - LRUMap map = new LRUMap( total ); + LRUMap map = new LRUMap( total ); map.setChunkSize( 1 ); // put the max in @@ -197,17 +197,17 @@ public class LRUMapConcurrentUnitTest map.put( i + ":key", "data" + i ); } - // get the total number, these shoukld be null + // get the total number, these should be null for ( int i = total - 1; i >= 0; i-- ) { assertNull( map.get( i + ":key" ) ); } - // get the total to total *2 items out, these should be foufn. + // get the total to total *2 items out, these should be found. for ( int i = ( total * 2 ) - 1; i >= total; i-- ) { - String res = (String) map.get( i + ":key" ); + String res = map.get( i + ":key" ); assertNotNull( "[" + i + ":key] should not be null", res ); } @@ -222,7 +222,7 @@ public class LRUMapConcurrentUnitTest * @param items * @throws Exception */ - public void runConcurrentPutGetTests( LRUMap map, int items ) + public void runConcurrentPutGetTests( LRUMap map, int items ) throws Exception { for ( int i = 0; i < items; i++ ) @@ -232,7 +232,7 @@ public class LRUMapConcurrentUnitTest for ( int i = items - 1; i >= 0; i-- ) { - String res = (String) map.get( i + ":key" ); + String res = map.get( i + ":key" ); assertNotNull( "[" + i + ":key] should not be null", res ); } } @@ -246,7 +246,7 @@ public class LRUMapConcurrentUnitTest * @param end * @throws Exception */ - public void runConcurrentRangeTests( LRUMap map, int start, int end ) + public void runConcurrentRangeTests( LRUMap map, int start, int end ) throws Exception { for ( int i = start; i < end; i++ ) @@ -256,7 +256,7 @@ public class LRUMapConcurrentUnitTest for ( int i = end - 1; i >= start; i-- ) { - String res = (String) map.get( i + ":key" ); + String res = map.get( i + ":key" ); assertNotNull( "[" + i + ":key] should not be null", res ); } Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapPerformanceTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapPerformanceTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapPerformanceTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapPerformanceTest.java Fri May 11 19:12:35 2012 @@ -26,7 +26,6 @@ import junit.framework.TestCase; import junit.framework.TestSuite; import org.apache.jcs.JCSvsHashtablePerformanceTest; -import org.apache.jcs.utils.struct.LRUMap; /** * This ensures that the jcs version of the LRU map is as fast as the commons @@ -108,7 +107,7 @@ public class LRUMapPerformanceTest try { - Map cache = new LRUMap( tries ); + Map cache = new LRUMap( tries ); for ( int j = 0; j < loops; j++ ) { @@ -138,7 +137,7 @@ public class LRUMapPerformanceTest /////////////////////////////////////////////////////////////// cache2Name = "LRUMapJCS (commons)"; //or LRUMapJCS - Map cache2 = new org.apache.commons.collections.map.LRUMap( tries ); + Map cache2 = new org.apache.commons.collections.map.LRUMap( tries ); //cache2Name = "Hashtable"; //Hashtable cache2 = new Hashtable(); start = System.currentTimeMillis(); Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapUnitTest.java?rev=1337332&r1=1337331&r2=1337332&view=diff ============================================================================== --- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapUnitTest.java (original) +++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/struct/LRUMapUnitTest.java Fri May 11 19:12:35 2012 @@ -20,10 +20,8 @@ package org.apache.jcs.utils.struct; */ import java.util.Map; -import java.util.Set; import java.util.Map.Entry; - -import org.apache.jcs.utils.struct.LRUMap; +import java.util.Set; import junit.framework.TestCase; @@ -44,7 +42,7 @@ public class LRUMapUnitTest public void testPutWithSizeLimit() { int size = 10; - Map cache = new LRUMap( size ); + Map cache = new LRUMap( size ); for ( int i = 0; i < size; i++ ) { @@ -53,7 +51,7 @@ public class LRUMapUnitTest for ( int i = 0; i < size; i++ ) { - String data = (String)cache.get( "key:" + i ); + String data = cache.get( "key:" + i ); assertEquals( "Data is wrong.", "data:" + i, data ); } } @@ -65,7 +63,7 @@ public class LRUMapUnitTest public void testPutWithNoSizeLimit() { int size = 10; - Map cache = new LRUMap( ); + Map cache = new LRUMap( ); for ( int i = 0; i < size; i++ ) { @@ -74,7 +72,7 @@ public class LRUMapUnitTest for ( int i = 0; i < size; i++ ) { - String data = (String)cache.get( "key:" + i ); + String data = cache.get( "key:" + i ); assertEquals( "Data is wrong.", "data:" + i, data ); } } @@ -86,10 +84,10 @@ public class LRUMapUnitTest public void testPutAndRemove() { int size = 10; - Map cache = new LRUMap( size ); + Map cache = new LRUMap( size ); cache.put( "key:" + 1, "data:" + 1 ); - String data = (String)cache.remove( "key:" + 1 ); + String data = cache.remove( "key:" + 1 ); assertEquals( "Data is wrong.", "data:" + 1, data ); } @@ -100,7 +98,7 @@ public class LRUMapUnitTest public void testRemoveEmpty() { int size = 10; - Map cache = new LRUMap( size ); + Map cache = new LRUMap( size ); Object returned = cache.remove( "key:" + 1 ); assertNull( "Shouldn't hvae anything.", returned ); @@ -114,21 +112,19 @@ public class LRUMapUnitTest public void testGetEntrySet() { int size = 10; - Map cache = new LRUMap( size ); + Map cache = new LRUMap( size ); for ( int i = 0; i < size; i++ ) { cache.put( "key:" + i, "data:" + i ); } - Set entries = cache.entrySet(); + Set> entries = cache.entrySet(); assertEquals( "Set contains the wrong number of items.", size, entries.size() ); // check minimal correctness - Object[] entryArray = entries.toArray(); - for ( int i = 0; i < size; i++ ) + for (Entry data : entries) { - Entry data = (Entry)entryArray[i]; assertTrue( "Data is wrong.", data.getValue().toString().indexOf( "data:") != -1 ); } }