View Javadoc

1   /*
2    * $Id: TlsNamespaceHandlerTestCase.java 19191 2010-08-25 21:05:23Z tcarlson $
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.ssl;
11  
12  import org.mule.tck.FunctionalTestCase;
13  import org.mule.transport.ssl.SslConnector;
14  
15  public class TlsNamespaceHandlerTestCase extends FunctionalTestCase
16  {
17      protected String getConfigResources()
18      {
19          return "tls-namespace-config.xml";
20      }
21  
22      public void testConnectorProperties() throws Exception
23      {
24          SslConnector connector = (SslConnector)muleContext.getRegistry().lookupConnector("sslConnector");
25          assertNotNull(connector);
26          assertEquals(1024, connector.getSendBufferSize());
27          assertEquals(2048, connector.getReceiveBufferSize());
28          assertTrue(connector.isKeepAlive());
29  
30          //The full path gets resolved, we're just checkng that the property got set
31          assertTrue(connector.getKeyStore().endsWith("/serverKeystore"));
32          assertEquals("mulepassword", connector.getKeyPassword());
33          assertEquals("mulepassword", connector.getKeyStorePassword());
34          //The full path gets resolved, we're just checkng that the property got set
35          assertTrue(connector.getClientKeyStore().endsWith("/clientKeystore"));
36          assertEquals("mulepassword", connector.getClientKeyStorePassword());
37          //The full path gets resolved, we're just checkng that the property got set
38          assertTrue(connector.getTrustStore().endsWith("/trustStore"));
39          assertEquals("mulepassword", connector.getTrustStorePassword());
40          assertTrue(connector.isExplicitTrustStoreOnly());
41          assertTrue(connector.isRequireClientAuthentication());
42      }
43  }