geirm       01/06/02 07:48:25

  Modified:    src/java/org/apache/velocity/test EventHandlingTestCase.java
  Log:
  Adjusting testcase to ensure we test wrapping/chaining.  Parallel to
  what was committed to the 1.1 branch
  
  Revision  Changes    Path
  1.4       +15 -7     
jakarta-velocity/src/java/org/apache/velocity/test/EventHandlingTestCase.java
  
  Index: EventHandlingTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/EventHandlingTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EventHandlingTestCase.java        2001/05/20 21:14:32     1.3
  +++ EventHandlingTestCase.java        2001/06/02 14:48:25     1.4
  @@ -74,7 +74,7 @@
    *  Tests event handling
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Geir Magnusson Jr.</a>
  - * @version $Id: EventHandlingTestCase.java,v 1.3 2001/05/20 21:14:32 geirm Exp $
  + * @version $Id: EventHandlingTestCase.java,v 1.4 2001/06/02 14:48:25 geirm Exp $
    */
   public class EventHandlingTestCase extends TestCase implements 
ReferenceInsertionEventHandler, 
                                        NullSetEventHandler, 
MethodExceptionEventHandler,
  @@ -119,14 +119,13 @@
        */
       public void runTest ()
       {
  +
           /* 
  -         *  lets make a Context and add some data
  +         *  lets make a Context and add the event cartridge
            */
  -        
  -        VelocityContext context = new VelocityContext();
  -        
  -        context.put("name", "Velocity");
           
  +        VelocityContext inner = new VelocityContext();
  +
           /*
            *  Now make an event cartridge, register all the 
            *  event handlers (at once) and attach it to the
  @@ -135,8 +134,17 @@
   
           EventCartridge ec = new EventCartridge();
           ec.addEventHandler(this);
  -        ec.attachToContext( context );
  +        ec.attachToContext( inner );
     
  +        /*
  +         *  now wrap the event cartridge - we want to make sure that
  +         *  we can do this w/o harm
  +         */
  +
  +        VelocityContext context = new VelocityContext( inner );
  +
  +        context.put("name", "Velocity");
  +
           try
           {
               /*
  
  
  

Reply via email to