Search in sources :

Example 1 with JettyConnector

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());
}
Also used : IJettyConfiguration(org.teknux.jettybootstrap.configuration.IJettyConfiguration) JettyConfiguration(org.teknux.jettybootstrap.configuration.JettyConfiguration) IJettyConfiguration(org.teknux.jettybootstrap.configuration.IJettyConfiguration) JettyConnector(org.teknux.jettybootstrap.configuration.JettyConnector) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)1 Test (org.junit.Test)1 IJettyConfiguration (org.teknux.jettybootstrap.configuration.IJettyConfiguration)1 JettyConfiguration (org.teknux.jettybootstrap.configuration.JettyConfiguration)1 JettyConnector (org.teknux.jettybootstrap.configuration.JettyConnector)1