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