1   /*
2    * $Id: ExceptionsWithRouterMule2715TestCase.java 10789 2008-02-12 20:04:43Z dfeist $
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.test.integration.exceptions;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.module.client.MuleClient;
15  import org.mule.tck.FunctionalTestCase;
16  
17  public class ExceptionsWithRouterMule2715TestCase extends FunctionalTestCase
18  {
19  
20      public static final String MESSAGE = "message";
21      public static final long TIMEOUT = 5000L;
22  
23      public void testWithRouter() throws Exception
24      {
25          doTest("with-router-in");
26      }
27  
28      public void testWithoutRouter() throws Exception
29      {
30          doTest("without-router-in");
31      }
32  
33      protected void doTest(String path) throws Exception
34      {
35          MuleClient client = new MuleClient();
36          client.dispatch("vm://" + path, MESSAGE, null);
37          MuleMessage response = client.request("vm://error", TIMEOUT);
38          assertNotNull("exception null", response.getExceptionPayload());
39      }
40  
41      protected String getConfigResources()
42      {
43          return "org/mule/test/integration/exceptions/exceptions-with-router-mule-2715.xml";
44      }
45  
46  }