1
2
3
4
5
6
7 package org.mule.transport.servlet.jetty;
8
9 import org.mule.tck.junit4.FunctionalTestCase;
10
11 import org.junit.Test;
12
13 import static org.junit.Assert.assertEquals;
14 import static org.junit.Assert.assertNotNull;
15 import static org.junit.Assert.assertTrue;
16
17 public class JettyNamespaceHandlerTestCase extends FunctionalTestCase
18 {
19 public JettyNamespaceHandlerTestCase()
20 {
21 super();
22 setStartContext(false);
23 }
24
25 @Override
26 protected String getConfigResources()
27 {
28 return "jetty-namespace-config.xml";
29 }
30
31 @Test
32 public void checkConnectorProperties()
33 {
34 JettyHttpConnector connector =
35 (JettyHttpConnector) muleContext.getRegistry().lookupConnector("jettyConnector");
36 assertNotNull(connector.getConfigFile());
37 assertEquals("jetty-config.xml", connector.getConfigFile());
38
39 assertTrue(connector.isValidateConnections());
40 }
41
42 @Test
43 public void checkSslConnectorProperties()
44 {
45 JettyHttpsConnector connector =
46 (JettyHttpsConnector) muleContext.getRegistry().lookupConnector("jettySslConnector");
47
48 assertTrue(connector.getKeyStore().endsWith("/serverKeystore"));
49 assertEquals("muleserver", connector.getKeyAlias());
50 assertEquals("mulepassword", connector.getKeyPassword());
51 assertEquals("mulepassword", connector.getKeyStorePassword());
52
53 assertTrue(connector.getClientKeyStore().endsWith("/clientKeystore"));
54 assertEquals("mulepassword", connector.getClientKeyStorePassword());
55
56 assertTrue(connector.getTrustStore().endsWith("/trustStore"));
57 assertEquals("mulepassword", connector.getTrustStorePassword());
58
59 assertTrue(connector.isValidateConnections());
60 }
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75 }