View Javadoc

1   /*
2    * $Id$
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.test.integration.exceptions;
12  
13  import org.mule.DefaultMuleMessage;
14  import org.mule.api.MuleMessage;
15  import org.mule.module.client.MuleClient;
16  import org.mule.tck.FunctionalTestCase;
17  
18  public class MessageContextTestCase extends FunctionalTestCase 
19  {
20      String request = "Hello World";
21  
22      @Override
23      protected String getConfigResources() 
24      {
25          return "org/mule/test/integration/exceptions/message-context-test.xml";
26      }
27  
28      /**
29       * Test for MULE-4361
30       */
31      public void testAlternateExceptionStrategy() throws Exception
32      {
33          MuleClient client = new MuleClient(muleContext);
34          DefaultMuleMessage msg = new DefaultMuleMessage(request, client.getMuleContext());
35          MuleMessage response = client.send("testin", msg, 200000);
36          assertNotNull(response);
37          Thread.sleep(10000); // Wait for test to finish
38  
39      }
40  }