commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1299873 [2/3] - in /commons/proper/jcs/branches/generics-interface/src: java/org/apache/jcs/ java/org/apache/jcs/access/ java/org/apache/jcs/access/behavior/ java/org/apache/jcs/auxiliary/disk/block/ java/org/apache/jcs/auxiliary/disk/inde...
Date Mon, 12 Mar 2012 21:21:05 GMT
Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java Mon Mar 12 21:21:03 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,13 +74,13 @@ 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" );
@@ -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/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java Mon Mar 12 21:21:03 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<String, String> 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 ) );

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java Mon Mar 12 21:21:03 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<String, String> 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<String, String> element2 = new CacheElement( region, keyToNotBeRemovedOnPut, dataToPassHashCodeCompare );
+        ICacheElement<String, Serializable> element2 = new CacheElement<String, Serializable>( region, keyToNotBeRemovedOnPut, dataToPassHashCodeCompare );
         service.update( element2 );
 
         /*
@@ -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/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java Mon Mar 12 21:21:03 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<String, String> 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<String, String> 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<String, String> 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/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java Mon Mar 12 21:21:03 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<String, String> 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,16 +158,16 @@ 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<String, String> element = new CacheElement( "test", "key", "value1" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( "test", "key", "value1" );
         service.update( element );
 
         SleepUtil.sleepAtLeast( 300 );
 
-        ICacheElement<String, String> element2 = new CacheElement( "test", "key", "value2" );
+        ICacheElement<String, String> element2 = new CacheElement<String, String>( "test", "key", "value2" );
         service.update( element2 );
 
         SleepUtil.sleepAtLeast( 1000 );
@@ -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,17 +202,17 @@ 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<String, String> element = new CacheElement( "test", key, "value1" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( "test", key, "value1" );
         service.update( element );
 
         SleepUtil.sleepAtLeast( 300 );
 
-        ICacheElement<String, String> element2 = new CacheElement( "test", key, "value2" );
+        ICacheElement<String, String> element2 = new CacheElement<String, String>( "test", key, "value2" );
         service.update( element2 );
 
         SleepUtil.sleepAtLeast( 1000 );
@@ -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<String, String> 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,7 +252,7 @@ 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 );
@@ -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<String, String> 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/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java Mon Mar 12 21:21:03 2012
@@ -81,9 +81,9 @@ public class MockRemoteCacheClient<K ext
      * (non-Javadoc)
      * @see org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheClient#fixCache(org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService)
      */
-    public void fixCache( IRemoteCacheService<K, V> remote )
+    public void fixCache( IRemoteCacheService<?, ?> remote )
     {
-        fixed = remote;
+        fixed = (IRemoteCacheService<K, V>)remote;
     }
 
     /**

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java Mon Mar 12 21:21:03 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<String, String> element = new CacheElement( "testUpdate", "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( "testUpdate", "key", "value" );
 
         // DO WORK
         noWait.update( element );
@@ -73,10 +73,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<String, String> input = new CacheElement( "testUpdate", "key", "value" );
+        ICacheElement<String, String> input = new CacheElement<String, String>( "testUpdate", "key", "value" );
         client.getSetupMap.put( "key", input );
 
         // DO WORK
@@ -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<String, String> 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<String, String> 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 );

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheUnitTest.java Mon Mar 12 21:21:03 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<String, String> 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<String, String> result = SerializationConversionUtil
-            .getDeSerializedCacheElement( (ICacheElementSerialized) service.lastUpdate, remoteCache
+            .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<String, String> 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<String, String> result = SerializationConversionUtil
-            .getDeSerializedCacheElement( (ICacheElementSerialized) service.lastUpdate, remoteCache
+            .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<String, String> 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/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java Mon Mar 12 21:21:03 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 );
 
@@ -108,13 +108,13 @@ public class TestRemoteCache
         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/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java Mon Mar 12 21:21:03 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<String, String> 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<String, String> 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/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java Mon Mar 12 21:21:03 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 );
@@ -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,8 +82,8 @@ public class RemoteHttpCacheClientUnitTe
         String cacheName = "test";
         String key = "key";
 
-        ICacheElement<String, String> 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;
@@ -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<String, String> 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<String, String> 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<String, String> 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/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java Mon Mar 12 21:21:03 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<String, String> 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<String, String> 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<String, String> 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/branches/generics-interface/src/test/org/apache/jcs/engine/CacheEventQueueFactoryUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/CacheEventQueueFactoryUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/CacheEventQueueFactoryUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/CacheEventQueueFactoryUnitTest.java Mon Mar 12 21:21:03 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/branches/generics-interface/src/test/org/apache/jcs/engine/MockCacheEventQueue.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/MockCacheEventQueue.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/MockCacheEventQueue.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/MockCacheEventQueue.java Mon Mar 12 21:21:03 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 );
     }
 }

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/ZombieCacheServiceNonLocalUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/ZombieCacheServiceNonLocalUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/ZombieCacheServiceNonLocalUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/ZombieCacheServiceNonLocalUnitTest.java Mon Mar 12 21:21:03 2012
@@ -38,14 +38,14 @@ public class ZombieCacheServiceNonLocalU
         throws Exception
     {
         // SETUP
-        MockCacheServiceNonLocal service = new MockCacheServiceNonLocal();
+        MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
 
-        ZombieCacheServiceNonLocal zombie = new ZombieCacheServiceNonLocal( 10 );
+        ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
 
         String cacheName = "testUpdate";
 
         // DO WORK
-        ICacheElement<String, String> element = new CacheElement( cacheName, "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
         zombie.update( element, 123l );
         zombie.propagateEvents( service );
 
@@ -62,14 +62,14 @@ public class ZombieCacheServiceNonLocalU
         throws Exception
     {
         // SETUP
-        MockCacheServiceNonLocal service = new MockCacheServiceNonLocal();
+        MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
 
-        ZombieCacheServiceNonLocal zombie = new ZombieCacheServiceNonLocal( 0 );
+        ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 0 );
 
         String cacheName = "testUpdate";
 
         // DO WORK
-        ICacheElement<String, String> element = new CacheElement( cacheName, "key", "value" );
+        ICacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key", "value" );
         zombie.update( element, 123l );
         zombie.propagateEvents( service );
 
@@ -86,9 +86,9 @@ public class ZombieCacheServiceNonLocalU
         throws Exception
     {
         // SETUP
-        MockCacheServiceNonLocal service = new MockCacheServiceNonLocal();
+        MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
 
-        ZombieCacheServiceNonLocal zombie = new ZombieCacheServiceNonLocal( 10 );
+        ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
 
         String cacheName = "testRemoveThenWalk";
         String key = "myKey";
@@ -110,9 +110,9 @@ public class ZombieCacheServiceNonLocalU
         throws Exception
     {
         // SETUP
-        MockCacheServiceNonLocal service = new MockCacheServiceNonLocal();
+        MockCacheServiceNonLocal<String, String> service = new MockCacheServiceNonLocal<String, String>();
 
-        ZombieCacheServiceNonLocal zombie = new ZombieCacheServiceNonLocal( 10 );
+        ZombieCacheServiceNonLocal<String, String> zombie = new ZombieCacheServiceNonLocal<String, String>( 10 );
 
         String cacheName = "testRemoveThenWalk";
 

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/CacheManagerStatsUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/CacheManagerStatsUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/CacheManagerStatsUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/CacheManagerStatsUnitTest.java Mon Mar 12 21:21:03 2012
@@ -19,11 +19,11 @@ package org.apache.jcs.engine.control;
  * under the License.
  */
 
+import junit.framework.TestCase;
+
 import org.apache.jcs.JCS;
 import org.apache.jcs.engine.stats.behavior.ICacheStats;
 
-import junit.framework.TestCase;
-
 /**
  * @author Aaron Smuts
  *
@@ -39,7 +39,7 @@ public class CacheManagerStatsUnitTest
      */
     public void testSimpleGetStats() throws Exception
     {
-        JCS cache = JCS.getInstance( "testCache1" );
+        JCS<String, String> cache = JCS.getInstance( "testCache1" );
 
         // 1 miss, 1 hit, 1 put
         cache.get( "testKey" );

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/CompositeCacheConfiguratorUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/CompositeCacheConfiguratorUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/CompositeCacheConfiguratorUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/CompositeCacheConfiguratorUnitTest.java Mon Mar 12 21:21:03 2012
@@ -41,10 +41,11 @@ public class CompositeCacheConfiguratorU
 
         CompositeCacheConfigurator configurator = new CompositeCacheConfigurator( manager );
 
-        CompositeCache cache = new CompositeCache( regionName, new CompositeCacheAttributes(), new ElementAttributes() );
+        CompositeCache<String, String> cache =
+            new CompositeCache<String, String>( regionName, new CompositeCacheAttributes(), new ElementAttributes() );
 
         // DO WORK
-        MockAuxiliaryCache result = (MockAuxiliaryCache) configurator
+        MockAuxiliaryCache<String, String> result = (MockAuxiliaryCache<String, String>) configurator
             .parseAuxiliary( cache, props, auxName, regionName );
 
         // VERIFY
@@ -71,7 +72,7 @@ public class CompositeCacheConfiguratorU
         manager.configure( props );
 
         // VERIFY
-        CompositeCache cache = manager.getCache( regionName );
+        CompositeCache<String, String> cache = manager.getCache( regionName );
         assertEquals( "Wrong chunkSize", cache.getCacheAttributes().getSpoolChunkSize(), chunkSize );
     }
 }



Mime
View raw message