jakarta-jcs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asm...@apache.org
Subject cvs commit: jakarta-turbine-jcs/src/test/org/apache/jcs/access TestCacheAccess.java
Date Fri, 20 May 2005 19:24:26 GMT
asmuts      2005/05/20 12:24:26

  Modified:    src/test/org/apache/jcs/access TestCacheAccess.java
  Log:
  allow to switch between region names
  
  Revision  Changes    Path
  1.16      +9 -24     jakarta-turbine-jcs/src/test/org/apache/jcs/access/TestCacheAccess.java
  
  Index: TestCacheAccess.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-jcs/src/test/org/apache/jcs/access/TestCacheAccess.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TestCacheAccess.java	1 Feb 2005 04:53:58 -0000	1.15
  +++ TestCacheAccess.java	20 May 2005 19:24:26 -0000	1.16
  @@ -43,7 +43,7 @@
       private final static Log log           = LogFactory
                                                      .getLog( TestCacheAccess.class );
   
  -    private GroupCacheAccess cache_control = null;
  +    private JCS cache_control = null;
   
       private static boolean   isSysOut      = false;
   
  @@ -64,7 +64,7 @@
       {
           try
           {
  -            cache_control = GroupCacheAccess.getGroupAccess( regionName );
  +            cache_control = JCS.getInstance( regionName );
           }
           catch (Exception e)
           {
  @@ -574,28 +574,13 @@
                       }
                       else if (message.startsWith( "switch" ))
                       {
  -                        String numS = message.substring(
  +                        String name = message.substring(
                                   message.indexOf( " " ) + 1, message.length() );
  -                        try
  -                        {
  -                            Integer.parseInt( numS.trim() );
  -                        }
  -                        catch (Exception e)
  -                        {
  -                            p( "usage: switch number" );
  -                            p( "  1 == testCache1" );
  -                        }
  -                        if (numS == null)
  -                        {
  -                            p( "usage: switch number" );
  -                            p( "  1 == testCache1" );
  -                        }
  -                        else
  -                        {
  -                            setRegion( "testCache" + numS );
  -                            p( "switched to cache = " + "testCache" + numS );
  -                            p( cache_control.toString() );
  -                        }
  +                        
  +    
  +                        setRegion( name );
  +                        p( "switched to cache = " + name );
  +                        p( cache_control.toString() );
                       }
                       else if (message.startsWith( "stats" ))
                       {
  @@ -926,7 +911,7 @@
           p( "type 'deattr' to get the default element attributes" );
           p( "type 'cloneattr num' to clone attr" );
           p( "type 'random range numOps' to put, get, and remove randomly" );
  -        p( "type 'switch number' to switch to testCache[number], 1 == testCache1" );
  +        p( "type 'switch name' to switch to this region name" );
           p( "type 'gc' to call System.gc()" );
           p( "type 'help' for commands" );
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org


Mime
View raw message