commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1344374 [11/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/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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -62,7 +62,7 @@ public class JDBCDiskCacheRemovalUnitTes
         String region = "testCache1";
         String data = "adfadsfasfddsafasasd";
 
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         // DO WORK
         jcs.put( keyPart1 + ":" + keyPart2, data );

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheSharedPoolUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheSharedPoolUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheSharedPoolUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheSharedPoolUnitTest.java Wed May 30 18:14:43 2012
@@ -84,7 +84,7 @@ public class JDBCDiskCacheSharedPoolUnit
     public void runTestForRegion( String region, int items )
         throws Exception
     {
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         System.out.println( "BEFORE PUT \n" + jcs.getStats() );
 
@@ -105,22 +105,22 @@ public class JDBCDiskCacheSharedPoolUnit
 
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( "key = [" + i + ":key] value = [" + value + "]", region + " data " + i, value );
         }
 
         // Test that getElements returns all the expected values
-        Set keys = new HashSet();
+        Set<String> keys = new HashSet<String>();
         for ( int i = 0; i <= items; i++ )
         {
             keys.add( i + ":key" );
         }
 
-        Map elements = jcs.getCacheElements( keys );
+        Map<String, ICacheElement<String, String>> elements = jcs.getCacheElements( keys );
         for ( int i = 0; i <= items; i++ )
         {
-            ICacheElement element = (ICacheElement) elements.get( i + ":key" );
+            ICacheElement<String, String> element = elements.get( i + ":key" );
             assertNotNull( "element " + i + ":key is missing", element );
             assertEquals( "value " + i + ":key", region + " data " + i, element.getVal() );
         }

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -82,7 +82,7 @@ public class JDBCDiskCacheShrinkUnitTest
         String regionExpire = "expire1Second";
         int items = 200;
 
-        JCS jcsExpire = JCS.getInstance( regionExpire );
+        JCS<String, String> jcsExpire = JCS.getInstance( regionExpire );
 
         System.out.println( "BEFORE PUT \n" + jcsExpire.getStats() );
 
@@ -119,7 +119,7 @@ public class JDBCDiskCacheShrinkUnitTest
         String region = "expire100Second";
         int items = 200;
 
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         System.out.println( "BEFORE PUT \n" + jcs.getStats() );
 
@@ -171,7 +171,7 @@ public class JDBCDiskCacheShrinkUnitTest
         String region = "eternal";
         int items = 200;
 
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         System.out.println( "BEFORE PUT \n" + jcs.getStats() );
 

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -83,7 +83,7 @@ public class JDBCDiskCacheUnitTest
     public void runTestForRegion( String region, int items )
         throws Exception
     {
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         System.out.println( "BEFORE PUT \n" + jcs.getStats() );
 
@@ -104,22 +104,22 @@ public class JDBCDiskCacheUnitTest
 
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( "key = [" + i + ":key] value = [" + value + "]", region + " data " + i, value );
         }
 
         // Test that getElements returns all the expected values
-        Set keys = new HashSet();
+        Set<String> keys = new HashSet<String>();
         for ( int i = 0; i <= items; i++ )
         {
             keys.add( i + ":key" );
         }
 
-        Map elements = jcs.getCacheElements( keys );
+        Map<String, ICacheElement<String, String>> elements = jcs.getCacheElements( keys );
         for ( int i = 0; i <= items; i++ )
         {
-            ICacheElement element = (ICacheElement) elements.get( i + ":key" );
+            ICacheElement<String, String> element = elements.get( i + ":key" );
             assertNotNull( "element " + i + ":key is missing", element );
             assertEquals( "value " + i + ":key", region + " data " + i, element.getVal() );
         }
@@ -167,10 +167,10 @@ public class JDBCDiskCacheUnitTest
         cattr.setConnectionPoolName( poolName );
 
         TableState tableState = new TableState( "JCSTESTTABLE_InitializePoolAccess" );
-        MockCompositeCacheManager compositeCacheManager = new MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> compositeCacheManager = new MockCompositeCacheManager<String, String>();
         compositeCacheManager.setConfigurationProperties( props );
 
-        JDBCDiskCache diskCache = new JDBCDiskCache( cattr, tableState, compositeCacheManager );
+        JDBCDiskCache<String, String> diskCache = new JDBCDiskCache<String, String>( cattr, tableState, compositeCacheManager );
 
         System.setProperty( "hsqldb.cache_scale", "8" );
 
@@ -180,7 +180,7 @@ public class JDBCDiskCacheUnitTest
         new org.hsqldb.jdbcDriver();
         Class.forName( driverClassName ).newInstance();
         Connection cConn = DriverManager.getConnection( url + database, userName, password );
-        
+
         HsqlSetupTableUtil.setupTABLE( cConn, "JCSTESTTABLE_InitializePoolAccess" );
 
         // DO WORK

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java Wed May 30 18:14:43 2012
@@ -119,7 +119,7 @@ public class HSQLDiskCacheConcurrentUnit
     public void runTestForRegion( String region )
         throws Exception
     {
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         // Add items to cache
 
@@ -134,22 +134,22 @@ public class HSQLDiskCacheConcurrentUnit
 
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( "key = [" + i + ":key] value = [" + value + "]", region + " data " + i, value );
         }
 
         // Test that getElements returns all the expected values
-        Set keys = new HashSet();
+        Set<String> keys = new HashSet<String>();
         for ( int i = 0; i <= items; i++ )
         {
             keys.add( i + ":key" );
         }
 
-        Map elements = jcs.getCacheElements( keys );
+        Map<String, ICacheElement<String, String>> elements = jcs.getCacheElements( keys );
         for ( int i = 0; i <= items; i++ )
         {
-            ICacheElement element = (ICacheElement) elements.get( i + ":key" );
+            ICacheElement<String, String> element = elements.get( i + ":key" );
             assertNotNull( "element " + i + ":key is missing", element );
             assertEquals( "value " + i + ":key", region + " data " + i, element.getVal() );
         }

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java Wed May 30 18:14:43 2012
@@ -57,7 +57,7 @@ public class HSQLDiskCacheUnitTest
 
         String region = "testBasicPutRemove";
 
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         // Add items to cache
 
@@ -74,22 +74,22 @@ public class HSQLDiskCacheUnitTest
 
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( "key = [" + i + ":key] value = [" + value + "]", region + " data " + i, value );
         }
 
         // Test that getElements returns all the expected values
-        Set keys = new HashSet();
+        Set<String> keys = new HashSet<String>();
         for ( int i = 0; i <= items; i++ )
         {
             keys.add( i + ":key" );
         }
 
-        Map elements = jcs.getCacheElements( keys );
+        Map<String, ICacheElement<String, String>> elements = jcs.getCacheElements( keys );
         for ( int i = 0; i <= items; i++ )
         {
-            ICacheElement element = (ICacheElement) elements.get( i + ":key" );
+            ICacheElement<String, String> element = elements.get( i + ":key" );
             assertNotNull( "element " + i + ":key is missing", element );
             assertEquals( "value " + i + ":key", region + " data " + i, element.getVal() );
         }
@@ -120,7 +120,7 @@ public class HSQLDiskCacheUnitTest
         throws CacheException, InterruptedException
     {
         String region = "removeAllAllowed";
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         int items = 20;
 
@@ -144,7 +144,7 @@ public class HSQLDiskCacheUnitTest
 
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertNull( "value should be null key = [" + i + ":key] value = [" + value + "]", value );
         }
@@ -160,7 +160,7 @@ public class HSQLDiskCacheUnitTest
         throws CacheException, InterruptedException
     {
         String region = "noRemoveAll";
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         int items = 20;
 
@@ -180,7 +180,7 @@ public class HSQLDiskCacheUnitTest
 
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( "key = [" + i + ":key] value = [" + value + "]", region + " data " + i, value );
         }

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheHsqlBackedUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheHsqlBackedUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheHsqlBackedUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheHsqlBackedUnitTest.java Wed May 30 18:14:43 2012
@@ -95,7 +95,7 @@ public class MySQLDiskCacheHsqlBackedUni
     public void runTestForRegion( String region, int items )
         throws Exception
     {
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
         //System.out.println( "BEFORE PUT \n" + jcs.getStats() );
 
         // Add items to cache
@@ -111,22 +111,22 @@ public class MySQLDiskCacheHsqlBackedUni
         // Test that all items are in cache
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( "key = [" + i + ":key] value = [" + value + "]", region + " data " + i, value );
         }
 
         // Test that getElements returns all the expected values
-        Set keys = new HashSet();
+        Set<String> keys = new HashSet<String>();
         for ( int i = 0; i <= items; i++ )
         {
             keys.add( i + ":key" );
         }
 
-        Map elements = jcs.getCacheElements( keys );
+        Map<String, ICacheElement<String, String>> elements = jcs.getCacheElements( keys );
         for ( int i = 0; i <= items; i++ )
         {
-            ICacheElement element = (ICacheElement) elements.get( i + ":key" );
+            ICacheElement<String, String> element = elements.get( i + ":key" );
             assertNotNull( "element " + i + ":key is missing", element );
             assertEquals( "value " + i + ":key", region + " data " + i, element.getVal() );
         }
@@ -156,7 +156,7 @@ public class MySQLDiskCacheHsqlBackedUni
         // SETUP
         int items = 200;
         String region = "testCache2";
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
         System.out.println( "BEFORE PUT \n" + jcs.getStats() );
 
         // DO WORK
@@ -166,7 +166,7 @@ public class MySQLDiskCacheHsqlBackedUni
         }
         Thread.sleep( 1000 );
 
-        Map matchingResults = jcs.getMatchingCacheElements( "1.8.+" );
+        Map<String, ICacheElement<String, String>> matchingResults = jcs.getMatchingCacheElements( "1.8.+" );
 
         // VERIFY
         assertEquals( "Wrong number returned", 10, matchingResults.size() );
@@ -178,7 +178,7 @@ public class MySQLDiskCacheHsqlBackedUni
      * SETUP TABLE FOR CACHE
      * @param cConn
      */
-    void setupTABLE( Connection cConn )
+    void setupTABLE( Connection cConn ) throws SQLException
     {
         boolean newT = true;
 
@@ -196,15 +196,7 @@ public class MySQLDiskCacheHsqlBackedUni
         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
         {
@@ -221,7 +213,7 @@ public class MySQLDiskCacheHsqlBackedUni
             {
                 // TODO figure out if it exists prior to trying to create it.
                 // log.error( "Problem creating table.", e );
-                e.printStackTrace();
+                throw e;
             }
         }
 

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -27,7 +27,7 @@ public class MySQLDiskCacheManagerUnitTe
                                                                            elementSerializer );
 
         // DO WORK
-        MySQLDiskCache cache = (MySQLDiskCache) manager.getCache( cacheName );
+        MySQLDiskCache<String, String> cache = (MySQLDiskCache) manager.getCache( cacheName );
 
         // VERIFY
         assertEquals( "wrong cacheEventLogger", cacheEventLogger, cache.getCacheEventLogger() );

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -1,9 +1,9 @@
 package org.apache.jcs.auxiliary.lateral;
 
-import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
-
 import junit.framework.TestCase;
 
+import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
+
 /**
  * Tests for LateralCacheNoWaitFacade.
  */
@@ -16,78 +16,78 @@ public class LateralCacheNoWaitFacadeUni
     public void testAddThenRemoveNoWait_InList()
     {
         // SETUP
-        LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0];
+        LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( "testCache1" );
-        
-        LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr );
-        
-        LateralCache cache = new LateralCache( cattr );
-        LateralCacheNoWait noWait = new LateralCacheNoWait( cache );
-        
+
+        LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( noWaits, cattr );
+
+        LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
+        LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+
         // DO WORK
         facade.addNoWait( noWait );
 
         // VERIFY
         assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) );
-        
+
         // DO WORK
         facade.removeNoWait( noWait );
-        
+
         // VERIFY
-        assertEquals( "Should have 0", 0, facade.noWaits.length );               
+        assertEquals( "Should have 0", 0, facade.noWaits.length );
         assertFalse( "Should not be in the list. ", facade.containsNoWait( noWait ) );
     }
-    
+
     /**
      * Verify that we can remove an item.
      */
     public void testAddThenRemoveNoWait_InListSize2()
     {
         // SETUP
-        LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0];
+        LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( "testCache1" );
-        
-        LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr );
-        
-        LateralCache cache = new LateralCache( cattr );
-        LateralCacheNoWait noWait = new LateralCacheNoWait( cache );
-        LateralCacheNoWait noWait2 = new LateralCacheNoWait( cache );
-        
+
+        LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( noWaits, cattr );
+
+        LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
+        LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+        LateralCacheNoWait<String, String> noWait2 = new LateralCacheNoWait<String, String>( cache );
+
         // DO WORK
         facade.addNoWait( noWait );
         facade.addNoWait( noWait2 );
 
         // VERIFY
-        assertEquals( "Should have 2", 2, facade.noWaits.length );        
+        assertEquals( "Should have 2", 2, facade.noWaits.length );
         assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) );
         assertTrue( "Should be in the list.", facade.containsNoWait( noWait2 ) );
-        
+
         // DO WORK
         facade.removeNoWait( noWait );
-        
-        // VERIFY        
-        assertEquals( "Should only have 1", 1, facade.noWaits.length );        
+
+        // VERIFY
+        assertEquals( "Should only have 1", 1, facade.noWaits.length );
         assertFalse( "Should not be in the list. ", facade.containsNoWait( noWait ) );
         assertTrue( "Should be in the list.", facade.containsNoWait( noWait2 ) );
     }
-    
+
     /**
      * Verify that we can remove an item.
      */
     public void testAdd_InList()
     {
         // SETUP
-        LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0];
+        LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( "testCache1" );
-        
-        LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr );
-        
-        LateralCache cache = new LateralCache( cattr );
-        LateralCacheNoWait noWait = new LateralCacheNoWait( cache );
-        
+
+        LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( noWaits, cattr );
+
+        LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
+        LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+
         // DO WORK
         facade.addNoWait( noWait );
         facade.addNoWait( noWait );
@@ -96,26 +96,26 @@ public class LateralCacheNoWaitFacadeUni
         assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) );
         assertEquals( "Should only have 1", 1, facade.noWaits.length );
     }
-    
+
     /**
      * Verify that we can remove an item.
      */
     public void testAddThenRemoveNoWait_NotInList()
     {
         // SETUP
-        LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0];
+        LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( "testCache1" );
-        
-        LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr );
-        
-        LateralCache cache = new LateralCache( cattr );
-        LateralCacheNoWait noWait = new LateralCacheNoWait( cache );       
-        
+
+        LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( noWaits, cattr );
+
+        LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
+        LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
+
         // DO WORK
         facade.removeNoWait( noWait );
-        
+
         // VERIFY
         assertFalse( "Should not be in the list.", facade.containsNoWait( noWait ) );
-    }    
+    }
 }

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java Wed May 30 18:14:43 2012
@@ -74,7 +74,7 @@ public class LateralTCPConcurrentRandomT
     {
         boolean show = true;//false;
 
-        JCS cache = JCS.getInstance( region );
+        JCS<String, String> cache = JCS.getInstance( region );
 
         TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes();
         lattr2.setTcpListenerPort( 1103 );
@@ -84,7 +84,7 @@ public class LateralTCPConcurrentRandomT
         // this service will put and remove using the lateral to
         // the cache instance above
         // the cache thinks it is different since the listenerid is different
-        LateralTCPService service = new LateralTCPService( lattr2 );
+        LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
         service.setListenerId( 123456 );
 
         try
@@ -97,7 +97,7 @@ public class LateralTCPConcurrentRandomT
                 String key = "key" + kn;
                 if ( n == 1 )
                 {
-                    ICacheElement element = new CacheElement( region, key, region + ":data" + i
+                    ICacheElement<String, String> element = new CacheElement<String, String>( region, key, region + ":data" + i
                         + " junk asdfffffffadfasdfasf " + kn + ":" + n );
                     service.update( element );
                     if ( show )
@@ -148,18 +148,18 @@ public class LateralTCPConcurrentRandomT
             throw e;
         }
 
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
         String key = "testKey" + testNum;
         String data = "testData" + testNum;
         jcs.put( key, data );
-        String value = (String) jcs.get( key );
+        String value = jcs.get( key );
         assertEquals( "Couldn't put normally.", data, value );
 
         // make sure the items we can find are in the correct region.
         for ( int i = 1; i < numOps; i++ )
         {
             String keyL = "key" + i;
-            String dataL = (String) jcs.get( keyL );
+            String dataL = jcs.get( keyL );
             if ( dataL != null )
             {
                 assertTrue( "Incorrect region detected.", dataL.startsWith( region ) );
@@ -169,7 +169,7 @@ public class LateralTCPConcurrentRandomT
 
         //Thread.sleep( 1000 );
 
-        //ICacheElement element = new CacheElement( region, "abc", "testdata");
+        //ICacheElement<String, String> element = new CacheElement( region, "abc", "testdata");
         //service.update( element );
 
         //Thread.sleep( 2500 );

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -50,11 +50,11 @@ public class LateralTCPDiscoveryListener
     {
         // SETUP
         String cacheName = "testAddNoWaitFacade_NotInList";
-        LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0];
+        LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( cacheName );
 
-        LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr );
+        LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( noWaits, cattr );
 
         // DO WORK
         listener.addNoWaitFacade( cacheName, facade );
@@ -70,15 +70,15 @@ public class LateralTCPDiscoveryListener
     {
         // SETUP
         String cacheName = "testAddNoWaitFacade_FacadeInList";
-        LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0];
+        LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( cacheName );
 
-        LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr );
+        LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( noWaits, cattr );
         listener.addNoWaitFacade( cacheName, facade );
 
-        LateralCache cache = new LateralCache( cattr );
-        LateralCacheNoWait noWait = new LateralCacheNoWait( cache );
+        LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
+        LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
 
         // DO WORK
         boolean result = listener.addNoWait( noWait );
@@ -97,8 +97,8 @@ public class LateralTCPDiscoveryListener
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( cacheName );
 
-        LateralCache cache = new LateralCache( cattr );
-        LateralCacheNoWait noWait = new LateralCacheNoWait( cache );
+        LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
+        LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
 
         // DO WORK
         boolean result = listener.addNoWait( noWait );
@@ -117,8 +117,8 @@ public class LateralTCPDiscoveryListener
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( cacheName );
 
-        LateralCache cache = new LateralCache( cattr );
-        LateralCacheNoWait noWait = new LateralCacheNoWait( cache );
+        LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
+        LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
 
         // DO WORK
         boolean result = listener.removeNoWait( noWait );
@@ -134,15 +134,15 @@ public class LateralTCPDiscoveryListener
     {
         // SETUP
         String cacheName = "testAddNoWaitFacade_FacadeInList";
-        LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0];
+        LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( cacheName );
 
-        LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr );
+        LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( noWaits, cattr );
         listener.addNoWaitFacade( cacheName, facade );
 
-        LateralCache cache = new LateralCache( cattr );
-        LateralCacheNoWait noWait = new LateralCacheNoWait( cache );
+        LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
+        LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
 
         // DO WORK
         boolean result = listener.removeNoWait( noWait );
@@ -158,15 +158,15 @@ public class LateralTCPDiscoveryListener
     {
         // SETUP
         String cacheName = "testRemoveNoWaitFacade_FacadeInListNoWaitIs";
-        LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0];
+        LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( cacheName );
 
-        LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr );
+        LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( noWaits, cattr );
         listener.addNoWaitFacade( cacheName, facade );
 
-        LateralCache cache = new LateralCache( cattr );
-        LateralCacheNoWait noWait = new LateralCacheNoWait( cache );
+        LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
+        LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
         listener.addNoWait( noWait );
 
         // DO WORK
@@ -199,12 +199,12 @@ public class LateralTCPDiscoveryListener
         lca.setTcpServer( service.getServiceAddress() + ":" + service.getServicePort() );
         LateralTCPCacheManager lcm = LateralTCPCacheManager.getInstance( lca, cacheMgr, cacheEventLogger,
                                                                          elementSerializer );
-        LateralCacheNoWait noWait = (LateralCacheNoWait) lcm.getCache( cacheName );
+        LateralCacheNoWait<String, String> noWait = (LateralCacheNoWait) lcm.getCache( cacheName );
 
-        LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0];
+        LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( cacheName );
-        LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr );
+        LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( noWaits, cattr );
         listener.addNoWaitFacade( cacheName, facade );
 
         // DO WORK
@@ -237,12 +237,12 @@ public class LateralTCPDiscoveryListener
         lca.setTcpServer( service.getServiceAddress() + ":" + service.getServicePort() );
         LateralTCPCacheManager lcm = LateralTCPCacheManager.getInstance( lca, cacheMgr, cacheEventLogger,
                                                                          elementSerializer );
-        LateralCacheNoWait noWait = (LateralCacheNoWait) lcm.getCache( cacheName );
+        LateralCacheNoWait<String, String> noWait = (LateralCacheNoWait) lcm.getCache( cacheName );
 
-        LateralCacheNoWait[] noWaits = new LateralCacheNoWait[0];
+        LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
         ILateralCacheAttributes cattr = new LateralCacheAttributes();
         cattr.setCacheName( cacheName );
-        LateralCacheNoWaitFacade facade = new LateralCacheNoWaitFacade( noWaits, cattr );
+        LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( noWaits, cattr );
         listener.addNoWaitFacade( cacheName, facade );
         listener.addDiscoveredService( service );
 

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java Wed May 30 18:14:43 2012
@@ -38,8 +38,8 @@ public class LateralTCPFilterRemoveHashC
     //private static boolean isSysOut = false;
 
     /** The port the server will listen to. */
-    private int serverPort = 2001;
-    
+    private final int serverPort = 2001;
+
     /**
      * Constructor for the TestDiskCache object.
      *
@@ -84,7 +84,7 @@ public class LateralTCPFilterRemoveHashC
     public void runTestForRegion( String region, int numOps, int testNum )
         throws Exception
     {
-        JCS cache = JCS.getInstance( region );
+        JCS<String, Serializable> cache = JCS.getInstance( region );
 
         Thread.sleep( 100 );
 
@@ -99,7 +99,7 @@ public class LateralTCPFilterRemoveHashC
         // this service will put and remove using the lateral to
         // the cache instance above
         // the cache thinks it is different since the listenerid is different
-        LateralTCPService service = new LateralTCPService( lattr2 );
+        LateralTCPService<String, Serializable> service = new LateralTCPService<String, Serializable>( lattr2 );
         service.setListenerId( 123456 );
 
         String keyToBeRemovedOnPut = "test1";
@@ -121,12 +121,12 @@ public class LateralTCPFilterRemoveHashC
         // dataToPassHashCodeCompare.hashCode() );
 
         cache.put( keyToBeRemovedOnPut, "this should get removed." );
-        ICacheElement element1 = new CacheElement( region, keyToBeRemovedOnPut, region
+        ICacheElement<String, Serializable> element1 = new CacheElement<String, Serializable>( region, keyToBeRemovedOnPut, region
             + ":data-this shouldn't get there" );
         service.update( element1 );
 
         cache.put( keyToNotBeRemovedOnPut, dataToPassHashCodeCompare );
-        ICacheElement element2 = new CacheElement( region, keyToNotBeRemovedOnPut, dataToPassHashCodeCompare );
+        ICacheElement<String, Serializable> element2 = new CacheElement<String, Serializable>( region, keyToNotBeRemovedOnPut, dataToPassHashCodeCompare );
         service.update( element2 );
 
         /*
@@ -134,7 +134,7 @@ public class LateralTCPFilterRemoveHashC
          * int n = ran.nextInt( 4 ); int kn = ran.nextInt( range ); String key =
          * "key" + kn;
          *
-         * ICacheElement element = new CacheElement( region, key, region +
+         * ICacheElement<String, String> element = new CacheElement( region, key, region +
          * ":data" + i + " junk asdfffffffadfasdfasf " + kn + ":" + n );
          * service.update( element ); if ( show ) { p( "put " + key ); }
          *
@@ -143,18 +143,18 @@ public class LateralTCPFilterRemoveHashC
          * e.toString() ); e.printStackTrace( System.out ); throw e; }
          */
 
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
         String key = "testKey" + testNum;
         String data = "testData" + testNum;
         jcs.put( key, data );
-        String value = (String) jcs.get( key );
+        String value = jcs.get( key );
         assertEquals( "Couldn't put normally.", data, value );
 
         // make sure the items we can find are in the correct region.
         for ( int i = 1; i < numOps; i++ )
         {
             String keyL = "key" + i;
-            String dataL = (String) jcs.get( keyL );
+            String dataL = jcs.get( keyL );
             if ( dataL != null )
             {
                 assertTrue( "Incorrect region detected.", dataL.startsWith( region ) );

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java Wed May 30 18:14:43 2012
@@ -38,8 +38,8 @@ public class LateralTCPIssueRemoveOnPutU
     private static boolean isSysOut = true;
 
     /** The port the server will listen to. */
-    private int serverPort = 1118;
-    
+    private final int serverPort = 1118;
+
     /**
      * Constructor for the TestDiskCache object.
      * <p>
@@ -54,9 +54,9 @@ public class LateralTCPIssueRemoveOnPutU
      * Test setup
      */
     public void setUp()
-    {        
+    {
         System.setProperty( "jcs.auxiliary.LTCP.attributes.TcpServers", "localhost:" + serverPort );
-        
+
         JCS.setConfigFilename( "/TestTCPLateralIssueRemoveCache.ccf" );
     }
 
@@ -71,7 +71,7 @@ public class LateralTCPIssueRemoveOnPutU
 
     /**
      * Verify that a standard put works. Get the cache configured from a file. Create a tcp service
-     * to talk to that cache. Put via the servive. Verify that the cache got the data.
+     * to talk to that cache. Put via the service. Verify that the cache got the data.
      * <p>
      * @throws Exception
      */
@@ -80,7 +80,7 @@ public class LateralTCPIssueRemoveOnPutU
     {
         String region = "region1";
 
-        JCS cache = JCS.getInstance( region );
+        JCS<String, String> cache = JCS.getInstance( region );
 
         Thread.sleep( 100 );
 
@@ -95,12 +95,12 @@ public class LateralTCPIssueRemoveOnPutU
         // Using the lateral, this service will put to and remove from
         // the cache instance above.
         // The cache thinks it is different since the listenerid is different
-        LateralTCPService service = new LateralTCPService( lattr2 );
+        LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
         service.setListenerId( 123456 );
 
         String keyToBeRemovedOnPut = "test1_notremoved";
 
-        ICacheElement element1 = new CacheElement( region, keyToBeRemovedOnPut, region
+        ICacheElement<String, String> element1 = new CacheElement<String, String>( region, keyToBeRemovedOnPut, region
             + ":data-this shouldn't get removed, it should get to the cache." );
         service.update( element1 );
 
@@ -127,7 +127,7 @@ public class LateralTCPIssueRemoveOnPutU
 
         boolean show = true;// false;
 
-        JCS cache = JCS.getInstance( region );
+        JCS<String, String> cache = JCS.getInstance( region );
 
         Thread.sleep( 100 );
 
@@ -142,13 +142,13 @@ public class LateralTCPIssueRemoveOnPutU
         // Using the lateral, this service will put to and remove from
         // the cache instance above.
         // The cache thinks it is different since the listenerid is different
-        LateralTCPService service = new LateralTCPService( lattr2 );
+        LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
         service.setListenerId( 123456 );
 
         String keyToBeRemovedOnPut = "test1";
         cache.put( keyToBeRemovedOnPut, "this should get removed." );
 
-        ICacheElement element1 = new CacheElement( region, keyToBeRemovedOnPut, region
+        ICacheElement<String, String> element1 = new CacheElement<String, String>( region, keyToBeRemovedOnPut, region
             + ":data-this shouldn't get there" );
         service.update( element1 );
 
@@ -161,7 +161,7 @@ public class LateralTCPIssueRemoveOnPutU
                 int kn = ran.nextInt( range );
                 String key = "key" + kn;
 
-                ICacheElement element = new CacheElement( region, key, region + ":data" + i
+                ICacheElement<String, String> element = new CacheElement<String, String>( region, key, region + ":data" + i
                     + " junk asdfffffffadfasdfasf " + kn + ":" + n );
                 service.update( element );
                 if ( show )
@@ -184,18 +184,18 @@ public class LateralTCPIssueRemoveOnPutU
             throw e;
         }
 
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
         String key = "testKey" + testNum;
         String data = "testData" + testNum;
         jcs.put( key, data );
-        String value = (String) jcs.get( key );
+        String value = jcs.get( key );
         assertEquals( "Couldn't put normally.", data, value );
 
         // make sure the items we can find are in the correct region.
         for ( int i = 1; i < numOps; i++ )
         {
             String keyL = "key" + i;
-            String dataL = (String) jcs.get( keyL );
+            String dataL = jcs.get( keyL );
             if ( dataL != null )
             {
                 assertTrue( "Incorrect region detected.", dataL.startsWith( region ) );

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/MockLateralCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/MockLateralCache.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/MockLateralCache.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/MockLateralCache.java Wed May 30 18:14:43 2012
@@ -30,9 +30,9 @@ import org.apache.jcs.engine.behavior.IC
 /**
  * For testing things that need a lateral cache
  */
-public class MockLateralCache
-    extends LateralCache
-    implements ICache
+public class MockLateralCache<K extends Serializable, V extends Serializable>
+    extends LateralCache<K, V>
+    implements ICache<K, V>
 {
     /** junk */
     private static final long serialVersionUID = 1L;
@@ -50,7 +50,7 @@ public class MockLateralCache
      * @param ce
      * @throws IOException
      */
-    protected void processUpdate( ICacheElement ce )
+    protected void processUpdate( ICacheElement<K, V> ce )
         throws IOException
     {
         // nothing
@@ -61,7 +61,7 @@ public class MockLateralCache
      * @return ICacheElement
      * @throws IOException
      */
-    protected ICacheElement processGet( Serializable key )
+    protected ICacheElement<K, V> processGet( K key )
         throws IOException
     {
         return null;
@@ -72,7 +72,7 @@ public class MockLateralCache
      * @return false
      * @throws IOException
      */
-    protected boolean processRemove( Serializable key )
+    protected boolean processRemove( K key )
         throws IOException
     {
         return false;

Propchange: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/MockLateralCache.java
            ('svn:mergeinfo' removed)

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -71,7 +71,7 @@ public class TestTCPLateralUnitTest
         ICompositeCacheManager cacheMgr = CompositeCacheManager.getInstance();
 
         // start the listener
-        LateralTCPListener listener = (LateralTCPListener) LateralTCPListener.getInstance( lac, cacheMgr );
+        LateralTCPListener<String, String> listener = (LateralTCPListener) LateralTCPListener.getInstance( lac, cacheMgr );
 
         // send to the listener
         LateralTCPSender lur = new LateralTCPSender( lac );
@@ -81,8 +81,8 @@ public class TestTCPLateralUnitTest
         for ( int i = 0; i < numMes; i++ )
         {
             String message = "adsfasasfasfasdasf";
-            CacheElement ce = new CacheElement( "test", "test", message );
-            LateralElementDescriptor led = new LateralElementDescriptor( ce );
+            CacheElement<String, String> ce = new CacheElement<String, String>( "test", "test", message );
+            LateralElementDescriptor<String, String> led = new LateralElementDescriptor<String, String>( ce );
             led.command = LateralElementDescriptor.UPDATE;
             led.requesterId = 1;
             lur.send( led );
@@ -105,7 +105,7 @@ public class TestTCPLateralUnitTest
         TCPLateralCacheAttributes lattr = new TCPLateralCacheAttributes();
         lattr.setTcpListenerPort( 1101 );
         lattr.setTransmissionTypeName( "TCP" );
-        MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> cacheMgr = new MockCompositeCacheManager<String, String>();
         System.out.println( "mock cache = " + cacheMgr.getCache( "test" ) );
 
         LateralTCPListener.getInstance( lattr, cacheMgr );
@@ -115,14 +115,14 @@ public class TestTCPLateralUnitTest
         lattr2.setTransmissionTypeName( "TCP" );
         lattr2.setTcpServer( "localhost:1101" );
 
-        LateralTCPService service = new LateralTCPService( lattr2 );
+        LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
         service.setListenerId( 123456 );
 
         // DO WORK
         int cnt = 100;
         for ( int i = 0; i < cnt; i++ )
         {
-            ICacheElement element = new CacheElement( "test", "key" + i, "value1" );
+            ICacheElement<String, String> element = new CacheElement<String, String>( "test", "key" + i, "value1" );
             service.update( element );
         }
 
@@ -145,7 +145,7 @@ public class TestTCPLateralUnitTest
         // setup a listener
         TCPLateralCacheAttributes lattr = new TCPLateralCacheAttributes();
         lattr.setTcpListenerPort( 1103 );
-        MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> cacheMgr = new MockCompositeCacheManager<String, String>();
         System.out.println( "mock cache = " + cacheMgr.getCache( "test" ) );
 
         // get the listener started
@@ -158,22 +158,22 @@ public class TestTCPLateralUnitTest
         lattr2.setTcpListenerPort( 1104 );
         lattr2.setTcpServer( "localhost:1103" );
 
-        LateralTCPService service = new LateralTCPService( lattr2 );
+        LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
         service.setListenerId( 123456 );
 
         // DO WORK
-        ICacheElement element = new CacheElement( "test", "key", "value1" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( "test", "key", "value1" );
         service.update( element );
 
         SleepUtil.sleepAtLeast( 300 );
 
-        ICacheElement element2 = new CacheElement( "test", "key", "value2" );
+        ICacheElement<String, String> element2 = new CacheElement<String, String>( "test", "key", "value2" );
         service.update( element2 );
 
         SleepUtil.sleepAtLeast( 1000 );
 
         // VERIFY
-        ICacheElement cacheElement = cacheMgr.getCache().get( "key" );
+        ICacheElement<String, String> cacheElement = cacheMgr.getCache().get( "key" );
         System.out.println( "cacheElement = " + cacheElement );
         assertEquals( "Didn't get the correct object", element2.getVal(), cacheElement.getVal() );
     }
@@ -189,7 +189,7 @@ public class TestTCPLateralUnitTest
         TCPLateralCacheAttributes lattr = new TCPLateralCacheAttributes();
         lattr.setTcpListenerPort( 1105 );
         lattr.setTransmissionTypeName( "TCP" );
-        MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> cacheMgr = new MockCompositeCacheManager<String, String>();
         System.out.println( "mock cache = " + cacheMgr.getCache( "test" ) );
 
         // get the listener started
@@ -202,23 +202,23 @@ public class TestTCPLateralUnitTest
         lattr2.setTransmissionTypeName( "TCP" );
         lattr2.setTcpServer( "localhost:1105" );
 
-        LateralTCPService service = new LateralTCPService( lattr2 );
+        LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
         service.setListenerId( 123456 );
 
         // DO WORK
         String key = "key";
-        ICacheElement element = new CacheElement( "test", key, "value1" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( "test", key, "value1" );
         service.update( element );
 
         SleepUtil.sleepAtLeast( 300 );
 
-        ICacheElement element2 = new CacheElement( "test", key, "value2" );
+        ICacheElement<String, String> element2 = new CacheElement<String, String>( "test", key, "value2" );
         service.update( element2 );
 
         SleepUtil.sleepAtLeast( 1000 );
 
         // VERIFY
-        ICacheElement cacheElement = cacheMgr.getCache().get( "key" );
+        ICacheElement<String, String> cacheElement = cacheMgr.getCache().get( "key" );
         System.out.println( "cacheElement = " + cacheElement );
         assertEquals( "Didn't get the correct object", element2.getVal(), cacheElement.getVal() );
     }
@@ -236,7 +236,7 @@ public class TestTCPLateralUnitTest
         // setup a listener
         TCPLateralCacheAttributes lattr = new TCPLateralCacheAttributes();
         lattr.setTcpListenerPort( 1107 );
-        MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager();
+        MockCompositeCacheManager<String, String> cacheMgr = new MockCompositeCacheManager<String, String>();
         System.out.println( "mock cache = " + cacheMgr.getCache( "test" ) );
 
         // get the listener started
@@ -244,7 +244,7 @@ public class TestTCPLateralUnitTest
         LateralTCPListener.getInstance( lattr, cacheMgr );
 
         // add the item to the listeners cache
-        ICacheElement element = new CacheElement( "test", "key", "value1" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( "test", "key", "value1" );
         cacheMgr.getCache().update( element );
 
         // setup a service to talk to the listener started above.
@@ -252,13 +252,13 @@ public class TestTCPLateralUnitTest
         lattr2.setTcpListenerPort( 1108 );
         lattr2.setTcpServer( "localhost:1107" );
 
-        LateralTCPService service = new LateralTCPService( lattr2 );
+        LateralTCPService<String, String> service = new LateralTCPService<String, String>( lattr2 );
         service.setListenerId( 123456 );
 
         SleepUtil.sleepAtLeast( 300 );
 
         // DO WORK
-        ICacheElement result = service.get( "test", "key" );
+        ICacheElement<String, String> result = service.get( "test", "key" );
 
         // VERIFY
         System.out.println( "testSendAndReceived, result = " + result );
@@ -279,7 +279,7 @@ public class TestTCPLateralUnitTest
         // setup a listener
         TCPLateralCacheAttributes lattr = new TCPLateralCacheAttributes();
         lattr.setTcpListenerPort( 1108 );
-        MockCompositeCacheManager cacheMgr = new MockCompositeCacheManager();
+        MockCompositeCacheManager<String, Integer> cacheMgr = new MockCompositeCacheManager<String, Integer>();
         System.out.println( "mock cache = " + cacheMgr.getCache( "test" ) );
 
         // get the listener started
@@ -292,7 +292,7 @@ public class TestTCPLateralUnitTest
         for ( int i = 0; i < numToInsertPrefix1; i++ )
         {
             // add the item to the listeners cache
-            ICacheElement element = new CacheElement( "test", keyprefix1 + String.valueOf( i ), Integer.valueOf( i ) );
+            ICacheElement<String, Integer> element = new CacheElement<String, Integer>( "test", keyprefix1 + String.valueOf( i ), Integer.valueOf( i ) );
             cacheMgr.getCache().update( element );
         }
 
@@ -301,13 +301,13 @@ public class TestTCPLateralUnitTest
         lattr2.setTcpListenerPort( 1108 );
         lattr2.setTcpServer( "localhost:1108" );
 
-        LateralTCPService service = new LateralTCPService( lattr2 );
+        LateralTCPService<String, Integer> service = new LateralTCPService<String, Integer>( lattr2 );
         service.setListenerId( 123456 );
 
         SleepUtil.sleepAtLeast( 300 );
 
         // DO WORK
-        Map result = service.getMatching( "test", keyprefix1 + ".+" );
+        Map<String, ICacheElement<String, Integer>> result = service.getMatching( "test", keyprefix1 + ".+" );
 
         // VERIFY
         System.out.println( "testSendAndReceived, result = " + result );

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -43,9 +43,9 @@ import org.apache.jcs.engine.stats.behav
  * <p>
  * @author Aaron Smuts
  */
-public class MockRemoteCacheClient
-    extends AbstractAuxiliaryCache
-    implements IRemoteCacheClient
+public class MockRemoteCacheClient<K extends Serializable, V extends Serializable>
+    extends AbstractAuxiliaryCache<K, V>
+    implements IRemoteCacheClient<K, V>
 {
     /** For serialization. Don't change. */
     private static final long serialVersionUID = 1L;
@@ -53,23 +53,24 @@ public class MockRemoteCacheClient
     /** log instance */
     private final static Log log = LogFactory.getLog( MockRemoteCacheClient.class );
 
-    /** List of ICacheElement objects passed into update. */
-    public List updateList = new LinkedList();
+    /** List of ICacheElement<K, V> objects passed into update. */
+    public List<ICacheElement<K, V>> updateList = new LinkedList<ICacheElement<K,V>>();
 
     /** List of key objects passed into remove. */
-    public List removeList = new LinkedList();
+    public List<K> removeList = new LinkedList<K>();
 
     /** status to return. */
     public int status = CacheConstants.STATUS_ALIVE;
 
-    /** Can setup values to return from get. values must be ICacheElement */
-    public Map getSetupMap = new HashMap();
+    /** Can setup values to return from get. values must be ICacheElement<K, V> */
+    public Map<K, ICacheElement<K, V>> getSetupMap = new HashMap<K, ICacheElement<K,V>>();
 
-    /** Can setup values to return from get. values must be Map<Serializable, ICacheElement> */
-    public Map getMultipleSetupMap = new HashMap();
+    /** Can setup values to return from get. values must be Map<K, ICacheElement<K, V>> */
+    public Map<Set<K>, Map<K, ICacheElement<K, V>>> getMultipleSetupMap =
+        new HashMap<Set<K>, Map<K,ICacheElement<K,V>>>();
 
     /** The last service passed to fixCache */
-    public IRemoteCacheService fixed;
+    public IRemoteCacheService<K, V> fixed;
 
     /** Attributes. */
     public RemoteCacheAttributes attributes = new RemoteCacheAttributes();
@@ -80,9 +81,9 @@ public class MockRemoteCacheClient
      * (non-Javadoc)
      * @see org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheClient#fixCache(org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService)
      */
-    public void fixCache( IRemoteCacheService remote )
+    public void fixCache( IRemoteCacheService<?, ?> remote )
     {
-        fixed = remote;
+        fixed = (IRemoteCacheService<K, V>)remote;
     }
 
     /**
@@ -96,7 +97,7 @@ public class MockRemoteCacheClient
     /**
      * @return null
      */
-    public IRemoteCacheListener getListener()
+    public IRemoteCacheListener<K, V> getListener()
     {
         return null;
     }
@@ -107,7 +108,7 @@ public class MockRemoteCacheClient
      * (non-Javadoc)
      * @see org.apache.jcs.auxiliary.AuxiliaryCache#update(org.apache.jcs.engine.behavior.ICacheElement)
      */
-    public void update( ICacheElement ce )
+    public void update( ICacheElement<K, V> ce )
     {
         updateList.add( ce );
     }
@@ -118,23 +119,23 @@ public class MockRemoteCacheClient
      * (non-Javadoc)
      * @see org.apache.jcs.auxiliary.AuxiliaryCache#get(java.io.Serializable)
      */
-    public ICacheElement get( Serializable key )
+    public ICacheElement<K, V> get( K key )
     {
         log.info( "get [" + key + "]" );
-        return (ICacheElement) getSetupMap.get( key );
+        return getSetupMap.get( key );
     }
 
     /**
      * Gets multiple items from the cache based on the given set of keys.
      * <p>
      * @param keys
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache for any of these keys
      */
-    public Map<Serializable, ICacheElement> getMultiple(Set<Serializable> keys)
+    public Map<K, ICacheElement<K, V>> getMultiple(Set<K> keys)
     {
         log.info( "get [" + keys + "]" );
-        return (Map) getMultipleSetupMap.get( keys );
+        return getMultipleSetupMap.get( keys );
     }
 
     /**
@@ -143,7 +144,7 @@ public class MockRemoteCacheClient
      * (non-Javadoc)
      * @see org.apache.jcs.auxiliary.AuxiliaryCache#remove(java.io.Serializable)
      */
-    public boolean remove( Serializable key )
+    public boolean remove( K key )
     {
         removeList.add( key );
         return false;
@@ -198,7 +199,7 @@ public class MockRemoteCacheClient
      * @param group
      * @return null
      */
-    public Set<Serializable> getGroupKeys( String group )
+    public Set<K> getGroupKeys( String group )
     {
         return null;
     }
@@ -243,10 +244,10 @@ public class MockRemoteCacheClient
      * @return Map
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMatching(String pattern)
+    public Map<K, ICacheElement<K, V>> getMatching(String pattern)
         throws IOException
     {
-        return new HashMap();
+        return new HashMap<K, ICacheElement<K,V>>();
     }
 
     /**

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

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheListener.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheListener.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheListener.java Wed May 30 18:14:43 2012
@@ -33,8 +33,8 @@ import org.apache.jcs.engine.behavior.IC
  * <p>
  * @author Aaron Smuts
  */
-public class MockRemoteCacheListener
-    implements IRemoteCacheListener
+public class MockRemoteCacheListener<K extends Serializable, V extends Serializable>
+    implements IRemoteCacheListener<K, V>
 {
     /** Setup the listener id that this will return. */
     private long listenerId;
@@ -46,10 +46,10 @@ public class MockRemoteCacheListener
     public int putCount;
 
     /** List of ICacheElements passed to handlePut. */
-    public List putItems = new LinkedList();
+    public List<ICacheElement<K, V>> putItems = new LinkedList<ICacheElement<K,V>>();
 
     /** List of Serializable objects passed to handleRemove. */
-    public List removedKeys = new LinkedList();
+    public List<K> removedKeys = new LinkedList<K>();
 
     /** Number of times handleRemote was called. */
     public int removeCount;
@@ -127,7 +127,7 @@ public class MockRemoteCacheListener
      * @param item
      * @throws IOException
      */
-    public void handlePut( ICacheElement item )
+    public void handlePut( ICacheElement<K, V> item )
         throws IOException
     {
         putCount++;
@@ -141,7 +141,7 @@ public class MockRemoteCacheListener
      * @param key
      * @throws IOException
      */
-    public void handleRemove( String cacheName, Serializable key )
+    public void handleRemove( String cacheName, K key )
         throws IOException
     {
         removeCount++;

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

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -34,8 +34,8 @@ import org.apache.jcs.engine.behavior.IC
 /**
  * This is a mock impl of the remote cache service.
  */
-public class MockRemoteCacheService
-    implements IRemoteCacheService
+public class MockRemoteCacheService<K extends Serializable, V extends Serializable>
+    implements IRemoteCacheService<K, V>
 {
     /** The key last passed to get */
     public Serializable lastGetKey;
@@ -44,19 +44,19 @@ public class MockRemoteCacheService
     public String lastGetMatchingPattern;
 
     /** The keya last passed to getMatching */
-    public Set<Serializable> lastGetMultipleKeys;
+    public Set<K> lastGetMultipleKeys;
 
     /** The object that was last passed to update. */
-    public Object lastUpdate;
+    public ICacheElement<K, V> lastUpdate;
 
     /** List of updates. */
-    public List<ICacheElement> updateRequestList = new ArrayList<ICacheElement>();
+    public List<ICacheElement<K, V>> updateRequestList = new ArrayList<ICacheElement<K,V>>();
 
     /** List of request ids. */
     public List<Long> updateRequestIdList = new ArrayList<Long>();
 
     /** The key that was last passed to remove. */
-    public Object lastRemoveKey;
+    public K lastRemoveKey;
 
     /** The cache name that was last passed to removeAll. */
     public String lastRemoveAllCacheName;
@@ -67,7 +67,7 @@ public class MockRemoteCacheService
      * @param requesterId
      * @return null
      */
-    public ICacheElement get( String cacheName, Serializable key, long requesterId )
+    public ICacheElement<K, V> get( String cacheName, K key, long requesterId )
     {
         lastGetKey = key;
         return null;
@@ -78,9 +78,9 @@ public class MockRemoteCacheService
      * @param groupName
      * @return empty set
      */
-    public Set<Serializable> getGroupKeys( String cacheName, String groupName )
+    public Set<K> getGroupKeys( String cacheName, String groupName )
     {
-        return new HashSet<Serializable>();
+        return new HashSet<K>();
     }
 
     /**
@@ -90,7 +90,7 @@ public class MockRemoteCacheService
      * @param key
      * @param requesterId
      */
-    public void remove( String cacheName, Serializable key, long requesterId )
+    public void remove( String cacheName, K key, long requesterId )
     {
         lastRemoveKey = key;
     }
@@ -114,7 +114,7 @@ public class MockRemoteCacheService
      * @param item
      * @param requesterId
      */
-    public void update( ICacheElement item, long requesterId )
+    public void update( ICacheElement<K, V> item, long requesterId )
     {
         lastUpdate = item;
         updateRequestList.add( item );
@@ -136,7 +136,7 @@ public class MockRemoteCacheService
      * @param key
      * @return null
      */
-    public ICacheElement get( String cacheName, Serializable key )
+    public ICacheElement<K, V> get( String cacheName, K key )
     {
         return get( cacheName, key, 0 );
     }
@@ -155,7 +155,7 @@ public class MockRemoteCacheService
      * @param cacheName
      * @param key
      */
-    public void remove( String cacheName, Serializable key )
+    public void remove( String cacheName, K key )
     {
         lastRemoveKey = key;
     }
@@ -175,7 +175,7 @@ public class MockRemoteCacheService
      * <p>
      * @param item
      */
-    public void update( ICacheElement item )
+    public void update( ICacheElement<K, V> item )
     {
         lastUpdate = item;
     }
@@ -186,10 +186,10 @@ public class MockRemoteCacheService
      * @param requesterId
      * @return empty map
      */
-    public Map<Serializable, ICacheElement> getMultiple( String cacheName, Set<Serializable> keys, long requesterId )
+    public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys, long requesterId )
     {
         lastGetMultipleKeys = keys;
-        return new HashMap<Serializable, ICacheElement>();
+        return new HashMap<K, ICacheElement<K, V>>();
     }
 
     /**
@@ -197,7 +197,7 @@ public class MockRemoteCacheService
      * @param keys
      * @return empty map
      */
-    public Map<Serializable, ICacheElement> getMultiple( String cacheName, Set<Serializable> keys )
+    public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys )
     {
         return getMultiple( cacheName, keys, 0 );
     }
@@ -210,7 +210,7 @@ public class MockRemoteCacheService
      * @return an empty map
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMatching( String cacheName, String pattern )
+    public Map<K, ICacheElement<K, V>> getMatching( String cacheName, String pattern )
         throws IOException
     {
         return getMatching( cacheName, pattern, 0 );
@@ -223,10 +223,10 @@ public class MockRemoteCacheService
      * @return Map
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMatching( String cacheName, String pattern, long requesterId )
+    public Map<K, ICacheElement<K, V>> getMatching( String cacheName, String pattern, long requesterId )
         throws IOException
     {
         lastGetMatchingPattern = pattern;
-        return new HashMap<Serializable, ICacheElement>();
+        return new HashMap<K, ICacheElement<K, V>>();
     }
 }

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

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -20,7 +20,6 @@ package org.apache.jcs.auxiliary.remote;
  */
 
 import java.io.IOException;
-import java.io.Serializable;
 import java.net.MalformedURLException;
 import java.rmi.Naming;
 import java.rmi.NotBoundException;
@@ -42,13 +41,13 @@ import org.apache.jcs.engine.behavior.IC
  * Manual tester.
  */
 public class RemoteCacheClientTester
-    implements IRemoteCacheListener, IRemoteCacheConstants, Remote
+    implements IRemoteCacheListener<String, String>, IRemoteCacheConstants, Remote
 {
     /** the observer */
     protected ICacheObserver watch;
 
     /** the service */
-    protected ICacheService cache;
+    protected ICacheService<String, String> cache;
 
     /** The registry host name. */
     final String host;
@@ -65,7 +64,7 @@ public class RemoteCacheClientTester
     /**
      * Gets the remoteType attribute of the RemoteCacheClientTest object
      * @return The remoteType value
-     * @throws IOException 
+     * @throws IOException
      */
     public int getRemoteType()
         throws IOException
@@ -129,7 +128,6 @@ public class RemoteCacheClientTester
             // incoming calls,
             // using an anonymous port.
             UnicastRemoteObject.exportObject( this );
-            ee = null;
         }
         catch ( ExportException e )
         {
@@ -151,17 +149,17 @@ public class RemoteCacheClientTester
 
         p( "server found" );
 
-        cache = (ICacheService) obj;
+        cache = (ICacheService<String, String>) obj;
         watch = (ICacheObserver) obj;
 
         p( "subscribing to the server" );
 
         watch.addCacheListener( "testCache", this );
-        ICacheElement cb = new CacheElement( "testCache", "testKey", "testVal" );
+        ICacheElement<String, String> cb = new CacheElement<String, String>( "testCache", "testKey", "testVal" );
 
         for ( int i = 0; i < count; i++ )
         {
-            cb = new CacheElement( "testCache", "" + i, "" + i );
+            cb = new CacheElement<String, String>( "testCache", "" + i, "" + i );
 
             if ( delete )
             {
@@ -201,7 +199,7 @@ public class RemoteCacheClientTester
      * @param cb
      * @throws IOException
      */
-    public void handlePut( ICacheElement cb )
+    public void handlePut( ICacheElement<String, String> cb )
         throws IOException
     {
         p( "handlePut> cb=" + cb );
@@ -212,7 +210,7 @@ public class RemoteCacheClientTester
      * @param key
      * @throws IOException
      */
-    public void handleRemove( String cacheName, Serializable key )
+    public void handleRemove( String cacheName, String key )
         throws IOException
     {
         p( "handleRemove> cacheName=" + cacheName + ", key=" + key );

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=1344374&r1=1344373&r2=1344374&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 Wed May 30 18:14:43 2012
@@ -24,6 +24,7 @@ import junit.framework.TestCase;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.jcs.engine.CacheElementSerialized;
 import org.apache.jcs.engine.ElementAttributes;
+import org.apache.jcs.engine.behavior.ICache;
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.behavior.ICacheElementSerialized;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
@@ -53,8 +54,8 @@ public class RemoteCacheListenerUnitTest
         // SETUP
         IRemoteCacheAttributes irca = new RemoteCacheAttributes();
         irca.setRemoveUponRemotePut( false );
-        ICompositeCacheManager cacheMgr = new MockCompositeCacheManager();
-        RemoteCacheListener listener = new RemoteCacheListener( irca, cacheMgr );
+        ICompositeCacheManager cacheMgr = new MockCompositeCacheManager<String, String>();
+        RemoteCacheListener<String, String> listener = new RemoteCacheListener<String, String>( irca, cacheMgr );
 
         String cacheName = "testName";
         String key = "key";
@@ -64,14 +65,16 @@ public class RemoteCacheListenerUnitTest
 
         IElementSerializer elementSerializer = new StandardSerializer();
 
-        ICacheElementSerialized element = new CacheElementSerialized( cacheName, key, elementSerializer
+        ICacheElementSerialized<String, String> element =
+            new CacheElementSerialized<String, String>( cacheName, key, elementSerializer
             .serialize( value ), attr );
-        
+
         // DO WORK
         listener.handlePut( element );
 
         // VERIFY
-        ICacheElement after = cacheMgr.getCache( cacheName ).get( key );
+        ICache<String, String> cache = cacheMgr.getCache( cacheName );
+        ICacheElement<String, String> after = cache.get( key );
 
         assertNotNull( "Should have a deserialized object.", after );
         assertEquals( "Values should be the same.", value, after.getVal() );
@@ -94,8 +97,8 @@ public class RemoteCacheListenerUnitTest
         // SETUP
         IRemoteCacheAttributes irca = new RemoteCacheAttributes();
         irca.setRemoveUponRemotePut( true );
-        ICompositeCacheManager cacheMgr = new MockCompositeCacheManager();
-        RemoteCacheListener listener = new RemoteCacheListener( irca, cacheMgr );
+        ICompositeCacheManager cacheMgr = new MockCompositeCacheManager<String, String>();
+        RemoteCacheListener<String, String> listener = new RemoteCacheListener<String, String>( irca, cacheMgr );
 
         String cacheName = "testName";
         String key = "key";
@@ -105,14 +108,16 @@ public class RemoteCacheListenerUnitTest
 
         IElementSerializer elementSerializer = new StandardSerializer();
 
-        ICacheElementSerialized element = new CacheElementSerialized( cacheName, key, elementSerializer
+        ICacheElementSerialized<String, String> element =
+            new CacheElementSerialized<String, String>( cacheName, key, elementSerializer
             .serialize( value ), attr );
-        
+
         // DO WORK
         listener.handlePut( element );
 
         // VERIFY
-        ICacheElement after = cacheMgr.getCache( cacheName ).get( key );
+        ICache<String, String> cache = cacheMgr.getCache( cacheName );
+        ICacheElement<String, String> after = cache.get( key );
 
         assertNull( "Should not have a deserialized object since remove on put is true.", after );
     }

Modified: commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java (original)
+++ commons/proper/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java Wed May 30 18:14:43 2012
@@ -39,7 +39,7 @@ import org.apache.jcs.utils.timing.Sleep
  */
 public class RemoteCacheNoWaitUnitTest
     extends TestCase
-{   
+{
     /**
      * Simply verify that the client gets updated via the no wait.
      * <p>
@@ -49,10 +49,10 @@ public class RemoteCacheNoWaitUnitTest
         throws Exception
     {
         // SETUP
-        MockRemoteCacheClient client = new MockRemoteCacheClient();
-        RemoteCacheNoWait noWait = new RemoteCacheNoWait( client );
+        MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>();
+        RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client );
 
-        ICacheElement element = new CacheElement( "testUpdate", "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( "testUpdate", "key", "value" );
 
         // DO WORK
         noWait.update( element );
@@ -73,14 +73,14 @@ public class RemoteCacheNoWaitUnitTest
         throws Exception
     {
         // SETUP
-        MockRemoteCacheClient client = new MockRemoteCacheClient();
-        RemoteCacheNoWait noWait = new RemoteCacheNoWait( client );
+        MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>();
+        RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client );
 
-        ICacheElement input = new CacheElement( "testUpdate", "key", "value" );
+        ICacheElement<String, String> input = new CacheElement<String, String>( "testUpdate", "key", "value" );
         client.getSetupMap.put( "key", input );
 
         // DO WORK
-        ICacheElement result = noWait.get( "key" );
+        ICacheElement<String, String> result = noWait.get( "key" );
 
         // VERIFY
         assertEquals( "Wrong element", input, result );
@@ -95,20 +95,20 @@ public class RemoteCacheNoWaitUnitTest
         throws Exception
     {
         // SETUP
-        MockRemoteCacheClient client = new MockRemoteCacheClient();
-        RemoteCacheNoWait noWait = new RemoteCacheNoWait( client );
+        MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>();
+        RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client );
 
-        ICacheElement inputElement = new CacheElement( "testUpdate", "key", "value" );
-        Map inputMap = new HashMap();
+        ICacheElement<String, String> inputElement = new CacheElement<String, String>( "testUpdate", "key", "value" );
+        Map<String, ICacheElement<String, String>> inputMap = new HashMap<String, ICacheElement<String,String>>();
         inputMap.put( "key", inputElement );
 
-        Set keys = new HashSet();
+        Set<String> keys = new HashSet<String>();
         keys.add( "key" );
 
         client.getMultipleSetupMap.put( keys, inputMap );
 
         // DO WORK
-        Map result = noWait.getMultiple( keys );
+        Map<String, ICacheElement<String, String>> result = noWait.getMultiple( keys );
 
         // VERIFY
         assertEquals( "elements map", inputMap, result );
@@ -123,8 +123,8 @@ public class RemoteCacheNoWaitUnitTest
         throws Exception
     {
         // SETUP
-        MockRemoteCacheClient client = new MockRemoteCacheClient();
-        RemoteCacheNoWait noWait = new RemoteCacheNoWait( client );
+        MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>();
+        RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client );
 
         String input = "MyKey";
 
@@ -147,9 +147,9 @@ public class RemoteCacheNoWaitUnitTest
         throws Exception
     {
         // SETUP
-        MockRemoteCacheClient client = new MockRemoteCacheClient();
+        MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>();
         client.status = CacheConstants.STATUS_ALIVE;
-        RemoteCacheNoWait noWait = new RemoteCacheNoWait( client );
+        RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client );
 
         // DO WORK
         String result = noWait.getStats();
@@ -167,9 +167,9 @@ public class RemoteCacheNoWaitUnitTest
         throws Exception
     {
         // SETUP
-        MockRemoteCacheClient client = new MockRemoteCacheClient();
+        MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>();
         client.status = CacheConstants.STATUS_ERROR;
-        RemoteCacheNoWait noWait = new RemoteCacheNoWait( client );
+        RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client );
 
         // DO WORK
         int result = noWait.getStatus();
@@ -188,24 +188,24 @@ public class RemoteCacheNoWaitUnitTest
         throws Exception
     {
         // SETUP
-        MockRemoteCacheClient client = new MockRemoteCacheClient();
+        MockRemoteCacheClient<String, String> client = new MockRemoteCacheClient<String, String>();
         client.status = CacheConstants.STATUS_ALIVE;
-        RemoteCacheNoWait noWait = new RemoteCacheNoWait( client );
+        RemoteCacheNoWait<String, String> noWait = new RemoteCacheNoWait<String, String>( client );
 
-        MockRemoteCacheService service = new MockRemoteCacheService();
+        MockRemoteCacheService<String, String> service = new MockRemoteCacheService<String, String>();
 
-        ICacheElement element = new CacheElement( "testUpdate", "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( "testUpdate", "key", "value" );
 
         // DO WORK
         noWait.update( element );
         SleepUtil.sleepAtLeast( 10 );
-        ICacheEventQueue originalQueue = noWait.getCacheEventQueue();
+        ICacheEventQueue<String, String> originalQueue = noWait.getCacheEventQueue();
 
         noWait.fixCache( service );
 
         noWait.update( element );
         SleepUtil.sleepAtLeast( 10 );
-        ICacheEventQueue newQueue = noWait.getCacheEventQueue();
+        ICacheEventQueue<String, String> newQueue = noWait.getCacheEventQueue();
 
         // VERIFY
         assertEquals( "Wrong status", service, client.fixed );



Mime
View raw message