1   /*
2    * $Id: PropertyScribblingMule893TestCase.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.issues;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.api.config.MuleProperties;
15  import org.mule.module.client.MuleClient;
16  import org.mule.tck.FunctionalTestCase;
17  
18  import java.util.HashMap;
19  import java.util.Map;
20  
21  public class PropertyScribblingMule893TestCase extends FunctionalTestCase
22  {
23  
24      protected String getConfigResources()
25      {
26          return "issues/property-scribbling-mule-893-test.xml";
27      }
28  
29      public void testSingleMessage() throws Exception
30      {
31          MuleClient client = new MuleClient();
32          Map properties = new HashMap();
33          properties.put(MuleProperties.MULE_REPLY_TO_PROPERTY, "receive");
34          client.dispatch("dispatch", "Message", properties);
35          MuleMessage response = client.request("receive", 3000L);
36          assertNotNull("Response is null", response);
37          assertEquals("Message Received", response.getPayload());
38      }
39  
40      public void testManyMessage() throws Exception
41      {
42          for (int i = 0; i < 1000; i++)
43          {
44              testSingleMessage();
45          }
46      }
47  
48  }