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 26E50986F for ; Sat, 4 Aug 2012 14:24:27 +0000 (UTC) Received: (qmail 69270 invoked by uid 500); 4 Aug 2012 14:24:26 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 69191 invoked by uid 500); 4 Aug 2012 14:24:26 -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 69184 invoked by uid 99); 4 Aug 2012 14:24:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Aug 2012 14:24:26 +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; Sat, 04 Aug 2012 14:24:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C29EA23888E3 for ; Sat, 4 Aug 2012 14:23:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1369332 - in /commons/proper/jcs/trunk/src/test/org/apache/jcs: ./ auxiliary/disk/block/ auxiliary/disk/file/ auxiliary/disk/indexed/ auxiliary/disk/jdbc/ auxiliary/disk/jdbc/mysql/ auxiliary/lateral/ auxiliary/lateral/socket/tcp/ auxiliar... Date: Sat, 04 Aug 2012 14:23:38 -0000 To: commits@commons.apache.org From: tv@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120804142339.C29EA23888E3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tv Date: Sat Aug 4 14:23:36 2012 New Revision: 1369332 URL: http://svn.apache.org/viewvc?rev=1369332&view=rev Log: - Fixed lots of warnings and FindBugs issues - Introduced carefully crafted @SuppressWarnings annotations Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSCacheElementRetrievalUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/HsqlSetupTableUtil.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheRemovalUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheShrinkUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheService.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerStartupUtil.java commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/MockCompositeCacheManager.java commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapPerformanceTest.java Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSCacheElementRetrievalUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSCacheElementRetrievalUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSCacheElementRetrievalUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/JCSCacheElementRetrievalUnitTest.java Sat Aug 4 14:23:36 2012 @@ -19,10 +19,10 @@ package org.apache.jcs; * under the License. */ -import org.apache.jcs.engine.behavior.ICacheElement; - import junit.framework.TestCase; +import org.apache.jcs.engine.behavior.ICacheElement; + /** * @author Aaron Smuts * Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java Sat Aug 4 14:23:36 2012 @@ -92,9 +92,7 @@ public class BlockDiskCacheKeyStoreUnitT attributes.setMaxKeySize( maxKeys ); attributes.setBlockSizeBytes( bytesPerBlock ); - BlockDiskCache blockDiskCache = new BlockDiskCache( attributes ); - - BlockDiskKeyStore keyStore = new BlockDiskKeyStore( attributes, blockDiskCache ); + BlockDiskKeyStore keyStore = new BlockDiskKeyStore( attributes, null ); // DO WORK int numElements = 1000; Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java Sat Aug 4 14:23:36 2012 @@ -44,6 +44,7 @@ public class BlockDiskElementDescriptorU System.out.println( "Before: " + memoryBefore ); int numElements = 25000; + @SuppressWarnings("unchecked") BlockDiskElementDescriptor[] elements = new BlockDiskElementDescriptor[numElements]; long memoryStart = measureMemoryUse(); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java Sat Aug 4 14:23:36 2012 @@ -22,7 +22,7 @@ public class FileDiskCacheFactoryUnitTes cattr.setCacheName( cacheName ); cattr.setDiskPath( "target/test-sandbox/FileDiskCacheFactoryUnitTest" ); - ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); + ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); ICacheEventLogger cacheEventLogger = new MockCacheEventLogger(); IElementSerializer elementSerializer = new MockElementSerializer(); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java Sat Aug 4 14:23:36 2012 @@ -102,6 +102,7 @@ public class DiskTestObjectUtil */ public static ICacheElement[] createCacheElementsWithTestObjects( int numToCreate, int bytes, String cacheName ) { + @SuppressWarnings("unchecked") ICacheElement[] elements = new ICacheElement[numToCreate]; for ( int i = 0; i < numToCreate; i++ ) { @@ -124,6 +125,7 @@ public class DiskTestObjectUtil */ public static ICacheElement[] createCacheElementsWithTestObjectsOfVariableSizes( int numToCreate, String cacheName ) { + @SuppressWarnings("unchecked") ICacheElement[] elements = new ICacheElement[numToCreate]; Random random = new Random( 89 ); for ( int i = 0; i < numToCreate; i++ ) Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/HsqlSetupTableUtil.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/HsqlSetupTableUtil.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/HsqlSetupTableUtil.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/HsqlSetupTableUtil.java Sat Aug 4 14:23:36 2012 @@ -12,8 +12,10 @@ public class HsqlSetupTableUtil *

* @param cConn * @param tableName + * + * @throws SQLException if database problems occur */ - public static void setupTABLE( Connection cConn, String tableName ) + public static void setupTABLE( Connection cConn, String tableName ) throws SQLException { boolean newT = true; @@ -31,20 +33,11 @@ public class HsqlSetupTableUtil createSql.append( "PRIMARY KEY (CACHE_KEY, REGION) " ); createSql.append( ");" ); - Statement sStatement = null; - try - { - sStatement = cConn.createStatement(); - } - catch ( SQLException e ) - { - e.printStackTrace(); - } + Statement sStatement = cConn.createStatement(); try { sStatement.executeQuery( createSql.toString() ); - sStatement.close(); } catch ( SQLException e ) { @@ -54,11 +47,13 @@ public class HsqlSetupTableUtil } else { - // TODO figure out if it exists prior to trying to create it. - // log.error( "Problem creating table.", e ); - e.printStackTrace(); + throw e; } } + finally + { + sStatement.close(); + } String setupData[] = { "create index iKEY on JCS_STORE2 (CACHE_KEY, REGION)" }; Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheRemovalUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheRemovalUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheRemovalUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheRemovalUnitTest.java Sat Aug 4 14:23:36 2012 @@ -111,8 +111,10 @@ public class JDBCDiskCacheRemovalUnitTes * SETUP TABLE FOR CACHE *

* @param cConn + * + * @throws SQLException if database problems occur */ - private void setupTABLE( Connection cConn ) + private void setupTABLE( Connection cConn ) throws SQLException { boolean newT = true; @@ -130,34 +132,28 @@ public class JDBCDiskCacheRemovalUnitTes createSql.append( "PRIMARY KEY (CACHE_KEY, REGION) " ); createSql.append( ");" ); - Statement sStatement = null; - try - { - sStatement = cConn.createStatement(); - } - catch ( SQLException e ) - { - e.printStackTrace(); - } + Statement sStatement = cConn.createStatement(); try { sStatement.executeQuery( createSql.toString() ); - sStatement.close(); } catch ( SQLException e ) { + // FIXME: This is unreliable if ( e.toString().indexOf( "already exists" ) != -1 ) { newT = false; } else { - // TODO figure out if it exists prior to trying to create it. - // log.error( "Problem creating table.", e ); - e.printStackTrace(); + throw e; } } + finally + { + sStatement.close(); + } String setupData[] = { "create index iKEY on " + databaseName + " (CACHE_KEY, REGION)" }; Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheShrinkUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheShrinkUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheShrinkUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheShrinkUnitTest.java Sat Aug 4 14:23:36 2012 @@ -216,8 +216,10 @@ public class JDBCDiskCacheShrinkUnitTest /** * SETUP TABLE FOR CACHE * @param cConn + * + * @throws SQLException if database problems occur */ - void setupTABLE( Connection cConn ) + void setupTABLE( Connection cConn ) throws SQLException { boolean newT = true; @@ -235,20 +237,11 @@ public class JDBCDiskCacheShrinkUnitTest createSql.append( "PRIMARY KEY (CACHE_KEY, REGION) " ); createSql.append( ");" ); - Statement sStatement = null; - try - { - sStatement = cConn.createStatement(); - } - catch ( SQLException e ) - { - e.printStackTrace(); - } + Statement sStatement = cConn.createStatement(); try { sStatement.executeQuery( createSql.toString() ); - sStatement.close(); } catch ( SQLException e ) { @@ -258,11 +251,13 @@ public class JDBCDiskCacheShrinkUnitTest } else { - // TODO figure out if it exists prior to trying to create it. - // log.error( "Problem creating table.", e ); - e.printStackTrace(); + throw e; } } + finally + { + sStatement.close(); + } String setupData[] = { "create index iKEY on JCS_STORE_SHRINK (CACHE_KEY, REGION)" }; Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheUnitTest.java Sat Aug 4 14:23:36 2012 @@ -168,7 +168,7 @@ public class JDBCDiskCacheUnitTest cattr.setConnectionPoolName( poolName ); TableState tableState = new TableState( "JCSTESTTABLE_InitializePoolAccess" ); - MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager(); + MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager(); compositeCacheManager.setConfigurationProperties( props ); JDBCDiskCache diskCache = new JDBCDiskCache( cattr, tableState, compositeCacheManager ); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java Sat Aug 4 14:23:36 2012 @@ -27,7 +27,7 @@ public class MySQLDiskCacheManagerUnitTe elementSerializer ); // DO WORK - MySQLDiskCache cache = (MySQLDiskCache) manager.getCache( cacheName ); + MySQLDiskCache cache = manager.getCache( cacheName ); // VERIFY assertEquals( "wrong cacheEventLogger", cacheEventLogger, cache.getCacheEventLogger() ); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java Sat Aug 4 14:23:36 2012 @@ -53,11 +53,11 @@ public class MySQLDiskCacheUnitTest TableState tableState = new TableState( tableName ); tableState.setState( TableState.OPTIMIZATION_RUNNING ); - MySQLDiskCache cache = new MySQLDiskCache( attributes, tableState, CompositeCacheManager.getUnconfiguredInstance() ); + MySQLDiskCache cache = new MySQLDiskCache( attributes, tableState, CompositeCacheManager.getUnconfiguredInstance() ); // DO WORK Object result = cache.processGet( "myKey" ); - + // VERIFY assertNull( "The result should be null", result ); } Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java Sat Aug 4 14:23:36 2012 @@ -16,6 +16,7 @@ public class LateralCacheNoWaitFacadeUni public void testAddThenRemoveNoWait_InList() { // SETUP + @SuppressWarnings("unchecked") LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); @@ -45,6 +46,7 @@ public class LateralCacheNoWaitFacadeUni public void testAddThenRemoveNoWait_InListSize2() { // SETUP + @SuppressWarnings("unchecked") LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); @@ -79,6 +81,7 @@ public class LateralCacheNoWaitFacadeUni public void testAdd_InList() { // SETUP + @SuppressWarnings("unchecked") LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); @@ -103,6 +106,7 @@ public class LateralCacheNoWaitFacadeUni public void testAddThenRemoveNoWait_NotInList() { // SETUP + @SuppressWarnings("unchecked") LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( "testCache1" ); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java Sat Aug 4 14:23:36 2012 @@ -51,6 +51,8 @@ public class LateralTCPDiscoveryListener { // SETUP String cacheName = "testAddNoWaitFacade_NotInList"; + + @SuppressWarnings("unchecked") LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); @@ -71,6 +73,8 @@ public class LateralTCPDiscoveryListener { // SETUP String cacheName = "testAddNoWaitFacade_FacadeInList"; + + @SuppressWarnings("unchecked") LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); @@ -135,6 +139,8 @@ public class LateralTCPDiscoveryListener { // SETUP String cacheName = "testAddNoWaitFacade_FacadeInList"; + + @SuppressWarnings("unchecked") LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); @@ -159,6 +165,8 @@ public class LateralTCPDiscoveryListener { // SETUP String cacheName = "testRemoveNoWaitFacade_FacadeInListNoWaitIs"; + + @SuppressWarnings("unchecked") LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); @@ -200,8 +208,9 @@ 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 = lcm.getCache( cacheName ); + @SuppressWarnings("unchecked") LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); @@ -238,8 +247,9 @@ 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 = lcm.getCache( cacheName ); + @SuppressWarnings("unchecked") LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0]; ILateralCacheAttributes cattr = new LateralCacheAttributes(); cattr.setCacheName( cacheName ); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java Sat Aug 4 14:23:36 2012 @@ -29,6 +29,7 @@ import org.apache.jcs.auxiliary.lateral. import org.apache.jcs.engine.CacheElement; import org.apache.jcs.engine.behavior.ICacheElement; import org.apache.jcs.engine.behavior.ICompositeCacheManager; +import org.apache.jcs.engine.control.CompositeCache; import org.apache.jcs.engine.control.CompositeCacheManager; import org.apache.jcs.engine.control.MockCompositeCacheManager; import org.apache.jcs.utils.timing.SleepUtil; @@ -72,7 +73,7 @@ public class TestTCPLateralUnitTest ICompositeCacheManager cacheMgr = CompositeCacheManager.getInstance(); // start the listener - LateralTCPListener listener = (LateralTCPListener) LateralTCPListener.getInstance( lac, cacheMgr ); + LateralTCPListener listener = LateralTCPListener.getInstance( lac, cacheMgr ); // send to the listener LateralTCPSender lur = new LateralTCPSender( lac ); @@ -106,7 +107,7 @@ public class TestTCPLateralUnitTest TCPLateralCacheAttributes lattr = new TCPLateralCacheAttributes(); lattr.setTcpListenerPort( 1101 ); lattr.setTransmissionTypeName( "TCP" ); - MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager(); + MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager(); System.out.println( "mock cache = " + cacheMgr.getCache( "test" ) ); LateralTCPListener.getInstance( lattr, cacheMgr ); @@ -146,8 +147,9 @@ public class TestTCPLateralUnitTest // setup a listener TCPLateralCacheAttributes lattr = new TCPLateralCacheAttributes(); lattr.setTcpListenerPort( 1103 ); - MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager(); - System.out.println( "mock cache = " + cacheMgr.getCache( "test" ) ); + MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager(); + CompositeCache cache = cacheMgr.getCache( "test" ); + System.out.println( "mock cache = " + cache ); // get the listener started // give it our mock cache manager @@ -174,7 +176,7 @@ public class TestTCPLateralUnitTest SleepUtil.sleepAtLeast( 1000 ); // VERIFY - ICacheElement cacheElement = cacheMgr.getCache().get( "key" ); + ICacheElement cacheElement = cache.get( "key" ); System.out.println( "cacheElement = " + cacheElement ); assertEquals( "Didn't get the correct object", element2.getVal(), cacheElement.getVal() ); } @@ -190,8 +192,9 @@ public class TestTCPLateralUnitTest TCPLateralCacheAttributes lattr = new TCPLateralCacheAttributes(); lattr.setTcpListenerPort( 1105 ); lattr.setTransmissionTypeName( "TCP" ); - MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager(); - System.out.println( "mock cache = " + cacheMgr.getCache( "test" ) ); + MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager(); + CompositeCache cache = cacheMgr.getCache( "test" ); + System.out.println( "mock cache = " + cache ); // get the listener started // give it our mock cache manager @@ -219,7 +222,7 @@ public class TestTCPLateralUnitTest SleepUtil.sleepAtLeast( 1000 ); // VERIFY - ICacheElement cacheElement = cacheMgr.getCache().get( "key" ); + ICacheElement cacheElement = cache.get( "key" ); System.out.println( "cacheElement = " + cacheElement ); assertEquals( "Didn't get the correct object", element2.getVal(), cacheElement.getVal() ); } @@ -237,8 +240,9 @@ public class TestTCPLateralUnitTest // setup a listener TCPLateralCacheAttributes lattr = new TCPLateralCacheAttributes(); lattr.setTcpListenerPort( 1107 ); - MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager(); - System.out.println( "mock cache = " + cacheMgr.getCache( "test" ) ); + MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager(); + CompositeCache cache = cacheMgr.getCache( "test" ); + System.out.println( "mock cache = " + cache ); // get the listener started // give it our mock cache manager @@ -246,7 +250,7 @@ public class TestTCPLateralUnitTest // add the item to the listeners cache ICacheElement element = new CacheElement( "test", "key", "value1" ); - cacheMgr.getCache().update( element ); + cache.update( element ); // setup a service to talk to the listener started above. TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes(); @@ -280,8 +284,9 @@ public class TestTCPLateralUnitTest // setup a listener TCPLateralCacheAttributes lattr = new TCPLateralCacheAttributes(); lattr.setTcpListenerPort( 1108 ); - MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager(); - System.out.println( "mock cache = " + cacheMgr.getCache( "test" ) ); + MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager(); + CompositeCache cache = cacheMgr.getCache( "test" ); + System.out.println( "mock cache = " + cache ); // get the listener started // give it our mock cache manager @@ -294,7 +299,7 @@ public class TestTCPLateralUnitTest { // add the item to the listeners cache ICacheElement element = new CacheElement( "test", keyprefix1 + String.valueOf( i ), Integer.valueOf( i ) ); - cacheMgr.getCache().update( element ); + cache.update( element ); } // setup a service to talk to the listener started above. Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java Sat Aug 4 14:23:36 2012 @@ -33,9 +33,9 @@ import org.apache.jcs.auxiliary.Abstract import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes; import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheClient; import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener; -import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService; import org.apache.jcs.engine.CacheConstants; import org.apache.jcs.engine.behavior.ICacheElement; +import org.apache.jcs.engine.behavior.ICacheServiceNonLocal; import org.apache.jcs.engine.stats.behavior.IStats; /** @@ -70,7 +70,7 @@ public class MockRemoteCacheClient, Map>>(); /** The last service passed to fixCache */ - public IRemoteCacheService fixed; + public ICacheServiceNonLocal fixed; /** Attributes. */ public RemoteCacheAttributes attributes = new RemoteCacheAttributes(); @@ -79,11 +79,12 @@ public class MockRemoteCacheClient * (non-Javadoc) - * @see org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheClient#fixCache(org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService) + * @see org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheClient#fixCache(org.apache.jcs.auxiliary.remote.behavior.ICacheServiceNonLocal) */ - public void fixCache( IRemoteCacheService remote ) + @SuppressWarnings("unchecked") + public void fixCache( ICacheServiceNonLocal remote ) { - fixed = (IRemoteCacheService)remote; + fixed = (ICacheServiceNonLocal)remote; } /** Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheService.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheService.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheService.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheService.java Sat Aug 4 14:23:36 2012 @@ -28,14 +28,14 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService; import org.apache.jcs.engine.behavior.ICacheElement; +import org.apache.jcs.engine.behavior.ICacheServiceNonLocal; /** * This is a mock impl of the remote cache service. */ public class MockRemoteCacheService - implements IRemoteCacheService + implements ICacheServiceNonLocal { /** The key last passed to get */ public Serializable lastGetKey; @@ -99,7 +99,7 @@ public class MockRemoteCacheService * (non-Javadoc) - * @see org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService#removeAll(java.lang.String, + * @see org.apache.jcs.auxiliary.remote.behavior.ICacheServiceNonLocal#removeAll(java.lang.String, * long) */ public void removeAll( String cacheName, long requesterId ) Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java Sat Aug 4 14:23:36 2012 @@ -113,6 +113,7 @@ public class RemoteCacheClientTester * @exception NotBoundException * @exception IOException */ + @SuppressWarnings("unchecked") public RemoteCacheClientTester( String host, int port, int count, boolean write, boolean read, boolean delete ) throws MalformedURLException, NotBoundException, IOException { Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java Sat Aug 4 14:23:36 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/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheUnitTest.java Sat Aug 4 14:23:36 2012 @@ -27,6 +27,7 @@ import junit.framework.TestCase; import org.apache.jcs.auxiliary.MockCacheEventLogger; import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes; import org.apache.jcs.engine.CacheElement; +import org.apache.jcs.engine.ZombieCacheServiceNonLocal; import org.apache.jcs.engine.behavior.ICacheElement; import org.apache.jcs.engine.behavior.ICacheElementSerialized; import org.apache.jcs.utils.serialization.SerializationConversionUtil; @@ -81,7 +82,7 @@ public class RemoteCacheUnitTest { // SETUP IRemoteCacheAttributes cattr = new RemoteCacheAttributes(); - ZombieRemoteCacheService zombie = new ZombieRemoteCacheService( 10 ); + ZombieCacheServiceNonLocal zombie = new ZombieCacheServiceNonLocal( 10 ); MockRemoteCacheService service = new MockRemoteCacheService(); MockRemoteCacheListener listener = new MockRemoteCacheListener(); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java Sat Aug 4 14:23:36 2012 @@ -102,7 +102,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/trunk/src/test/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java Sat Aug 4 14:23:36 2012 @@ -22,6 +22,7 @@ package org.apache.jcs.auxiliary.remote; import junit.framework.TestCase; import org.apache.jcs.engine.CacheElement; +import org.apache.jcs.engine.ZombieCacheServiceNonLocal; import org.apache.jcs.engine.behavior.ICacheElement; /** @@ -41,7 +42,7 @@ public class ZombieRemoteCacheServiceUni // SETUP MockRemoteCacheService service = new MockRemoteCacheService(); - ZombieRemoteCacheService zombie = new ZombieRemoteCacheService( 10 ); + ZombieCacheServiceNonLocal zombie = new ZombieCacheServiceNonLocal( 10 ); String cacheName = "testUpdate"; @@ -65,7 +66,7 @@ public class ZombieRemoteCacheServiceUni // SETUP MockRemoteCacheService service = new MockRemoteCacheService(); - ZombieRemoteCacheService zombie = new ZombieRemoteCacheService( 0 ); + ZombieCacheServiceNonLocal zombie = new ZombieCacheServiceNonLocal( 0 ); String cacheName = "testUpdate"; @@ -89,7 +90,7 @@ public class ZombieRemoteCacheServiceUni // SETUP MockRemoteCacheService service = new MockRemoteCacheService(); - ZombieRemoteCacheService zombie = new ZombieRemoteCacheService( 10 ); + ZombieCacheServiceNonLocal zombie = new ZombieCacheServiceNonLocal( 10 ); String cacheName = "testRemoveThenWalk"; String key = "myKey"; @@ -113,7 +114,7 @@ public class ZombieRemoteCacheServiceUni // SETUP MockRemoteCacheService service = new MockRemoteCacheService(); - ZombieRemoteCacheService zombie = new ZombieRemoteCacheService( 10 ); + ZombieCacheServiceNonLocal zombie = new ZombieCacheServiceNonLocal( 10 ); String cacheName = "testRemoveThenWalk"; Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java Sat Aug 4 14:23:36 2012 @@ -20,6 +20,7 @@ package org.apache.jcs.auxiliary.remote. */ import java.io.IOException; +import java.io.Serializable; import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheDispatcher; import org.apache.jcs.auxiliary.remote.value.RemoteCacheRequest; @@ -30,20 +31,23 @@ public class MockRemoteCacheDispatcher implements IRemoteCacheDispatcher { /** The last request passes to dispatch */ - public RemoteCacheRequest lastRemoteCacheRequest; - + public RemoteCacheRequest lastRemoteCacheRequest; + /** The response setup */ - public RemoteCacheResponse setupRemoteCacheResponse; - - /** Records the last and returns setupRemoteCacheResponse. + public RemoteCacheResponse setupRemoteCacheResponse; + + /** Records the last and returns setupRemoteCacheResponse. *

- * @param remoteCacheRequest + * @param remoteCacheRequest * @return RemoteCacheResponse - * @throws IOException */ - public RemoteCacheResponse dispatchRequest( RemoteCacheRequest remoteCacheRequest ) + * @throws IOException + */ + @SuppressWarnings("unchecked") + public + RemoteCacheResponse dispatchRequest( RemoteCacheRequest remoteCacheRequest ) throws IOException { this.lastRemoteCacheRequest = remoteCacheRequest; - return setupRemoteCacheResponse; + return (RemoteCacheResponse)setupRemoteCacheResponse; } } Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java Sat Aug 4 14:23:36 2012 @@ -17,7 +17,7 @@ public class RemoteHttpCacheDispatcherUn RemoteHttpCacheAttributes remoteHttpCacheAttributes = new RemoteHttpCacheAttributes(); RemoteHttpCacheDispatcher dispatcher = new RemoteHttpCacheDispatcher( remoteHttpCacheAttributes ); - RemoteCacheRequest remoteCacheRequest = new RemoteCacheRequest(); + RemoteCacheRequest remoteCacheRequest = new RemoteCacheRequest(); remoteCacheRequest.setRequestType( RemoteCacheRequest.REQUEST_TYPE_REMOVE_ALL ); String cacheName = "myCache"; remoteCacheRequest.setCacheName( cacheName ); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java Sat Aug 4 14:23:36 2012 @@ -52,7 +52,7 @@ public class RemoteHttpCacheManagerUnitT // VEIFY assertNotNull( "Should have a cache.", result ); assertTrue( "Wrong default.", result instanceof RemoteHttpCacheClient ); - assertTrue( "Should be initialized", ((RemoteHttpCacheClient)result).isInitialized() ); + assertTrue( "Should be initialized", ((RemoteHttpCacheClient)result).isInitialized() ); } /** Verify that we get the default. */ Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java Sat Aug 4 14:23:36 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/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java Sat Aug 4 14:23:36 2012 @@ -36,7 +36,7 @@ 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(); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java Sat Aug 4 14:23:36 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/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java Sat Aug 4 14:23:36 2012 @@ -3,10 +3,10 @@ package org.apache.jcs.auxiliary.remote. import java.rmi.server.RMISocketFactory; import java.util.Properties; -import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheConstants; - import junit.framework.TestCase; +import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheConstants; + /** Unit tests for the factory */ public class RemoteCacheServerFactoryUnitTest extends TestCase Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerStartupUtil.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerStartupUtil.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerStartupUtil.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerStartupUtil.java Sat Aug 4 14:23:36 2012 @@ -20,6 +20,7 @@ package org.apache.jcs.auxiliary.remote. */ import java.io.IOException; +import java.io.Serializable; import java.net.InetAddress; import java.net.UnknownHostException; import java.rmi.RemoteException; @@ -49,7 +50,7 @@ public class RemoteCacheServerStartupUti * @param propsFileName * @return RemoteCacheServer */ - public static RemoteCacheServer startServerUsingProperties( String propsFileName ) + public static RemoteCacheServer startServerUsingProperties( String propsFileName ) { // TODO load from props file or get as init param or get from jndi, or // all three Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java Sat Aug 4 14:23:36 2012 @@ -103,7 +103,9 @@ public class CompositeCacheDiskUsageUnit MockAuxCache mock = new MockAuxCache(); mock.cacheType = AuxiliaryCache.DISK_CACHE; - cache.setAuxCaches( new AuxiliaryCache[] { mock } ); + @SuppressWarnings("unchecked") + AuxiliaryCache[] auxArray = new AuxiliaryCache[] { mock }; + cache.setAuxCaches( auxArray ); ICacheElement inputElement = new CacheElement( "testSpoolAllowed", "key", "value" ); @@ -132,7 +134,9 @@ public class CompositeCacheDiskUsageUnit MockAuxCache mock = new MockAuxCache(); mock.cacheType = AuxiliaryCache.DISK_CACHE; - cache.setAuxCaches( new AuxiliaryCache[] { mock } ); + @SuppressWarnings("unchecked") + AuxiliaryCache[] auxArray = new AuxiliaryCache[] { mock }; + cache.setAuxCaches( auxArray ); ICacheElement inputElement = new CacheElement( "testSpoolAllowed", "key", "value" ); @@ -165,7 +169,9 @@ public class CompositeCacheDiskUsageUnit MockAuxCache mock = new MockAuxCache(); mock.cacheType = AuxiliaryCache.DISK_CACHE; - cache.setAuxCaches( new AuxiliaryCache[] { mock } ); + @SuppressWarnings("unchecked") + AuxiliaryCache[] auxArray = new AuxiliaryCache[] { mock }; + cache.setAuxCaches( auxArray ); ICacheElement inputElement = new CacheElement( "testSpoolAllowed", "key", "value" ); @@ -200,7 +206,9 @@ public class CompositeCacheDiskUsageUnit MockAuxCache mock = new MockAuxCache(); mock.cacheType = AuxiliaryCache.DISK_CACHE; - cache.setAuxCaches( new AuxiliaryCache[] { mock } ); + @SuppressWarnings("unchecked") + AuxiliaryCache[] auxArray = new AuxiliaryCache[] { mock }; + cache.setAuxCaches( auxArray ); ICacheElement inputElement = new CacheElement( "testSpoolAllowed", "key", "value" ); @@ -235,7 +243,9 @@ public class CompositeCacheDiskUsageUnit MockAuxCache mock = new MockAuxCache(); mock.cacheType = AuxiliaryCache.DISK_CACHE; - cache.setAuxCaches( new AuxiliaryCache[] { mock } ); + @SuppressWarnings("unchecked") + AuxiliaryCache[] auxArray = new AuxiliaryCache[] { mock }; + cache.setAuxCaches( auxArray ); ICacheElement inputElement = new CacheElement( "testSpoolAllowed", "key", "value" ); @@ -271,7 +281,9 @@ public class CompositeCacheDiskUsageUnit MockAuxCache mockLateral = new MockAuxCache(); mockLateral.cacheType = AuxiliaryCache.LATERAL_CACHE; - cache.setAuxCaches( new AuxiliaryCache[] { mock, mockLateral } ); + @SuppressWarnings("unchecked") + AuxiliaryCache[] auxArray = new AuxiliaryCache[] { mock, mockLateral }; + cache.setAuxCaches( auxArray ); ICacheElement inputElement = new CacheElement( "testSpoolAllowed", "key", "value" ); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/CompositeCacheUnitTest.java Sat Aug 4 14:23:36 2012 @@ -64,6 +64,7 @@ public class CompositeCacheUnitTest MockAuxiliaryCache diskMock = new MockAuxiliaryCache(); diskMock.cacheType = ICache.DISK_CACHE; + @SuppressWarnings("unchecked") AuxiliaryCache[] aux = new AuxiliaryCache[] { diskMock }; cache.setAuxCaches( aux ); @@ -103,6 +104,7 @@ public class CompositeCacheUnitTest MockAuxiliaryCache diskMock = new MockAuxiliaryCache(); diskMock.cacheType = ICache.REMOTE_CACHE; + @SuppressWarnings("unchecked") AuxiliaryCache[] aux = new AuxiliaryCache[] { diskMock }; cache.setAuxCaches( aux ); @@ -145,6 +147,7 @@ public class CompositeCacheUnitTest MockAuxiliaryCache diskMock = new MockAuxiliaryCache(); diskMock.cacheType = ICache.DISK_CACHE; + @SuppressWarnings("unchecked") AuxiliaryCache[] aux = new AuxiliaryCache[] { diskMock }; cache.setAuxCaches( aux ); @@ -195,6 +198,7 @@ public class CompositeCacheUnitTest MockAuxiliaryCache diskMock = new MockAuxiliaryCache(); diskMock.cacheType = ICache.DISK_CACHE; + @SuppressWarnings("unchecked") AuxiliaryCache[] aux = new AuxiliaryCache[] { diskMock }; cache.setAuxCaches( aux ); @@ -227,6 +231,7 @@ public class CompositeCacheUnitTest MockAuxiliaryCache diskMock = new MockAuxiliaryCache(); diskMock.cacheType = ICache.REMOTE_CACHE; + @SuppressWarnings("unchecked") AuxiliaryCache[] aux = new AuxiliaryCache[] { diskMock }; cache.setAuxCaches( aux ); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/MockCompositeCacheManager.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/MockCompositeCacheManager.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/MockCompositeCacheManager.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/control/MockCompositeCacheManager.java Sat Aug 4 14:23:36 2012 @@ -27,11 +27,11 @@ import org.apache.jcs.engine.ElementAttr import org.apache.jcs.engine.behavior.ICompositeCacheManager; /** For testing. */ -public class MockCompositeCacheManager +public class MockCompositeCacheManager implements ICompositeCacheManager { /** The cache that was returned. */ - private CompositeCache cache; + private CompositeCache cache; /** Properties with which this manager was configured. This is exposed for other managers. */ private Properties configurationProperties; @@ -40,7 +40,8 @@ public class MockCompositeCacheManager getCache( String cacheName ) + @SuppressWarnings("unchecked") + public CompositeCache getCache( String cacheName ) { if ( cache == null ) { @@ -49,13 +50,14 @@ public class MockCompositeCacheManager)cache; } /** * @param cache The cache to set. */ - public void setCache( CompositeCache cache ) + public void setCache( CompositeCache cache ) { this.cache = cache; } @@ -63,7 +65,7 @@ public class MockCompositeCacheManager getCache() + public CompositeCache getCache() { return cache; } Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java Sat Aug 4 14:23:36 2012 @@ -31,16 +31,16 @@ public class ThreadSafeSimpleDateFormatU private static final int NUM_THREADS = 50; /** random number generator */ - private static final Random random = new Random(); + protected static final Random random = new Random(); /** number wrong */ - private int numWrong = 0; + protected int numWrong = 0; /** number of loops? */ - private int numLoops = 0; + protected int numLoops = 0; /** run? */ - private boolean run = false; + protected boolean run = false; /** a simpledateformat instance */ private SimpleDateFormat simpleDateFormat = new SimpleDateFormat( DATE_FORMAT_STRING ); @@ -49,7 +49,7 @@ public class ThreadSafeSimpleDateFormatU private ThreadSafeSimpleDateFormat threadSafeSimpleDateFormat = new ThreadSafeSimpleDateFormat( DATE_FORMAT_STRING ); /** date format */ - private DateFormat dateFormat; + protected DateFormat dateFormat; /** * Tests to make sure that format produces the same string on the thread-safe implementation as Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java Sat Aug 4 14:23:36 2012 @@ -144,6 +144,7 @@ public class JCSvsCommonsLRUMapPerforman // ///////////////////////////////////////////////////////////// cache2Name = "Commons "; // or LRUMapJCS + @SuppressWarnings("unchecked") Map cache2 = new org.apache.commons.collections.map.LRUMap( tries ); // cache2Name = "Hashtable"; // Hashtable cache2 = new Hashtable(); Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapPerformanceTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapPerformanceTest.java?rev=1369332&r1=1369331&r2=1369332&view=diff ============================================================================== --- commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapPerformanceTest.java (original) +++ commons/proper/jcs/trunk/src/test/org/apache/jcs/utils/struct/LRUMapPerformanceTest.java Sat Aug 4 14:23:36 2012 @@ -137,6 +137,7 @@ public class LRUMapPerformanceTest /////////////////////////////////////////////////////////////// cache2Name = "LRUMapJCS (commons)"; //or LRUMapJCS + @SuppressWarnings("unchecked") Map cache2 = new org.apache.commons.collections.map.LRUMap( tries ); //cache2Name = "Hashtable"; //Hashtable cache2 = new Hashtable();