1   /*
2    * $Id: InterceptorsTestCase.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.mule;
12  
13  import org.mule.impl.InterceptorsInvoker;
14  import org.mule.impl.MuleMessage;
15  import org.mule.impl.RequestContext;
16  import org.mule.interceptors.LoggingInterceptor;
17  import org.mule.tck.AbstractMuleTestCase;
18  import org.mule.tck.testmodels.fruit.Orange;
19  import org.mule.umo.UMODescriptor;
20  
21  import java.util.ArrayList;
22  import java.util.List;
23  
24  /**
25   * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
26   * @version $Revision: 7976 $
27   */
28  public class InterceptorsTestCase extends AbstractMuleTestCase
29  {
30      protected void doSetUp() throws Exception
31      {
32          // Make sure there is no current event
33          RequestContext.setEvent(null);
34      }
35  
36      public void testSingleFilter() throws Exception
37      {
38          String data = "The quick brown fox jumped over the lazy dog";
39          UMODescriptor descriptor = getTestDescriptor("orange", Orange.class.getName());
40          List interceptors = new ArrayList();
41          interceptors.add(new LoggingInterceptor());
42          InterceptorsInvoker invoker = new InterceptorsInvoker(interceptors, descriptor, new MuleMessage(data));
43          invoker.execute();
44      }
45  }