1   /*
2    * $Id: InterceptorsTestCase.java 7963 2007-08-21 08:53:15Z 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  public class InterceptorsTestCase extends AbstractMuleTestCase
25  {
26      protected void doSetUp() throws Exception
27      {
28          // Make sure there is no current event
29          RequestContext.setEvent(null);
30      }
31  
32      public void testSingleFilter() throws Exception
33      {
34          String data = "The quick brown fox jumped over the lazy dog";
35          UMODescriptor descriptor = getTestDescriptor("orange", Orange.class.getName());
36          List interceptors = new ArrayList();
37          interceptors.add(new LoggingInterceptor());
38          InterceptorsInvoker invoker = new InterceptorsInvoker(interceptors, descriptor, new MuleMessage(data));
39          invoker.execute();
40      }
41  }