View Javadoc

1   /*
2    * $Id: UdpNamespaceHandlerTestCase.java 22431 2011-07-18 07:40:35Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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  package org.mule.transport.udp;
11  
12  import org.mule.tck.junit4.FunctionalTestCase;
13  
14  import org.junit.Test;
15  
16  import static org.junit.Assert.assertEquals;
17  import static org.junit.Assert.assertNotNull;
18  import static org.junit.Assert.assertTrue;
19  
20  public class UdpNamespaceHandlerTestCase extends FunctionalTestCase
21  {
22  
23      @Override
24      protected String getConfigResources()
25      {
26          return "udp-namespace-config.xml";
27      }
28  
29      @Test
30      public void testConfig() throws Exception
31      {
32          UdpConnector c = (UdpConnector)muleContext.getRegistry().lookupConnector("udpConnector");
33          assertNotNull(c);
34  
35          assertEquals(1234, c.getReceiveBufferSize());
36          assertEquals(2345, c.getTimeout());
37          assertEquals(3456, c.getSendBufferSize());
38          assertEquals(true, c.isBroadcast());
39          assertEquals(false, c.isKeepSendSocketOpen());
40  
41          assertTrue(c.isConnected());
42          assertTrue(c.isStarted());
43      }
44  
45  }