use of org.teknux.jettybootstrap.configuration.JettyConnector in project jetty-bootstrap by teknux-org.
the class JettyConfigurationTest method cloneTest.
@Test
public void cloneTest() throws CloneNotSupportedException {
JettyConfiguration jettyConfiguration = new JettyConfiguration();
jettyConfiguration.setAutoJoinOnStart(true);
jettyConfiguration.setHost("0.0.0.0");
jettyConfiguration.setJettyConnectors(JettyConnector.HTTPS);
IJettyConfiguration iJettyConfigurationCloned = jettyConfiguration.clone();
jettyConfiguration.setAutoJoinOnStart(false);
jettyConfiguration.setHost("127.0.0.1");
jettyConfiguration.setJettyConnectors(JettyConnector.HTTP);
Assert.assertEquals(false, jettyConfiguration.isAutoJoinOnStart());
Assert.assertEquals("127.0.0.1", jettyConfiguration.getHost());
Set<JettyConnector> expectedJettyConnectors = new HashSet<>();
expectedJettyConnectors.add(JettyConnector.HTTP);
Assert.assertEquals(expectedJettyConnectors, jettyConfiguration.getJettyConnectors());
Assert.assertEquals(true, iJettyConfigurationCloned.isAutoJoinOnStart());
Assert.assertEquals("0.0.0.0", iJettyConfigurationCloned.getHost());
Set<JettyConnector> expectedJettyConnectorsCloned = new HashSet<>();
expectedJettyConnectorsCloned.add(JettyConnector.HTTPS);
Assert.assertEquals(expectedJettyConnectorsCloned, iJettyConfigurationCloned.getJettyConnectors());
}
Aggregations