[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/eviction ...

Manik Surtani msurtani at jboss.com
Sat Dec 30 14:48:46 EST 2006


  User: msurtani
  Date: 06/12/30 14:48:46

  Modified:    tests/functional/org/jboss/cache/eviction        
                        ElementSizePolicyTest.java
                        ConcurrentEvictionTest.java FIFOPolicyTest.java
                        LFUPolicyTest.java MRUPolicyTest.java
                        LRUPolicyTest.java ProgrammaticLRUPolicyTest.java
                        ExpirationPolicyTest.java
  Log:
  Genericised, autoboxed
  
  Revision  Changes    Path
  1.11      +3 -3      JBossCache/tests/functional/org/jboss/cache/eviction/ElementSizePolicyTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ElementSizePolicyTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/ElementSizePolicyTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- ElementSizePolicyTest.java	30 Dec 2006 17:49:58 -0000	1.10
  +++ ElementSizePolicyTest.java	30 Dec 2006 19:48:45 -0000	1.11
  @@ -150,7 +150,7 @@
   
         for (int i = 0; i < 17; i++)
         {
  -         cache.put("/org/jboss/data/" + Integer.toString(3), new Integer(100 + i), "value");
  +         cache.put("/org/jboss/data/" + Integer.toString(3), 100 + i, "value");
         }
   
         Node node = cache.get("/org/jboss/data/" + Integer.toString(3));
  @@ -175,7 +175,7 @@
            {
               try
               {
  -               cache.put(myName + i++, "value", new Integer(i));
  +               cache.put(myName + i++, "value", i);
                  sleep(1);
               }
               catch (Throwable e)
  @@ -196,7 +196,7 @@
         cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
   
         cache.start();
  -      cache.put(ROOT_STR + "/concurrentPutAndEvict", "value", new Integer(1));
  +      cache.put(ROOT_STR + "/concurrentPutAndEvict", "value", 1);
   
         for (int i = 0; i < 10; i++)
         {
  
  
  
  1.7       +4 -4      JBossCache/tests/functional/org/jboss/cache/eviction/ConcurrentEvictionTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConcurrentEvictionTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/ConcurrentEvictionTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- ConcurrentEvictionTest.java	30 Dec 2006 17:49:58 -0000	1.6
  +++ ConcurrentEvictionTest.java	30 Dec 2006 19:48:45 -0000	1.7
  @@ -19,7 +19,7 @@
    * Tests cache behavior in the presence of concurrent passivation.
    *
    * @author Brian Stansberry
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
    */
   public class ConcurrentEvictionTest extends TestCase
   {
  @@ -66,7 +66,7 @@
         // region's maxNodes so we know eviction will kick in
         for (int i = 0; i < 1000; i++)
         {
  -         cache_.put(new Fqn(base, new Integer(i / 100)), new Integer(i), "value");
  +         cache_.put(new Fqn(base, i / 100), new Integer(i), "value");
         }
   
         // Loop for long enough to have 5 runs of the eviction thread
  @@ -76,8 +76,8 @@
            // If any get returns null, that's a failure
            for (int i = 0; i < 1000; i++)
            {
  -            Fqn fqn = new Fqn(base, new Integer(i / 100));
  -            Integer key = new Integer(i);
  +            Fqn fqn = new Fqn(base, i / 100);
  +            Integer key = i;
               assertNotNull("found value under Fqn " + fqn + " and key " + key,
                       cache_.get(fqn, key));
            }
  
  
  
  1.12      +3 -3      JBossCache/tests/functional/org/jboss/cache/eviction/FIFOPolicyTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FIFOPolicyTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/FIFOPolicyTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- FIFOPolicyTest.java	30 Dec 2006 17:49:58 -0000	1.11
  +++ FIFOPolicyTest.java	30 Dec 2006 19:48:45 -0000	1.12
  @@ -17,7 +17,7 @@
    * Unit tests for FIFOPolicy.
    *
    * @author Daniel Huang (dhuang at jboss.org)
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    */
   public class FIFOPolicyTest extends TestCase
   {
  @@ -272,7 +272,7 @@
            {
               try
               {
  -               cache.put(myName + i++, "value", new Integer(i));
  +               cache.put(myName + i++, "value", i);
                  sleep(1);
               }
               catch (Throwable e)
  @@ -292,7 +292,7 @@
         cache.destroy();
         cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
         cache.start();
  -      cache.put(ROOT_STR + "/concurrentPutAndEvict", "value", new Integer(1));
  +      cache.put(ROOT_STR + "/concurrentPutAndEvict", "value", 1);
   
         for (int i = 0; i < 10; i++)
         {
  
  
  
  1.10      +3 -3      JBossCache/tests/functional/org/jboss/cache/eviction/LFUPolicyTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LFUPolicyTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/LFUPolicyTest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- LFUPolicyTest.java	30 Dec 2006 17:49:58 -0000	1.9
  +++ LFUPolicyTest.java	30 Dec 2006 19:48:45 -0000	1.10
  @@ -18,7 +18,7 @@
    * Unit tests for LFU Policy.
    *
    * @author Daniel Huang (dhuang at jboss.org)
  - * @version $Revision: 1.9 $
  + * @version $Revision: 1.10 $
    */
   public class LFUPolicyTest extends TestCase
   {
  @@ -294,7 +294,7 @@
            {
               try
               {
  -               cache.put(myName + i++, "value", new Integer(i));
  +               cache.put(myName + i++, "value", i);
                  sleep(1);
               }
               catch (Throwable e)
  @@ -314,7 +314,7 @@
         cache.destroy();
         cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
         cache.start();
  -      cache.put(ROOT_STR + "/concurrentPutAndEvict", "value", new Integer(1));
  +      cache.put(ROOT_STR + "/concurrentPutAndEvict", "value", 1);
   
         for (int i = 0; i < 10; i++)
         {
  
  
  
  1.12      +3 -3      JBossCache/tests/functional/org/jboss/cache/eviction/MRUPolicyTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MRUPolicyTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/MRUPolicyTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- MRUPolicyTest.java	30 Dec 2006 17:49:58 -0000	1.11
  +++ MRUPolicyTest.java	30 Dec 2006 19:48:45 -0000	1.12
  @@ -16,7 +16,7 @@
    * Unit tests for MRUPolicy.
    *
    * @author Daniel Huang (dhuang at jboss.org)
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    */
   public class MRUPolicyTest extends TestCase
   {
  @@ -123,7 +123,7 @@
            {
               try
               {
  -               cache.put(myName + i++, "value", new Integer(i));
  +               cache.put(myName + i++, "value", i);
                  TestingUtil.sleepThread(1);
               }
               catch (Throwable e)
  @@ -143,7 +143,7 @@
         cache.destroy();
         cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
         cache.start();
  -      cache.put(ROOT_STR + "/concurrentPutAndEvict", "value", new Integer(1));
  +      cache.put(ROOT_STR + "/concurrentPutAndEvict", "value", 1);
   
         for (int i = 0; i < 10; i++)
         {
  
  
  
  1.21      +3 -3      JBossCache/tests/functional/org/jboss/cache/eviction/LRUPolicyTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LRUPolicyTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/LRUPolicyTest.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -b -r1.20 -r1.21
  --- LRUPolicyTest.java	30 Dec 2006 17:49:58 -0000	1.20
  +++ LRUPolicyTest.java	30 Dec 2006 19:48:45 -0000	1.21
  @@ -14,7 +14,7 @@
    *
    * @author Ben Wang, Feb 11, 2004
    * @author Daniel Huang - dhuang at jboss.org
  - * @version $Revision: 1.20 $
  + * @version $Revision: 1.21 $
    */
   public class LRUPolicyTest extends TestCase
   {
  @@ -252,7 +252,7 @@
            {
               try
               {
  -               cache_.put(myName + i++, "value", new Integer(i));
  +               cache_.put(myName + i++, "value", i);
                  sleep(1);
               }
               catch (Throwable e)
  @@ -273,7 +273,7 @@
         cache_.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
         cache_.create();
         cache_.start();
  -      cache_.put(ROOT_STR + "/concurrentPutAndEvict", "value", new Integer(1));
  +      cache_.put(ROOT_STR + "/concurrentPutAndEvict", "value", 1);
   
         for (int i = 0; i < 10; i++)
         {
  
  
  
  1.9       +5 -5      JBossCache/tests/functional/org/jboss/cache/eviction/ProgrammaticLRUPolicyTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ProgrammaticLRUPolicyTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/ProgrammaticLRUPolicyTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- ProgrammaticLRUPolicyTest.java	30 Dec 2006 17:49:58 -0000	1.8
  +++ ProgrammaticLRUPolicyTest.java	30 Dec 2006 19:48:45 -0000	1.9
  @@ -40,7 +40,7 @@
    * Unit tests for programmatic configuration of LRU policy
    *
    * @author Ben Wang, Oct, 2006
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
    */
   public class ProgrammaticLRUPolicyTest extends TestCase
   {
  @@ -191,11 +191,11 @@
      {
         addObjectBasedRegion();
   
  -      Integer ii = new Integer(1);
  +      Integer ii = 1;
         Fqn rootfqn = new Fqn(ii);
         for (int i = 0; i < 10; i++)
         {
  -         Integer in = new Integer(i);
  +         Integer in = i;
            Fqn fqn = new Fqn(rootfqn, in);
            try
            {
  @@ -210,7 +210,7 @@
   
         try
         {
  -         Integer in = new Integer(3);
  +         Integer in = 3;
            Fqn fqn = new Fqn(rootfqn, in);
            Object val = cache_.get(fqn, in);
            assertNotNull("DataNode should be empty ", val);
  @@ -226,7 +226,7 @@
         System.out.println(cache_.toString());
         try
         {
  -         Integer in = new Integer(3);
  +         Integer in = 3;
            Fqn fqn = new Fqn(rootfqn, in);
            Object val = cache_.get(fqn, in);
            assertNull("DataNode should be empty ", val);
  
  
  
  1.5       +4 -4      JBossCache/tests/functional/org/jboss/cache/eviction/ExpirationPolicyTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ExpirationPolicyTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/eviction/ExpirationPolicyTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- ExpirationPolicyTest.java	30 Dec 2006 17:49:58 -0000	1.4
  +++ ExpirationPolicyTest.java	30 Dec 2006 19:48:45 -0000	1.5
  @@ -19,7 +19,7 @@
    * Unit tests for {@link ExpirationPolicy}.
    *
    * @author Elias Ross
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class ExpirationPolicyTest extends TestCase
   {
  @@ -46,8 +46,8 @@
         cache.setConfiguration(conf);
         cache.start();
   
  -      future = Long.valueOf(System.currentTimeMillis() + 4000);
  -      past = Long.valueOf(System.currentTimeMillis() - 2000);
  +      future = System.currentTimeMillis() + 4000;
  +      past = System.currentTimeMillis() - 2000;
      }
   
      public void tearDown() throws Exception
  @@ -93,7 +93,7 @@
         EvictionPolicyConfig epc = cache.getRegionManager().getAllEvictionRegions().get(0).getEvictionPolicyConfig();
         ExpirationConfiguration ec = (ExpirationConfiguration) epc;
         ec.setMaxNodes(2);
  -      Long future2 = Long.valueOf(future.longValue() + 500);
  +      Long future2 = future + 500;
         cache.put(fqn1, ExpirationConfiguration.DEFAULT_EXPIRATION_KEY, future2);
         cache.put(fqn2, ExpirationConfiguration.DEFAULT_EXPIRATION_KEY, future2);
         cache.put(fqn3, ExpirationConfiguration.DEFAULT_EXPIRATION_KEY, future);
  
  
  



More information about the jboss-cvs-commits mailing list