1   /*
2    * $Id: TcpEchoDirectProtocolTestCase.java 12113 2008-06-19 15:34:54Z dirk.olmes $
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.transport.tcp;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.module.client.MuleClient;
15  import org.mule.tck.FunctionalTestCase;
16  
17  public class TcpEchoDirectProtocolTestCase extends FunctionalTestCase 
18  {
19  
20      protected static String TEST_MESSAGE = "Test TCP Request";
21  
22      protected String getConfigResources()
23      {
24          return "tcp-echo-test.xml";
25      }
26  
27      public void testSend() throws Exception
28      {
29          MuleClient client = new MuleClient();
30          String url = "tcp://localhost:61200";
31          
32          MuleMessage response = client.send(url, TEST_MESSAGE, null);
33          assertNotNull(response);
34          assertEquals(TEST_MESSAGE, response.getPayload());
35      }
36  
37  }