View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.tcp;
8   
9   import static org.junit.Assert.assertEquals;
10  import org.mule.api.MuleMessage;
11  import org.mule.api.client.MuleClient;
12  import org.mule.client.DefaultLocalMuleClient;
13  import org.mule.tck.junit4.FunctionalTestCase;
14  import org.mule.tck.junit4.rule.DynamicPort;
15  import org.mule.transport.NullPayload;
16  
17  import org.junit.Rule;
18  import org.junit.Test;
19  
20  public class TCPTimeoutsTest extends FunctionalTestCase
21  {
22  
23      @Rule
24      public DynamicPort tcpPort = new DynamicPort("tcpPort");
25  
26      @Override
27      protected String getConfigResources()
28      {
29          return "tcp-response-timeout-config.xml";
30      }
31  
32      @Test
33      public void testOutboundResponseTimeoutSet() throws Exception
34      {
35          final MuleClient client = new DefaultLocalMuleClient(muleContext);
36  
37          final MuleMessage result = client.send("vm://testIn", TEST_MESSAGE, null);
38  
39          assertEquals(NullPayload.getInstance(), result.getPayload());
40      }
41  }