@Test public void testNothingSetNothingChanges() { Config config = Config.createConfig(); Config config2 = Config.createConfig(); delegate.applyDelegate(config); assertTrue(EqualsBuilder.reflectionEquals(config, config2, "keyStore", "ourCertificate")); }
@Override public void applyDelegate(Config config) { if (protocolVersion == null) { return; } config.setHighestProtocolVersion(protocolVersion); config.setDefaultSelectedProtocolVersion(protocolVersion); TransportHandlerType th = TransportHandlerType.TCP; if (config.getHighestProtocolVersion().isDTLS()) { th = TransportHandlerType.UDP; } if (config.getDefaultClientConnection() == null) { config.setDefaultClientConnection(new OutboundConnection()); } if (config.getDefaultServerConnection() == null) { config.setDefaultServerConnection(new InboundConnection()); } config.getDefaultClientConnection().setTransportHandlerType(th); config.getDefaultServerConnection().setTransportHandlerType(th); }
ProtocolVersionDelegate extends Delegate { @Override public void applyDelegate(Config config) { if (protocolVersion == null) { return; } config.setHighestProtocolVersion(protocolVersion); config.setDefaultSelectedProtocolVersion(protocolVersion); TransportHandlerType th = TransportHandlerType.TCP; if (config.getHighestProtocolVersion().isDTLS()) { th = TransportHandlerType.UDP; } if (config.getDefaultClientConnection() == null) { config.setDefaultClientConnection(new OutboundConnection()); } if (config.getDefaultServerConnection() == null) { config.setDefaultServerConnection(new InboundConnection()); } config.getDefaultClientConnection().setTransportHandlerType(th); config.getDefaultServerConnection().setTransportHandlerType(th); } }
ProtocolVersionDelegate extends Delegate { @Override public void applyDelegate(Config config) { if (protocolVersion == null) { return; } config.setHighestProtocolVersion(protocolVersion); config.setDefaultSelectedProtocolVersion(protocolVersion); TransportHandlerType th = TransportHandlerType.TCP; if (config.getHighestProtocolVersion().isDTLS()) { th = TransportHandlerType.UDP; } if (config.getDefaultClientConnection() == null) { config.setDefaultClientConnection(new OutboundConnection()); } if (config.getDefaultServerConnection() == null) { config.setDefaultServerConnection(new InboundConnection()); } config.getDefaultClientConnection().setTransportHandlerType(th); config.getDefaultServerConnection().setTransportHandlerType(th); } ProtocolVersionDelegate(); }
ProtocolVersionDelegate extends Delegate { @Override public void applyDelegate(Config config) { if (protocolVersion == null) { return; } config.setHighestProtocolVersion(protocolVersion); config.setDefaultSelectedProtocolVersion(protocolVersion); TransportHandlerType th = TransportHandlerType.TCP; if (config.getHighestProtocolVersion().isDTLS()) { th = TransportHandlerType.UDP; } if (config.getDefaultClientConnection() == null) { config.setDefaultClientConnection(new OutboundConnection()); } if (config.getDefaultServerConnection() == null) { config.setDefaultServerConnection(new InboundConnection()); } config.getDefaultClientConnection().setTransportHandlerType(th); config.getDefaultServerConnection().setTransportHandlerType(th); } ProtocolVersionDelegate(); ProtocolVersion getProtocolVersion(); void setProtocolVersion(ProtocolVersion protocolVersion); @Override void applyDelegate(Config config); }
ProtocolVersionDelegate extends Delegate { @Override public void applyDelegate(Config config) { if (protocolVersion == null) { return; } config.setHighestProtocolVersion(protocolVersion); config.setDefaultSelectedProtocolVersion(protocolVersion); TransportHandlerType th = TransportHandlerType.TCP; if (config.getHighestProtocolVersion().isDTLS()) { th = TransportHandlerType.UDP; } if (config.getDefaultClientConnection() == null) { config.setDefaultClientConnection(new OutboundConnection()); } if (config.getDefaultServerConnection() == null) { config.setDefaultServerConnection(new InboundConnection()); } config.getDefaultClientConnection().setTransportHandlerType(th); config.getDefaultServerConnection().setTransportHandlerType(th); } ProtocolVersionDelegate(); ProtocolVersion getProtocolVersion(); void setProtocolVersion(ProtocolVersion protocolVersion); @Override void applyDelegate(Config config);  }