View Javadoc

1   /*
2    * $Id: ClassInterceptorTestCase.java 22414 2011-07-14 13:24:46Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.config.spring;
12  
13  import org.mule.api.MuleException;
14  import org.mule.module.client.MuleClient;
15  
16  import java.util.Arrays;
17  import java.util.Collection;
18  
19  import org.junit.Test;
20  import org.junit.runners.Parameterized.Parameters;
21  
22  public class ClassInterceptorTestCase extends AbstractInterceptorTestCase
23  {
24      public ClassInterceptorTestCase(ConfigVariant variant, String configResources)
25      {
26          super(variant, configResources);
27      }
28  
29      @Parameters
30      public static Collection<Object[]> parameters()
31      {
32          return Arrays.asList(new Object[][]{
33              {ConfigVariant.SERVICE, "org/mule/config/spring/class-interceptor-test-service.xml"},
34              {ConfigVariant.FLOW, "org/mule/config/spring/class-interceptor-test-flow.xml"}});
35      }
36  
37      @Test
38      public void testInterceptor() throws MuleException, InterruptedException
39      {
40          MuleClient client = new MuleClient(muleContext);
41          client.send("vm://in", MESSAGE, null);
42          assertMessageIntercepted();
43      }
44  }