1   /*
2    * $Id: NoArgsCallWrapperFunctionalTestCase.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;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.module.client.MuleClient;
15  import org.mule.tck.FunctionalTestCase;
16  
17  /**
18   * This test has been re-written to use entry point resolvers.
19   */
20  public class NoArgsCallWrapperFunctionalTestCase extends FunctionalTestCase
21  {
22      private static final int RECEIVE_TIMEOUT = 5000;
23  
24      protected String getConfigResources()
25      {
26          return "no-args-call-wrapper-config.xml";
27      }
28  
29      public void testNoArgsCallWrapper() throws Exception
30      {
31          MuleClient client = new MuleClient();
32          client.dispatch("vm://invoke", "test", null);
33          MuleMessage reply = client.request("vm://out", RECEIVE_TIMEOUT);
34          assertNotNull(reply);
35          assertNull(reply.getExceptionPayload());
36          assertEquals("Just an apple.", reply.getPayload());
37      }
38  
39      public void testWithInjectedDelegate() throws Exception
40      {
41          MuleClient client = new MuleClient();
42          client.dispatch("vm://invokeWithInjected", "test", null);
43          MuleMessage reply = client.request("vm://outWithInjected", RECEIVE_TIMEOUT);
44          assertNotNull(reply);
45          assertNull(reply.getExceptionPayload());
46          // same as original input
47          assertEquals("test", reply.getPayload());
48      }
49  
50  }