View Javadoc

1   /*
2    * $Id: HttpsNamespaceHandlerTestCase.java 20321 2010-11-24 15:21:24Z dfeist $
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  
11  package org.mule.transport.http;
12  
13  import org.mule.transport.http.HttpsConnector;
14  
15  public class HttpsNamespaceHandlerTestCase extends AbstractNamespaceHandlerTestCase
16  {
17  
18      public HttpsNamespaceHandlerTestCase()
19      {
20          super("https");
21      }
22  
23      public void testConnectorProperties()
24      {
25          HttpsConnector connector =
26                  (HttpsConnector) muleContext.getRegistry().lookupConnector("httpsConnector");
27          testBasicProperties(connector);
28  
29          //The full path gets resolved, we're just checkng that the property got set
30          assertTrue(connector.getKeyStore().endsWith("/serverKeystore"));
31          assertEquals("mulepassword", connector.getKeyPassword());
32          assertEquals("mulepassword", connector.getKeyStorePassword());
33          //The full path gets resolved, we're just checkng that the property got set
34          assertTrue(connector.getClientKeyStore().endsWith("/clientKeystore"));
35          assertEquals("mulepassword", connector.getClientKeyStorePassword());
36          //The full path gets resolved, we're just checkng that the property got set
37          assertTrue(connector.getTrustStore().endsWith("/trustStore"));
38          assertEquals("mulepassword", connector.getTrustStorePassword());
39          assertTrue(connector.isExplicitTrustStoreOnly());
40          assertTrue(connector.isRequireClientAuthentication());
41  
42          assertEquals("foo", connector.getProtocolHandler());
43      }
44  
45      public void testPollingProperties()
46      {
47           HttpsPollingConnector connector =
48                  (HttpsPollingConnector) muleContext.getRegistry().lookupConnector("polling");
49          assertNotNull(connector);
50          assertEquals(3456, connector.getPollingFrequency());
51          assertFalse(connector.isCheckEtag());
52          assertFalse(connector.isDiscardEmptyContent());
53      }
54  
55  }