asmuts      02/05/14 08:25:49

  Modified:    src/test/org/apache/jcs/access TestCacheAccess.java
  Log:
  Added a pute # to the tester to add junk event handlers to a few elements
  
  Revision  Changes    Path
  1.4       +35 -0     
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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestCacheAccess.java      12 Apr 2002 13:03:12 -0000      1.3
  +++ TestCacheAccess.java      14 May 2002 15:25:49 -0000      1.4
  @@ -70,6 +70,10 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  +import org.apache.jcs.engine.control.event.TestElementEventHandler;
  +
  +
  +
   /**
    * Allows the user to run common cache commands fromt he command line for a test
    * cache.
  @@ -517,6 +521,37 @@
                               {
                                   cache_control.put( "key" + n,
                                       "data" + n + " put from ta = junk" );
  +                            }
  +                            long n_end = System.currentTimeMillis();
  +                            p( "---put " + num + " in " + String.valueOf( n_end - 
n_start ) + " millis ---" );
  +                        }
  +                    }
  +                    else
  +                        if ( message.startsWith( "pute" ) )
  +                    {
  +                        String numS = message.substring( message.indexOf( " " ) + 
1, message.length() );
  +                        int num = Integer.parseInt( numS.trim() );
  +                        if ( numS == null )
  +                        {
  +                            p( "usage: putme numbertoput" );
  +                        }
  +                        else
  +                        {
  +//                            IElementAttributes attrp = new ElementAttributes();
  +                            //attrp.setIsEternal(false);
  +                            //attrp.setMaxLifeSeconds(30);
  +
  +//                            attrp.setIsLateral(true);
  +//                            attrp.setIsRemote(true);
  +
  +                            long n_start = System.currentTimeMillis();
  +                            for ( int n = 0; n < num; n++ )
  +                            {
  +                                IElementAttributes attrp = 
cache_control.getElementAttributes();
  +                                TestElementEventHandler hand = new 
TestElementEventHandler();
  +                                attrp.addElementEventHandler( hand );
  +                                cache_control.put( "key" + n,
  +                                    "data" + n + " put from ta = junk", attrp );
                               }
                               long n_end = System.currentTimeMillis();
                               p( "---put " + num + " in " + String.valueOf( n_end - 
n_start ) + " millis ---" );
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to