commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1344374 [12/14] - in /commons/proper/jcs/trunk: ./ auxiliary-builds/javagroups/src/java/org/apache/jcs/auxiliary/javagroups/ auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/javagroups/ auxiliary-builds/jdk14/src/java/org/apache/jc...
Date Wed, 30 May 2012 18:14:51 GMT
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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -49,23 +49,23 @@ public class RemoteCacheUnitTest
         // SETUP
         long listenerId = 123;
         IRemoteCacheAttributes cattr = new RemoteCacheAttributes();
-        MockRemoteCacheService service = new MockRemoteCacheService();
-        MockRemoteCacheListener listener = new MockRemoteCacheListener();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
+        MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
         listener.setListenerId( listenerId );
 
-        RemoteCache remoteCache = new RemoteCache( cattr, service, listener );
+        RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener );
 
         String cacheName = "testUpdate";
 
         // DO WORK
-        ICacheElement element = new CacheElement( cacheName, "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
         remoteCache.update( element );
 
         // VERIFY
-        assertTrue( "The element should be in the serialized warapper.",
+        assertTrue( "The element should be in the serialized wrapper.",
                     service.lastUpdate instanceof ICacheElementSerialized );
-        ICacheElement result = SerializationConversionUtil
-            .getDeSerializedCacheElement( (ICacheElementSerialized) service.lastUpdate, remoteCache
+        ICacheElement<String, String> result = SerializationConversionUtil
+            .getDeSerializedCacheElement( (ICacheElementSerialized<String, String>) service.lastUpdate, remoteCache
                 .getElementSerializer() );
         assertEquals( "Wrong element updated.", element.getVal(), result.getVal() );
         assertEquals( "Wrong listener id.", Long.valueOf( listenerId ), service.updateRequestIdList.get( 0 ) );
@@ -81,26 +81,26 @@ public class RemoteCacheUnitTest
     {
         // SETUP
         IRemoteCacheAttributes cattr = new RemoteCacheAttributes();
-        ZombieRemoteCacheService zombie = new ZombieRemoteCacheService( 10 );
-        MockRemoteCacheService service = new MockRemoteCacheService();
-        MockRemoteCacheListener listener = new MockRemoteCacheListener();
+        ZombieRemoteCacheService<String, String> zombie = new ZombieRemoteCacheService<String, String>( 10 );
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
+        MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
 
-        // set the zombir
-        RemoteCache remoteCache = new RemoteCache( cattr, zombie, listener );
+        // set the zombie
+        RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, zombie, listener );
 
         String cacheName = "testUpdate";
 
         // DO WORK
-        ICacheElement element = new CacheElement( cacheName, "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
         remoteCache.update( element );
-        // set the new service, this should call propogate
+        // set the new service, this should call propagate
         remoteCache.fixCache( service );
 
         // VERIFY
         assertTrue( "The element should be in the serialized warapper.",
                     service.lastUpdate instanceof ICacheElementSerialized );
-        ICacheElement result = SerializationConversionUtil
-            .getDeSerializedCacheElement( (ICacheElementSerialized) service.lastUpdate, remoteCache
+        ICacheElement<String, String> result = SerializationConversionUtil
+            .getDeSerializedCacheElement( (ICacheElementSerialized<String, String>) service.lastUpdate, remoteCache
                 .getElementSerializer() );
         assertEquals( "Wrong element updated.", element.getVal(), result.getVal() );
     }
@@ -115,15 +115,15 @@ public class RemoteCacheUnitTest
     {
         // SETUP
         IRemoteCacheAttributes cattr = new RemoteCacheAttributes();
-        MockRemoteCacheService service = new MockRemoteCacheService();
-        MockRemoteCacheListener listener = new MockRemoteCacheListener();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
+        MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
 
-        RemoteCache remoteCache = new RemoteCache( cattr, service, listener );
+        RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         remoteCache.setCacheEventLogger( cacheEventLogger );
 
-        ICacheElement item = new CacheElement( "region", "key", "value" );
+        ICacheElement<String, String> item = new CacheElement<String, String>( "region", "key", "value" );
 
         // DO WORK
         remoteCache.update( item );
@@ -143,10 +143,10 @@ public class RemoteCacheUnitTest
     {
         // SETUP
         IRemoteCacheAttributes cattr = new RemoteCacheAttributes();
-        MockRemoteCacheService service = new MockRemoteCacheService();
-        MockRemoteCacheListener listener = new MockRemoteCacheListener();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
+        MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
 
-        RemoteCache remoteCache = new RemoteCache( cattr, service, listener );
+        RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         remoteCache.setCacheEventLogger( cacheEventLogger );
@@ -169,16 +169,16 @@ public class RemoteCacheUnitTest
     {
         // SETUP
         IRemoteCacheAttributes cattr = new RemoteCacheAttributes();
-        MockRemoteCacheService service = new MockRemoteCacheService();
-        MockRemoteCacheListener listener = new MockRemoteCacheListener();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
+        MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
 
-        RemoteCache remoteCache = new RemoteCache( cattr, service, listener );
+        RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         remoteCache.setCacheEventLogger( cacheEventLogger );
 
         // DO WORK
-        remoteCache.getMultiple( new HashSet() );
+        remoteCache.getMultiple( new HashSet<String>() );
 
         // VERIFY
         assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls );
@@ -195,10 +195,10 @@ public class RemoteCacheUnitTest
     {
         // SETUP
         IRemoteCacheAttributes cattr = new RemoteCacheAttributes();
-        MockRemoteCacheService service = new MockRemoteCacheService();
-        MockRemoteCacheListener listener = new MockRemoteCacheListener();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
+        MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
 
-        RemoteCache remoteCache = new RemoteCache( cattr, service, listener );
+        RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         remoteCache.setCacheEventLogger( cacheEventLogger );
@@ -221,10 +221,10 @@ public class RemoteCacheUnitTest
     {
         // SETUP
         IRemoteCacheAttributes cattr = new RemoteCacheAttributes();
-        MockRemoteCacheService service = new MockRemoteCacheService();
-        MockRemoteCacheListener listener = new MockRemoteCacheListener();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
+        MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
 
-        RemoteCache remoteCache = new RemoteCache( cattr, service, listener );
+        RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         remoteCache.setCacheEventLogger( cacheEventLogger );
@@ -236,7 +236,7 @@ public class RemoteCacheUnitTest
         assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls );
         assertEquals( "End should have been called.", 1, cacheEventLogger.endICacheEventCalls );
     }
-    
+
     /**
      * Verify event log calls.
      * <p>
@@ -248,23 +248,23 @@ public class RemoteCacheUnitTest
         // SETUP
         String pattern = "adsfasdfasd.?";
         IRemoteCacheAttributes cattr = new RemoteCacheAttributes();
-        MockRemoteCacheService service = new MockRemoteCacheService();
-        MockRemoteCacheListener listener = new MockRemoteCacheListener();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
+        MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
 
-        RemoteCache remoteCache = new RemoteCache( cattr, service, listener );
+        RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         remoteCache.setCacheEventLogger( cacheEventLogger );
 
         // DO WORK
-        Map result = remoteCache.getMatching( pattern );
+        Map<String, ICacheElement<String, String>> result = remoteCache.getMatching( pattern );
 
         // VERIFY
         assertNotNull( "Should have a map", result );
         assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls );
         assertEquals( "End should have been called.", 1, cacheEventLogger.endICacheEventCalls );
     }
-    
+
     /**
      * Verify event log calls.
      * <p>
@@ -275,10 +275,10 @@ public class RemoteCacheUnitTest
     {
         // SETUP
         IRemoteCacheAttributes cattr = new RemoteCacheAttributes();
-        MockRemoteCacheService service = new MockRemoteCacheService();
-        MockRemoteCacheListener listener = new MockRemoteCacheListener();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
+        MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
 
-        RemoteCache remoteCache = new RemoteCache( cattr, service, listener );
+        RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         remoteCache.setCacheEventLogger( cacheEventLogger );
@@ -290,7 +290,7 @@ public class RemoteCacheUnitTest
         assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls );
         assertEquals( "End should have been called.", 1, cacheEventLogger.endICacheEventCalls );
     }
-    
+
     /**
      * Verify that there is no problem if there is no listener.
      * <p>
@@ -301,10 +301,10 @@ public class RemoteCacheUnitTest
     {
         // SETUP
         IRemoteCacheAttributes cattr = new RemoteCacheAttributes();
-        MockRemoteCacheService service = new MockRemoteCacheService();
-        MockRemoteCacheListener listener = null;
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
+        MockRemoteCacheListener<String, String> listener = null;
 
-        RemoteCache remoteCache = new RemoteCache( cattr, service, listener );
+        RemoteCache<String, String> remoteCache = new RemoteCache<String, String>( cattr, service, listener );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         remoteCache.setCacheEventLogger( cacheEventLogger );

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -79,7 +79,7 @@ public class TestRemoteCache
         log.info( "testSimpleSend" );
         System.out.println( "testSimpleSend" );
 
-        JCS cache = JCS.getInstance( "testCache" );
+        JCS<String, String> cache = JCS.getInstance( "testCache" );
 
         log.info( "cache = " + cache );
 
@@ -101,20 +101,20 @@ public class TestRemoteCache
 
         Thread.sleep( 100 );
 
-        ICompositeCacheManager cacheMgr = new MockCompositeCacheManager();
+        ICompositeCacheManager cacheMgr = new MockCompositeCacheManager<String, String>();
 
         RemoteCacheAttributes rca = new RemoteCacheAttributes();
         rca.setRemoteHost( "localhost" );
         rca.setRemotePort( 1101 );
 
         RemoteCacheManager mgr = RemoteCacheManager.getInstance( rca, cacheMgr, new MockCacheEventLogger(), new MockElementSerializer() );
-        AuxiliaryCache cache = mgr.getCache( "testCache" );
+        AuxiliaryCache<String, String> cache = mgr.getCache( "testCache" );
 
         int numMes = 100;
         for ( int i = 0; i < numMes; i++ )
         {
             String message = "adsfasasfasfasdasf";
-            CacheElement ce = new CacheElement( "key" + 1, "data" + i, message );
+            CacheElement<String, String> ce = new CacheElement<String, String>( "key" + 1, "data" + i, message );
             cache.update( ce );
             System.out.println( "put " + ce );
         }

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -39,14 +39,14 @@ public class ZombieRemoteCacheServiceUni
         throws Exception
     {
         // SETUP
-        MockRemoteCacheService service = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
 
-        ZombieRemoteCacheService zombie = new ZombieRemoteCacheService( 10 );
+        ZombieRemoteCacheService<String, String> zombie = new ZombieRemoteCacheService<String, String>( 10 );
 
         String cacheName = "testUpdate";
 
         // DO WORK
-        ICacheElement element = new CacheElement( cacheName, "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
         zombie.update( element, 123l );
         zombie.propagateEvents( service );
 
@@ -63,14 +63,14 @@ public class ZombieRemoteCacheServiceUni
         throws Exception
     {
         // SETUP
-        MockRemoteCacheService service = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
 
-        ZombieRemoteCacheService zombie = new ZombieRemoteCacheService( 0 );
+        ZombieRemoteCacheService<String, String> zombie = new ZombieRemoteCacheService<String, String>( 0 );
 
         String cacheName = "testUpdate";
 
         // DO WORK
-        ICacheElement element = new CacheElement( cacheName, "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
         zombie.update( element, 123l );
         zombie.propagateEvents( service );
 
@@ -87,9 +87,9 @@ public class ZombieRemoteCacheServiceUni
         throws Exception
     {
         // SETUP
-        MockRemoteCacheService service = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
 
-        ZombieRemoteCacheService zombie = new ZombieRemoteCacheService( 10 );
+        ZombieRemoteCacheService<String, String> zombie = new ZombieRemoteCacheService<String, String>( 10 );
 
         String cacheName = "testRemoveThenWalk";
         String key = "myKey";
@@ -111,9 +111,9 @@ public class ZombieRemoteCacheServiceUni
         throws Exception
     {
         // SETUP
-        MockRemoteCacheService service = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
 
-        ZombieRemoteCacheService zombie = new ZombieRemoteCacheService( 10 );
+        ZombieRemoteCacheService<String, String> zombie = new ZombieRemoteCacheService<String, String>( 10 );
 
         String cacheName = "testRemoveThenWalk";
 

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java Wed May 30 18:14:43 2012
@@ -45,7 +45,7 @@ public class RemoteHttpCacheClientUnitTe
     {
         // SETUP
         RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes();
-        RemoteHttpCacheClient client = new RemoteHttpCacheClient( attributes );
+        RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes );
 
         MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher();
         client.setRemoteDispatcher( mockDispatcher );
@@ -56,7 +56,7 @@ public class RemoteHttpCacheClientUnitTe
         mockDispatcher.setupRemoteCacheResponse = null;
 
         // DO WORK
-        ICacheElement result = client.get( cacheName, key );
+        ICacheElement<String, String> result = client.get( cacheName, key );
 
         // VERIFY
         assertNull( "Wrong result.", result );
@@ -74,7 +74,7 @@ public class RemoteHttpCacheClientUnitTe
     {
         // SETUP
         RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes();
-        RemoteHttpCacheClient client = new RemoteHttpCacheClient( attributes );
+        RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes );
 
         MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher();
         client.setRemoteDispatcher( mockDispatcher );
@@ -82,14 +82,14 @@ public class RemoteHttpCacheClientUnitTe
         String cacheName = "test";
         String key = "key";
 
-        ICacheElement expected = new CacheElement( cacheName, key, "value" );
-        RemoteCacheResponse remoteHttpCacheResponse = new RemoteCacheResponse();
+        ICacheElement<String, String> expected = new CacheElement<String, String>( cacheName, key, "value" );
+        RemoteCacheResponse<String, String> remoteHttpCacheResponse = new RemoteCacheResponse<String, String>();
         remoteHttpCacheResponse.getPayload().put( key, expected );
 
         mockDispatcher.setupRemoteCacheResponse = remoteHttpCacheResponse;
 
         // DO WORK
-        ICacheElement result = client.get( cacheName, key );
+        ICacheElement<String, String> result = client.get( cacheName, key );
 
         // VERIFY
         assertEquals( "Wrong result.", expected, result );
@@ -107,7 +107,7 @@ public class RemoteHttpCacheClientUnitTe
     {
         // SETUP
         RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes();
-        RemoteHttpCacheClient client = new RemoteHttpCacheClient( attributes );
+        RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes );
 
         MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher();
         client.setRemoteDispatcher( mockDispatcher );
@@ -115,14 +115,14 @@ public class RemoteHttpCacheClientUnitTe
         String cacheName = "test";
         String pattern = "key";
 
-        ICacheElement expected = new CacheElement( cacheName, "key", "value" );
-        RemoteCacheResponse remoteHttpCacheResponse = new RemoteCacheResponse();
+        ICacheElement<String, String> expected = new CacheElement<String, String>( cacheName, "key", "value" );
+        RemoteCacheResponse<String, String> remoteHttpCacheResponse = new RemoteCacheResponse<String, String>();
         remoteHttpCacheResponse.getPayload().put( "key", expected );
 
         mockDispatcher.setupRemoteCacheResponse = remoteHttpCacheResponse;
 
         // DO WORK
-        Map result = client.getMatching( cacheName, pattern );
+        Map<String, ICacheElement<String, String>> result = client.getMatching( cacheName, pattern );
 
         // VERIFY
         assertEquals( "Wrong result.", expected, result.get( "key" ) );
@@ -140,22 +140,22 @@ public class RemoteHttpCacheClientUnitTe
     {
         // SETUP
         RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes();
-        RemoteHttpCacheClient client = new RemoteHttpCacheClient( attributes );
+        RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes );
 
         MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher();
         client.setRemoteDispatcher( mockDispatcher );
 
         String cacheName = "test";
-        Set keys = Collections.EMPTY_SET;
+        Set<String> keys = Collections.emptySet();
 
-        ICacheElement expected = new CacheElement( cacheName, "key", "value" );
-        RemoteCacheResponse remoteHttpCacheResponse = new RemoteCacheResponse();
+        ICacheElement<String, String> expected = new CacheElement<String, String>( cacheName, "key", "value" );
+        RemoteCacheResponse<String, String> remoteHttpCacheResponse = new RemoteCacheResponse<String, String>();
         remoteHttpCacheResponse.getPayload().put( "key", expected );
 
         mockDispatcher.setupRemoteCacheResponse = remoteHttpCacheResponse;
 
         // DO WORK
-        Map result = client.getMultiple( cacheName, keys );
+        Map<String, ICacheElement<String, String>> result = client.getMultiple( cacheName, keys );
 
         // VERIFY
         assertEquals( "Wrong result.", expected, result.get( "key" ) );
@@ -173,7 +173,7 @@ public class RemoteHttpCacheClientUnitTe
     {
         // SETUP
         RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes();
-        RemoteHttpCacheClient client = new RemoteHttpCacheClient( attributes );
+        RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes );
 
         MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher();
         client.setRemoteDispatcher( mockDispatcher );
@@ -199,7 +199,7 @@ public class RemoteHttpCacheClientUnitTe
     {
         // SETUP
         RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes();
-        RemoteHttpCacheClient client = new RemoteHttpCacheClient( attributes );
+        RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes );
 
         MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher();
         client.setRemoteDispatcher( mockDispatcher );
@@ -224,14 +224,14 @@ public class RemoteHttpCacheClientUnitTe
     {
         // SETUP
         RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes();
-        RemoteHttpCacheClient client = new RemoteHttpCacheClient( attributes );
+        RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes );
 
         MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher();
         client.setRemoteDispatcher( mockDispatcher );
 
         String cacheName = "test";
 
-        ICacheElement element = new CacheElement( cacheName, "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
 
         // DO WORK
         client.update( element );
@@ -251,7 +251,7 @@ public class RemoteHttpCacheClientUnitTe
     {
         // SETUP
         RemoteHttpCacheAttributes attributes = new RemoteHttpCacheAttributes();
-        RemoteHttpCacheClient client = new RemoteHttpCacheClient( attributes );
+        RemoteHttpCacheClient<String, String> client = new RemoteHttpCacheClient<String, String>( attributes );
 
         MockRemoteCacheDispatcher mockDispatcher = new MockRemoteCacheDispatcher();
         client.setRemoteDispatcher( mockDispatcher );

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -47,14 +47,14 @@ public class RemoteHttpCacheManagerUnitT
                                                                              elementSerializer );
 
         // DO WORK
-        IRemoteHttpCacheClient result = manager.createRemoteHttpCacheClientForAttributes( cattr );
+        IRemoteHttpCacheClient<String, String> result = manager.createRemoteHttpCacheClientForAttributes( cattr );
 
         // VEIFY
         assertNotNull( "Should have a cache.", result );
         assertTrue( "Wrong default.", result instanceof RemoteHttpCacheClient );
         assertTrue( "Should be initialized", ((RemoteHttpCacheClient)result).isInitialized() );
     }
-    
+
     /** Verify that we get the default. */
     public void testCreateRemoteHttpCacheClient_deafult()
     {
@@ -69,13 +69,13 @@ public class RemoteHttpCacheManagerUnitT
                                                                              elementSerializer );
 
         // DO WORK
-        IRemoteHttpCacheClient result = manager.createRemoteHttpCacheClientForAttributes( cattr );
+        IRemoteHttpCacheClient<String, String> result = manager.createRemoteHttpCacheClientForAttributes( cattr );
 
         // VEIFY
         assertNotNull( "Should have a cache.", result );
         assertTrue( "Wrong default.", result instanceof RemoteHttpCacheClient );
     }
-    
+
     /** Verify that we get a cache no wait. */
     public void testGetCache_normal()
     {
@@ -90,7 +90,7 @@ public class RemoteHttpCacheManagerUnitT
                                                                              elementSerializer );
 
         // DO WORK
-        AuxiliaryCache result = manager.getCache( cattr );
+        AuxiliaryCache<String, String> result = manager.getCache( cattr );
 
         // VEIFY
         assertNotNull( "Should have a cache.", result );

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java Wed May 30 18:14:43 2012
@@ -45,7 +45,7 @@ public class RemoteHttpCacheManualTester
     public void testSimpleLoad()
         throws Exception
     {
-        JCS jcs = JCS.getInstance( "testCache1" );
+        JCS<String, String> jcs = JCS.getInstance( "testCache1" );
 
         jcs.put( "TestKey", "TestValue" );
 

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptorUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptorUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptorUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptorUnitTest.java Wed May 30 18:14:43 2012
@@ -19,7 +19,6 @@ package org.apache.jcs.auxiliary.remote.
  * under the License.
  */
 
-import java.io.Serializable;
 import java.util.Collections;
 import java.util.Set;
 
@@ -39,38 +38,38 @@ public class RemoteCacheServiceAdaptorUn
     public void testProcessRequest_null()
     {
         // SETUP
-        RemoteCacheServiceAdaptor adaptor = new RemoteCacheServiceAdaptor();
+        RemoteCacheServiceAdaptor<String, String> adaptor = new RemoteCacheServiceAdaptor<String, String>();
 
-        MockRemoteCacheService remoteHttpCacheService = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> remoteHttpCacheService = new MockRemoteCacheService<String, String>();
         adaptor.setRemoteCacheService( remoteHttpCacheService );
 
-        RemoteCacheRequest request = null;
+        RemoteCacheRequest<String, String> request = null;
 
         // DO WORK
-        RemoteCacheResponse result = adaptor.processRequest( request );
+        RemoteCacheResponse<String, String> result = adaptor.processRequest( request );
 
         // VERIFY
         assertNotNull( "Should have a result.", result );
         assertTrue( "Should have 'The request is null' in the errorMessage", result.getErrorMessage().indexOf( "The request is null" ) != -1 );
         assertTrue( "Should have 'The request is null' in the toString", result.toString().indexOf( "The request is null" ) != -1 );
     }
-    
+
     /** Verify that the service is called. */
     public void testProcessRequest_Get()
     {
         // SETUP
-        RemoteCacheServiceAdaptor adaptor = new RemoteCacheServiceAdaptor();
+        RemoteCacheServiceAdaptor<String, String> adaptor = new RemoteCacheServiceAdaptor<String, String>();
 
-        MockRemoteCacheService remoteHttpCacheService = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> remoteHttpCacheService = new MockRemoteCacheService<String, String>();
         adaptor.setRemoteCacheService( remoteHttpCacheService );
 
         String cacheName = "test";
-        Serializable key = "key";
+        String key = "key";
         long requesterId = 2;
-        RemoteCacheRequest request = RemoteCacheRequestFactory.createGetRequest( cacheName, key, requesterId );
+        RemoteCacheRequest<String, String> request = RemoteCacheRequestFactory.createGetRequest( cacheName, key, requesterId );
 
         // DO WORK
-        RemoteCacheResponse result = adaptor.processRequest( request );
+        RemoteCacheResponse<String, String> result = adaptor.processRequest( request );
 
         // VERIFY
         assertNotNull( "Should have a result.", result );
@@ -81,19 +80,19 @@ public class RemoteCacheServiceAdaptorUn
     public void testProcessRequest_GetMatching()
     {
         // SETUP
-        RemoteCacheServiceAdaptor adaptor = new RemoteCacheServiceAdaptor();
+        RemoteCacheServiceAdaptor<String, String> adaptor = new RemoteCacheServiceAdaptor<String, String>();
 
-        MockRemoteCacheService remoteHttpCacheService = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> remoteHttpCacheService = new MockRemoteCacheService<String, String>();
         adaptor.setRemoteCacheService( remoteHttpCacheService );
 
         String cacheName = "test";
         String pattern = "pattern";
         long requesterId = 2;
-        RemoteCacheRequest request = RemoteCacheRequestFactory.createGetMatchingRequest( cacheName, pattern,
+        RemoteCacheRequest<String, String> request = RemoteCacheRequestFactory.createGetMatchingRequest( cacheName, pattern,
                                                                                                   requesterId );
 
         // DO WORK
-        RemoteCacheResponse result = adaptor.processRequest( request );
+        RemoteCacheResponse<String, String> result = adaptor.processRequest( request );
 
         // VERIFY
         assertNotNull( "Should have a result.", result );
@@ -104,19 +103,19 @@ public class RemoteCacheServiceAdaptorUn
     public void testProcessRequest_GetMultiple()
     {
         // SETUP
-        RemoteCacheServiceAdaptor adaptor = new RemoteCacheServiceAdaptor();
+        RemoteCacheServiceAdaptor<String, String> adaptor = new RemoteCacheServiceAdaptor<String, String>();
 
-        MockRemoteCacheService remoteHttpCacheService = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> remoteHttpCacheService = new MockRemoteCacheService<String, String>();
         adaptor.setRemoteCacheService( remoteHttpCacheService );
 
         String cacheName = "test";
-        Set keys = Collections.EMPTY_SET;
+        Set<String> keys = Collections.emptySet();
         long requesterId = 2;
-        RemoteCacheRequest request = RemoteCacheRequestFactory.createGetMultipleRequest( cacheName, keys,
+        RemoteCacheRequest<String, String> request = RemoteCacheRequestFactory.createGetMultipleRequest( cacheName, keys,
                                                                                                   requesterId );
 
         // DO WORK
-        RemoteCacheResponse result = adaptor.processRequest( request );
+        RemoteCacheResponse<String, String> result = adaptor.processRequest( request );
 
         // VERIFY
         assertNotNull( "Should have a result.", result );
@@ -128,62 +127,62 @@ public class RemoteCacheServiceAdaptorUn
     public void testProcessRequest_Update()
     {
         // SETUP
-        RemoteCacheServiceAdaptor adaptor = new RemoteCacheServiceAdaptor();
+        RemoteCacheServiceAdaptor<String, String> adaptor = new RemoteCacheServiceAdaptor<String, String>();
 
-        MockRemoteCacheService remoteHttpCacheService = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> remoteHttpCacheService = new MockRemoteCacheService<String, String>();
         adaptor.setRemoteCacheService( remoteHttpCacheService );
 
         String cacheName = "test";
-        Serializable key = "key";
+        String key = "key";
         long requesterId = 2;
-        CacheElement element = new CacheElement( cacheName, key, null );
-        RemoteCacheRequest request = RemoteCacheRequestFactory.createUpdateRequest( element, requesterId );
+        CacheElement<String, String> element = new CacheElement<String, String>( cacheName, key, null );
+        RemoteCacheRequest<String, String> request = RemoteCacheRequestFactory.createUpdateRequest( element, requesterId );
 
         // DO WORK
-        RemoteCacheResponse result = adaptor.processRequest( request );
+        RemoteCacheResponse<String, String> result = adaptor.processRequest( request );
 
         // VERIFY
         assertNotNull( "Should have a result.", result );
         assertEquals( "Wrong object.", element, remoteHttpCacheService.lastUpdate );
     }
-    
+
     /** Verify that the service is called. */
     public void testProcessRequest_Remove()
     {
         // SETUP
-        RemoteCacheServiceAdaptor adaptor = new RemoteCacheServiceAdaptor();
+        RemoteCacheServiceAdaptor<String, String> adaptor = new RemoteCacheServiceAdaptor<String, String>();
 
-        MockRemoteCacheService remoteHttpCacheService = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> remoteHttpCacheService = new MockRemoteCacheService<String, String>();
         adaptor.setRemoteCacheService( remoteHttpCacheService );
 
         String cacheName = "test";
-        Serializable key = "key";
+        String key = "key";
         long requesterId = 2;
-        RemoteCacheRequest request = RemoteCacheRequestFactory.createRemoveRequest( cacheName, key, requesterId );
+        RemoteCacheRequest<String, String> request = RemoteCacheRequestFactory.createRemoveRequest( cacheName, key, requesterId );
 
         // DO WORK
-        RemoteCacheResponse result = adaptor.processRequest( request );
+        RemoteCacheResponse<String, String> result = adaptor.processRequest( request );
 
         // VERIFY
         assertNotNull( "Should have a result.", result );
         assertEquals( "Wrong key.", key, remoteHttpCacheService.lastRemoveKey );
     }
-    
+
     /** Verify that the service is called. */
     public void testProcessRequest_RemoveAll()
     {
         // SETUP
-        RemoteCacheServiceAdaptor adaptor = new RemoteCacheServiceAdaptor();
+        RemoteCacheServiceAdaptor<String, String> adaptor = new RemoteCacheServiceAdaptor<String, String>();
 
-        MockRemoteCacheService remoteHttpCacheService = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> remoteHttpCacheService = new MockRemoteCacheService<String, String>();
         adaptor.setRemoteCacheService( remoteHttpCacheService );
 
         String cacheName = "testRemoveALl";
         long requesterId = 2;
-        RemoteCacheRequest request = RemoteCacheRequestFactory.createRemoveAllRequest( cacheName, requesterId );
+        RemoteCacheRequest<String, String> request = RemoteCacheRequestFactory.createRemoveAllRequest( cacheName, requesterId );
 
         // DO WORK
-        RemoteCacheResponse result = adaptor.processRequest( request );
+        RemoteCacheResponse<String, String> result = adaptor.processRequest( request );
 
         // VERIFY
         assertNotNull( "Should have a result.", result );

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -19,7 +19,6 @@ package org.apache.jcs.auxiliary.remote.
  * under the License.
  */
 
-import java.io.Serializable;
 import java.util.HashSet;
 
 import junit.framework.TestCase;
@@ -41,17 +40,18 @@ public class RemoteHttpCacheServiceUnitT
         throws Exception
     {
         // SETUP
-        MockCompositeCacheManager manager = new  MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> manager = new MockCompositeCacheManager<String, String>();
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
-        
+
         RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes();
-        RemoteHttpCacheService server = new RemoteHttpCacheService( manager, rcsa, cacheEventLogger );
+        RemoteHttpCacheService<String, String> server =
+            new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger );
 
         String cacheName = "test";
-        Serializable key = "key";
+        String key = "key";
         long requesterId = 2;
-        CacheElement element = new CacheElement( cacheName, key, null );
-        
+        CacheElement<String, String> element = new CacheElement<String, String>( cacheName, key, null );
+
         // DO WORK
         server.update( element, requesterId );
 
@@ -59,7 +59,7 @@ public class RemoteHttpCacheServiceUnitT
         assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls );
         assertEquals( "End should have been called.", 1, cacheEventLogger.endICacheEventCalls );
     }
-    
+
     /**
      * Verify event log calls.
      * <p>
@@ -69,11 +69,12 @@ public class RemoteHttpCacheServiceUnitT
         throws Exception
     {
         // SETUP
-        MockCompositeCacheManager manager = new  MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> manager = new MockCompositeCacheManager<String, String>();
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
-        
+
         RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes();
-        RemoteHttpCacheService server = new RemoteHttpCacheService( manager, rcsa, cacheEventLogger );
+        RemoteHttpCacheService<String, String> server =
+            new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger );
 
         // DO WORK
         server.get( "region", "key" );
@@ -92,11 +93,12 @@ public class RemoteHttpCacheServiceUnitT
         throws Exception
     {
         // SETUP
-        MockCompositeCacheManager manager = new  MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> manager = new MockCompositeCacheManager<String, String>();
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
-        
+
         RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes();
-        RemoteHttpCacheService server = new RemoteHttpCacheService( manager, rcsa, cacheEventLogger );
+        RemoteHttpCacheService<String, String> server =
+            new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger );
 
         // DO WORK
         server.getMatching( "region", "pattern", 0 );
@@ -115,14 +117,15 @@ public class RemoteHttpCacheServiceUnitT
         throws Exception
     {
         // SETUP
-        MockCompositeCacheManager manager = new  MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> manager = new MockCompositeCacheManager<String, String>();
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
-        
+
         RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes();
-        RemoteHttpCacheService server = new RemoteHttpCacheService( manager, rcsa, cacheEventLogger );
+        RemoteHttpCacheService<String, String> server =
+            new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger );
 
         // DO WORK
-        server.getMultiple( "region", new HashSet() );
+        server.getMultiple( "region", new HashSet<String>() );
 
         // VERIFY
         assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls );
@@ -138,11 +141,12 @@ public class RemoteHttpCacheServiceUnitT
         throws Exception
     {
         // SETUP
-        MockCompositeCacheManager manager = new  MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> manager = new MockCompositeCacheManager<String, String>();
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
-        
+
         RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes();
-        RemoteHttpCacheService server = new RemoteHttpCacheService( manager, rcsa, cacheEventLogger );
+        RemoteHttpCacheService<String, String> server =
+            new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger );
 
         // DO WORK
         server.remove( "region", "key" );
@@ -161,11 +165,12 @@ public class RemoteHttpCacheServiceUnitT
         throws Exception
     {
         // SETUP
-        MockCompositeCacheManager manager = new  MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> manager = new MockCompositeCacheManager<String, String>();
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
-        
+
         RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes();
-        RemoteHttpCacheService server = new RemoteHttpCacheService( manager, rcsa, cacheEventLogger );
+        RemoteHttpCacheService<String, String> server =
+            new RemoteHttpCacheService<String, String>( manager, rcsa, cacheEventLogger );
 
         // DO WORK
         server.removeAll( "region" );

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -36,27 +36,27 @@ public class RemoteHttpCacheSeviceFactor
     public void testCreateRemoteHttpCacheService_WithLogger()
     {
         // SETUP
-        MockCompositeCacheManager manager = new  MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> manager = new  MockCompositeCacheManager<String, String>();
         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<String, String> 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/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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -23,8 +23,8 @@ import junit.framework.TestCase;
 
 import org.apache.jcs.auxiliary.AuxiliaryCache;
 import org.apache.jcs.auxiliary.MockCacheEventLogger;
-import org.apache.jcs.auxiliary.remote.RemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.MockRemoteCacheListener;
+import org.apache.jcs.auxiliary.remote.RemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.RemoteCacheManager;
 import org.apache.jcs.engine.CacheElement;
 import org.apache.jcs.engine.behavior.ICacheElement;
@@ -41,10 +41,10 @@ public class BasicRemoteCacheClientServe
     extends TestCase
 {
     /** Server instance to use in the tests. */
-    private RemoteCacheServer server = null;
-    
+    private RemoteCacheServer<String, String> server = null;
+
     /** the remote server port */
-    private int remotePort;
+    private final int remotePort;
 
     /**
      * Starts the server. This is not in a setup, since the server is slow to kill right now.
@@ -72,7 +72,7 @@ public class BasicRemoteCacheClientServe
         throws Exception
     {
         // SETUP
-        MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> compositeCacheManager = new MockCompositeCacheManager<String, String>();
 
         RemoteCacheAttributes attributes = new RemoteCacheAttributes();
         attributes.setRemoteHost( "localhost" );
@@ -81,11 +81,11 @@ public class BasicRemoteCacheClientServe
 
         RemoteCacheManager remoteCacheManager = RemoteCacheManager.getInstance( attributes, compositeCacheManager, new MockCacheEventLogger(), new MockElementSerializer() );
         String regionName = "testSinglePut";
-        AuxiliaryCache cache = remoteCacheManager.getCache( regionName );
+        AuxiliaryCache<String, String> cache = remoteCacheManager.getCache( regionName );
 
         // DO WORK
         int numPutsPrior = server.getPutCount();
-        ICacheElement element = new CacheElement( regionName, "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( regionName, "key", "value" );
         cache.update( element );
         SleepUtil.sleepAtLeast( 200 );
 
@@ -94,12 +94,12 @@ public class BasicRemoteCacheClientServe
         assertEquals( "Wrong number of puts", 1, server.getPutCount() - numPutsPrior );
 
         // DO WORK
-        ICacheElement result = cache.get( "key" );
+        ICacheElement<String, String> result = cache.get( "key" );
 
         // VERIFY
         assertEquals( "Wrong element.", element.getVal(), result.getVal() );
     }
-    
+
     /**
      * Verify that we can remove an item via the remote server.
      * <p>
@@ -109,7 +109,7 @@ public class BasicRemoteCacheClientServe
         throws Exception
     {
         // SETUP
-        MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> compositeCacheManager = new MockCompositeCacheManager<String, String>();
 
         RemoteCacheAttributes attributes = new RemoteCacheAttributes();
         attributes.setRemoteHost( "localhost" );
@@ -117,14 +117,14 @@ public class BasicRemoteCacheClientServe
         attributes.setRemotePort( remotePort );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
-        
+
         RemoteCacheManager remoteCacheManager = RemoteCacheManager.getInstance( attributes, compositeCacheManager, cacheEventLogger, null );
         String regionName = "testPutRemove";
-        AuxiliaryCache cache = remoteCacheManager.getCache( regionName );
+        AuxiliaryCache<String, String> cache = remoteCacheManager.getCache( regionName );
 
         // DO WORK
         int numPutsPrior = server.getPutCount();
-        ICacheElement element = new CacheElement( regionName, "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( regionName, "key", "value" );
         cache.update( element );
         SleepUtil.sleepAtLeast( 50 );
 
@@ -133,7 +133,7 @@ public class BasicRemoteCacheClientServe
         assertEquals( "Wrong number of puts", 1, server.getPutCount() - numPutsPrior );
 
         // DO WORK
-        ICacheElement result = cache.get( "key" );
+        ICacheElement<String, String> result = cache.get( "key" );
 
         // VERIFY
         assertEquals( "Wrong element.", element.getVal(), result.getVal() );
@@ -141,7 +141,7 @@ public class BasicRemoteCacheClientServe
         // DO WORK
         cache.remove( "key" );
         SleepUtil.sleepAtLeast( 200 );
-        ICacheElement resultAfterRemote = cache.get( "key" );
+        ICacheElement<String, String> resultAfterRemote = cache.get( "key" );
 
         // VERIFY
         assertNull( "Element resultAfterRemote should be null.", resultAfterRemote );
@@ -155,7 +155,7 @@ public class BasicRemoteCacheClientServe
         throws Exception
     {
         // SETUP
-        MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> compositeCacheManager = new MockCompositeCacheManager<String, String>();
 
         RemoteCacheAttributes attributes = new RemoteCacheAttributes();
         attributes.setRemoteHost( "localhost" );
@@ -164,14 +164,14 @@ public class BasicRemoteCacheClientServe
 
         RemoteCacheManager remoteCacheManager = RemoteCacheManager.getInstance( attributes, compositeCacheManager, new MockCacheEventLogger(), new MockElementSerializer() );
         String regionName = "testPutAndListen";
-        AuxiliaryCache cache = remoteCacheManager.getCache( regionName );
+        AuxiliaryCache<String, String> cache = remoteCacheManager.getCache( regionName );
 
-        MockRemoteCacheListener listener = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
         server.addCacheListener( regionName, listener );
 
         // DO WORK
         int numPutsPrior = server.getPutCount();
-        ICacheElement element = new CacheElement( regionName, "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( regionName, "key", "value" );
         cache.update( element );
         SleepUtil.sleepAtLeast( 50 );
 
@@ -197,7 +197,7 @@ public class BasicRemoteCacheClientServe
         throws Exception
     {
         // SETUP
-        MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> compositeCacheManager = new MockCompositeCacheManager<String, String>();
 
         RemoteCacheAttributes attributes = new RemoteCacheAttributes();
         attributes.setRemoteHost( "localhost" );
@@ -206,9 +206,9 @@ public class BasicRemoteCacheClientServe
 
         RemoteCacheManager remoteCacheManager = RemoteCacheManager.getInstance( attributes, compositeCacheManager, new MockCacheEventLogger(), new MockElementSerializer() );
         String regionName = "testPutAndListen";
-        AuxiliaryCache cache = remoteCacheManager.getCache( regionName );
+        AuxiliaryCache<String, String> cache = remoteCacheManager.getCache( regionName );
 
-        MockRemoteCacheListener listener = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
         server.addCacheListener( regionName, listener );
 
         // DO WORK
@@ -216,7 +216,7 @@ public class BasicRemoteCacheClientServe
         int numToPut = 100;
         for ( int i = 0; i < numToPut; i++ )
         {
-            ICacheElement element = new CacheElement( regionName, "key" + 1, "value" + i );
+            ICacheElement<String, String> element = new CacheElement<String, String>( regionName, "key" + 1, "value" + i );
             cache.update( element );
         }
         SleepUtil.sleepAtLeast( 500 );

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java Wed May 30 18:14:43 2012
@@ -57,12 +57,12 @@ public class RemoteCacheServerUnitTest
 
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
-        MockRemoteCacheListener mockListener1 = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<String, String>();
         mockListener1.remoteType = IRemoteCacheAttributes.LOCAL;
         mockListener1.localAddress = expectedIp1;
-        MockRemoteCacheListener mockListener2 = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<String, String>();
         mockListener1.remoteType = IRemoteCacheAttributes.LOCAL;
         mockListener2.localAddress = expectedIp2;
 
@@ -94,12 +94,12 @@ public class RemoteCacheServerUnitTest
 
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
-        MockRemoteCacheListener mockListener1 = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<String, String>();
         mockListener1.remoteType = IRemoteCacheAttributes.CLUSTER;
         mockListener1.localAddress = expectedIp1;
-        MockRemoteCacheListener mockListener2 = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<String, String>();
         mockListener1.remoteType = IRemoteCacheAttributes.CLUSTER;
         mockListener2.localAddress = expectedIp2;
 
@@ -115,7 +115,7 @@ public class RemoteCacheServerUnitTest
         assertEquals( "Wrong ip.", expectedIp1, server.getExtraInfoForRequesterId( 1 ) );
         assertEquals( "Wrong ip.", expectedIp2, server.getExtraInfoForRequesterId( 2 ) );
     }
-    
+
     /**
      * Add a listener. Pass the id of 0, verify that the server sets a new listener id. Do another
      * and verify that the second gets an id of 2.
@@ -128,14 +128,14 @@ public class RemoteCacheServerUnitTest
         // SETUP
         String expectedIp1 = "adfasdf";
         String expectedIp2 = "adsfadsafaf";
-        
+
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
-        MockRemoteCacheListener mockListener1 = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<String, String>();
         mockListener1.localAddress = expectedIp1;
-        MockRemoteCacheListener mockListener2 = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<String, String>();
         mockListener2.localAddress = expectedIp2;
 
         // DO WORK
@@ -147,7 +147,7 @@ public class RemoteCacheServerUnitTest
         assertEquals( "Wrong listener id.", 1, mockListener1.getListenerId() );
         assertEquals( "Wrong listener id.", 2, mockListener2.getListenerId() );
         assertEquals( "Wrong ip.", expectedIp1, server.getExtraInfoForRequesterId( 1 ) );
-        assertEquals( "Wrong ip.", expectedIp2, server.getExtraInfoForRequesterId( 2 ) );        
+        assertEquals( "Wrong ip.", expectedIp2, server.getExtraInfoForRequesterId( 2 ) );
     }
 
     /**
@@ -163,10 +163,10 @@ public class RemoteCacheServerUnitTest
         // SETUP
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
-        MockRemoteCacheListener mockListener1 = new MockRemoteCacheListener();
-        MockRemoteCacheListener mockListener2 = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<String, String>();
+        MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<String, String>();
 
         String cacheName = "testAddListenerToAllThenRemove";
 
@@ -197,11 +197,11 @@ public class RemoteCacheServerUnitTest
         // SETUP
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
-        MockRemoteCacheListener mockListener1 = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, String> mockListener1 = new MockRemoteCacheListener<String, String>();
         mockListener1.remoteType = IRemoteCacheServerAttributes.CLUSTER;
-        MockRemoteCacheListener mockListener2 = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, String> mockListener2 = new MockRemoteCacheListener<String, String>();
         mockListener2.remoteType = IRemoteCacheServerAttributes.CLUSTER;
 
         String cacheName = "testAddListenerToAllThenRemove";
@@ -234,19 +234,19 @@ public class RemoteCacheServerUnitTest
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
 
-        MockRemoteCacheListener mockListener = new MockRemoteCacheListener();
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        MockRemoteCacheListener<String, Long> mockListener = new MockRemoteCacheListener<String, Long>();
+        RemoteCacheServer<String, Long> server = new RemoteCacheServer<String, Long>( rcsa );
 
         String cacheName = "testSimpleRegisterListenerAndPut";
         server.addCacheListener( cacheName, mockListener );
 
         // DO WORK
-        List inputItems = new LinkedList();
+        List<ICacheElement<String, Long>> inputItems = new LinkedList<ICacheElement<String, Long>>();
         int numToPut = 10;
 
         for ( int i = 0; i < numToPut; i++ )
         {
-            ICacheElement element = new CacheElement( cacheName, String.valueOf( i ), Long.valueOf( i ) );
+            ICacheElement<String, Long> element = new CacheElement<String, Long>( cacheName, String.valueOf( i ), Long.valueOf( i ) );
             inputItems.add( element );
             server.update( element, 9999 );
         }
@@ -277,14 +277,14 @@ public class RemoteCacheServerUnitTest
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setLocalClusterConsistency( true );
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, Long> server = new RemoteCacheServer<String, Long>( rcsa );
 
         // this is to get the listener id for inserts.
-        MockRemoteCacheListener clusterListener = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, Long> clusterListener = new MockRemoteCacheListener<String, Long>();
         clusterListener.remoteType = IRemoteCacheAttributes.CLUSTER;
 
         // this should get the updates
-        MockRemoteCacheListener localListener = new MockRemoteCacheListener();
+        MockRemoteCacheListener<String, Long> localListener = new MockRemoteCacheListener<String, Long>();
         localListener.remoteType = IRemoteCacheAttributes.LOCAL;
 
         String cacheName = "testSimpleRegisterListenerAndPut_FromClusterWithLCC";
@@ -292,12 +292,12 @@ public class RemoteCacheServerUnitTest
         server.addCacheListener( cacheName, localListener );
 
         // DO WORK
-        List inputItems = new LinkedList();
+        List<ICacheElement<String, Long>> inputItems = new LinkedList<ICacheElement<String,Long>>();
         int numToPut = 10;
 
         for ( int i = 0; i < numToPut; i++ )
         {
-            ICacheElement element = new CacheElement( cacheName, String.valueOf( i ), Long.valueOf( i ) );
+            ICacheElement<String, Long> element = new CacheElement<String, Long>( cacheName, String.valueOf( i ), Long.valueOf( i ) );
             inputItems.add( element );
             // update using the cluster listener id
             server.update( element, clusterListener.getListenerId() );
@@ -327,8 +327,8 @@ public class RemoteCacheServerUnitTest
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
 
-        MockRemoteCacheListener mockListener = new MockRemoteCacheListener();
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        MockRemoteCacheListener<String, String> mockListener = new MockRemoteCacheListener<String, String>();
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
         String cacheName = "testSimpleRegisterListenerAndPut";
         server.addCacheListener( cacheName, mockListener );
@@ -365,12 +365,12 @@ public class RemoteCacheServerUnitTest
         // SETUP
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         server.setCacheEventLogger( cacheEventLogger );
 
-        ICacheElement item = new CacheElement( "region", "key", "value" );
+        ICacheElement<String, String> item = new CacheElement<String, String>( "region", "key", "value" );
 
         // DO WORK
         server.update( item );
@@ -391,7 +391,7 @@ public class RemoteCacheServerUnitTest
         // SETUP
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         server.setCacheEventLogger( cacheEventLogger );
@@ -415,7 +415,7 @@ public class RemoteCacheServerUnitTest
         // SETUP
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         server.setCacheEventLogger( cacheEventLogger );
@@ -427,7 +427,7 @@ public class RemoteCacheServerUnitTest
         assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls );
         assertEquals( "End should have been called.", 1, cacheEventLogger.endICacheEventCalls );
     }
-    
+
     /**
      * Verify event log calls.
      * <p>
@@ -439,19 +439,19 @@ public class RemoteCacheServerUnitTest
         // SETUP
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         server.setCacheEventLogger( cacheEventLogger );
 
         // DO WORK
-        server.getMultiple( "region", new HashSet() );
+        server.getMultiple( "region", new HashSet<String>() );
 
         // VERIFY
         assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls );
         assertEquals( "End should have been called.", 1, cacheEventLogger.endICacheEventCalls );
     }
-    
+
     /**
      * Verify event log calls.
      * <p>
@@ -463,7 +463,7 @@ public class RemoteCacheServerUnitTest
         // SETUP
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         server.setCacheEventLogger( cacheEventLogger );
@@ -475,7 +475,7 @@ public class RemoteCacheServerUnitTest
         assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls );
         assertEquals( "End should have been called.", 1, cacheEventLogger.endICacheEventCalls );
     }
-    
+
     /**
      * Verify event log calls.
      * <p>
@@ -487,7 +487,7 @@ public class RemoteCacheServerUnitTest
         // SETUP
         IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
         rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" );
-        RemoteCacheServer server = new RemoteCacheServer( rcsa );
+        RemoteCacheServer<String, String> server = new RemoteCacheServer<String, String>( rcsa );
 
         MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         server.setCacheEventLogger( cacheEventLogger );
@@ -498,5 +498,5 @@ public class RemoteCacheServerUnitTest
         // VERIFY
         assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls );
         assertEquals( "End should have been called.", 1, cacheEventLogger.endICacheEventCalls );
-    }    
+    }
 }

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java Wed May 30 18:14:43 2012
@@ -6,7 +6,6 @@ import java.util.Set;
 
 import junit.framework.TestCase;
 
-import org.apache.jcs.auxiliary.remote.util.RemoteCacheRequestFactory;
 import org.apache.jcs.auxiliary.remote.value.RemoteCacheRequest;
 import org.apache.jcs.engine.CacheElement;
 
@@ -23,7 +22,8 @@ public class RemoteCacheRequestFactoryUn
         long requesterId = 2;
 
         // DO WORK
-        RemoteCacheRequest result = RemoteCacheRequestFactory.createGetRequest( cacheName, key, requesterId );
+        RemoteCacheRequest<Serializable, Serializable> result =
+            RemoteCacheRequestFactory.createGetRequest( cacheName, key, requesterId );
 
         // VERIFY
         assertNotNull( "Should have a result", result );
@@ -40,8 +40,8 @@ public class RemoteCacheRequestFactoryUn
         long requesterId = 2;
 
         // DO WORK
-        RemoteCacheRequest result = RemoteCacheRequestFactory.createGetMatchingRequest( cacheName, pattern,
-                                                                                                 requesterId );
+        RemoteCacheRequest<Serializable, Serializable> result =
+            RemoteCacheRequestFactory.createGetMatchingRequest( cacheName, pattern, requesterId );
 
         // VERIFY
         assertNotNull( "Should have a result", result );
@@ -54,12 +54,12 @@ public class RemoteCacheRequestFactoryUn
     {
         // SETUP
         String cacheName = "test";
-        Set keys = Collections.EMPTY_SET;
+        Set<Serializable> keys = Collections.emptySet();
         long requesterId = 2;
 
         // DO WORK
-        RemoteCacheRequest result = RemoteCacheRequestFactory.createGetMultipleRequest( cacheName, keys,
-                                                                                                 requesterId );
+        RemoteCacheRequest<Serializable, Serializable> result =
+            RemoteCacheRequestFactory.createGetMultipleRequest( cacheName, keys, requesterId );
 
         // VERIFY
         assertNotNull( "Should have a result", result );
@@ -76,7 +76,7 @@ public class RemoteCacheRequestFactoryUn
         long requesterId = 2;
 
         // DO WORK
-        RemoteCacheRequest result = RemoteCacheRequestFactory
+        RemoteCacheRequest<Serializable, Serializable> result = RemoteCacheRequestFactory
             .createRemoveRequest( cacheName, key, requesterId );
 
         // VERIFY
@@ -93,7 +93,8 @@ public class RemoteCacheRequestFactoryUn
         long requesterId = 2;
 
         // DO WORK
-        RemoteCacheRequest result = RemoteCacheRequestFactory.createRemoveAllRequest( cacheName, requesterId );
+        RemoteCacheRequest<Serializable, Serializable> result =
+            RemoteCacheRequestFactory.createRemoveAllRequest( cacheName, requesterId );
 
         // VERIFY
         assertNotNull( "Should have a result", result );
@@ -109,10 +110,12 @@ public class RemoteCacheRequestFactoryUn
         Serializable key = "key";
         long requesterId = 2;
 
-        CacheElement element = new CacheElement( cacheName, key, null );
+        CacheElement<Serializable, Serializable> element =
+            new CacheElement<Serializable, Serializable>( cacheName, key, null );
 
         // DO WORK
-        RemoteCacheRequest result = RemoteCacheRequestFactory.createUpdateRequest( element, requesterId );
+        RemoteCacheRequest<Serializable, Serializable> result =
+            RemoteCacheRequestFactory.createUpdateRequest( element, requesterId );
 
         // VERIFY
         assertNotNull( "Should have a result", result );

Propchange: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java
            ('svn:mergeinfo' removed)

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/CacheEventQueueFactoryUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/CacheEventQueueFactoryUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/CacheEventQueueFactoryUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/CacheEventQueueFactoryUnitTest.java Wed May 30 18:14:43 2012
@@ -1,11 +1,11 @@
 package org.apache.jcs.engine;
 
+import junit.framework.TestCase;
+
 import org.apache.jcs.auxiliary.remote.MockRemoteCacheListener;
 import org.apache.jcs.engine.behavior.ICacheEventQueue;
 import org.apache.jcs.engine.behavior.ICacheListener;
 
-import junit.framework.TestCase;
-
 /** Unit tests for the CacheEventQueueFactory */
 public class CacheEventQueueFactoryUnitTest
     extends TestCase
@@ -15,50 +15,50 @@ public class CacheEventQueueFactoryUnitT
     {
         // SETUP
         String eventQueueType = ICacheEventQueue.SINGLE_QUEUE_TYPE;
-        ICacheListener listener = new MockRemoteCacheListener();
+        ICacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
         long listenerId = 1;
-        
-        CacheEventQueueFactory factory = new CacheEventQueueFactory();
-        
+
+        CacheEventQueueFactory<String, String> factory = new CacheEventQueueFactory<String, String>();
+
         // DO WORK
-        ICacheEventQueue result = factory.createCacheEventQueue( listener, listenerId, "cacheName", "threadPoolName", eventQueueType );
-        
+        ICacheEventQueue<String, String> result = factory.createCacheEventQueue( listener, listenerId, "cacheName", "threadPoolName", eventQueueType );
+
         // VERIFY
         assertNotNull( "Should have a result", result );
         assertTrue( "Wrong type", result instanceof CacheEventQueue );
     }
-    
+
     /** Test create */
     public void testCreateCacheEventQueue_Pooled()
     {
         // SETUP
         String eventQueueType = ICacheEventQueue.POOLED_QUEUE_TYPE;
-        ICacheListener listener = new MockRemoteCacheListener();
+        ICacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
         long listenerId = 1;
-        
-        CacheEventQueueFactory factory = new CacheEventQueueFactory();
-        
+
+        CacheEventQueueFactory<String, String> factory = new CacheEventQueueFactory<String, String>();
+
         // DO WORK
-        ICacheEventQueue result = factory.createCacheEventQueue( listener, listenerId, "cacheName", "threadPoolName", eventQueueType );
-        
+        ICacheEventQueue<String, String> result = factory.createCacheEventQueue( listener, listenerId, "cacheName", "threadPoolName", eventQueueType );
+
         // VERIFY
         assertNotNull( "Should have a result", result );
         assertTrue( "Wrong type", result instanceof PooledCacheEventQueue );
     }
-    
+
     /** Test create */
     public void testCreateCacheEventQueue_Custom()
     {
         // SETUP
         String eventQueueType = MockCacheEventQueue.class.getName();
-        ICacheListener listener = new MockRemoteCacheListener();
+        ICacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
         long listenerId = 1;
-        
-        CacheEventQueueFactory factory = new CacheEventQueueFactory();
-        
+
+        CacheEventQueueFactory<String, String> factory = new CacheEventQueueFactory<String, String>();
+
         // DO WORK
-        ICacheEventQueue result = factory.createCacheEventQueue( listener, listenerId, "cacheName", "threadPoolName", eventQueueType );
-        
+        ICacheEventQueue<String, String> result = factory.createCacheEventQueue( listener, listenerId, "cacheName", "threadPoolName", eventQueueType );
+
         // VERIFY
         assertNotNull( "Should have a result", result );
         assertTrue( "Wrong type: " + result, result instanceof MockCacheEventQueue );

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/EventQueueConcurrentLoadTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/EventQueueConcurrentLoadTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/EventQueueConcurrentLoadTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/EventQueueConcurrentLoadTest.java Wed May 30 18:14:43 2012
@@ -39,15 +39,15 @@ public class EventQueueConcurrentLoadTes
     extends TestCase
 {
     /** The queue implementation */
-    private static CacheEventQueue queue = null;
+    private static CacheEventQueue<String, String> queue = null;
 
     /** The mock listener */
-    private static CacheListenerImpl listen = null;
+    private static CacheListenerImpl<String, String> listen = null;
 
     /** max failure setting */
     private final int maxFailure = 3;
 
-    /** time to wait before rtrying on failure. */
+    /** time to wait before retrying on failure. */
     private final int waitBeforeRetry = 100;
 
     /** very small idle time */
@@ -169,8 +169,8 @@ public class EventQueueConcurrentLoadTes
     @Override
     public void setUp()
     {
-        listen = new CacheListenerImpl();
-        queue = new CacheEventQueue( listen, 1L, "testCache1", maxFailure, waitBeforeRetry );
+        listen = new CacheListenerImpl<String, String>();
+        queue = new CacheEventQueue<String, String>( listen, 1L, "testCache1", maxFailure, waitBeforeRetry );
 
         queue.setWaitToDieMillis( idleTime );
     }
@@ -186,7 +186,7 @@ public class EventQueueConcurrentLoadTes
     {
         for ( int i = 0; i <= end; i++ )
         {
-            CacheElement elem = new CacheElement( "testCache1", i + ":key", i + "data" );
+            CacheElement<String, String> elem = new CacheElement<String, String>( "testCache1", i + ":key", i + "data" );
             queue.addPutEvent( elem );
         }
 
@@ -252,7 +252,7 @@ public class EventQueueConcurrentLoadTes
         System.out.println( "queue is empty, begin" );
 
         // get it going
-        CacheElement elem = new CacheElement( "testCache1", "a:key", "adata" );
+        CacheElement<String, String> elem = new CacheElement<String, String>( "testCache1", "a:key", "adata" );
         queue.addPutEvent( elem );
 
         for ( int i = 0; i <= end; i++ )
@@ -268,7 +268,7 @@ public class EventQueueConcurrentLoadTes
                     this.wait( idleTime / 2 );
                 }
             }
-            CacheElement elem2 = new CacheElement( "testCache1", i + ":key", i + "data" );
+            CacheElement<String, String> elem2 = new CacheElement<String, String>( "testCache1", i + ":key", i + "data" );
             queue.addPutEvent( elem2 );
         }
 
@@ -294,8 +294,8 @@ public class EventQueueConcurrentLoadTes
     /**
      * This is a dummy cache listener to use when testing the event queue.
      */
-    private static class CacheListenerImpl
-        implements ICacheListener
+    protected static class CacheListenerImpl<K extends Serializable, V extends Serializable>
+        implements ICacheListener<K, V>
     {
         /**
          * <code>putCount</code>
@@ -311,7 +311,7 @@ public class EventQueueConcurrentLoadTes
          * @param item
          * @throws IOException
          */
-        public void handlePut( ICacheElement item )
+        public void handlePut( ICacheElement<K, V> item )
             throws IOException
         {
             synchronized ( this )
@@ -325,7 +325,7 @@ public class EventQueueConcurrentLoadTes
          * @param key
          * @throws IOException
          */
-        public void handleRemove( String cacheName, Serializable key )
+        public void handleRemove( String cacheName, K key )
             throws IOException
         {
             synchronized ( this )

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/MockCacheEventQueue.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/MockCacheEventQueue.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/MockCacheEventQueue.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/engine/MockCacheEventQueue.java Wed May 30 18:14:43 2012
@@ -1,14 +1,16 @@
 package org.apache.jcs.engine;
 
+import java.io.Serializable;
+
 import org.apache.jcs.auxiliary.remote.MockRemoteCacheListener;
 
 /** For testing the factory */
-public class MockCacheEventQueue
-    extends CacheEventQueue
+public class MockCacheEventQueue<K extends Serializable, V extends Serializable>
+    extends CacheEventQueue<K, V>
 {
     /** junk */
     public MockCacheEventQueue()
     {
-        super( new MockRemoteCacheListener(), 1, null, 1, 1 );
+        super( new MockRemoteCacheListener<K, V>(), 1, null, 1, 1 );
     }
 }



Mime
View raw message