@Test public void applyingEmptyDelegateThrowsException() { Config config = Config.createConfig(); exception.expect(ParameterException.class); exception.expectMessage("Port must be set, but was not specified"); delegate.applyDelegate(config); }
@Override public void applyDelegate(Config config) { config.setDefaultRunningMode(RunningModeType.SERVER); int parsedPort = parsePort(port); InboundConnection inboundConnection = config.getDefaultServerConnection(); if (inboundConnection != null) { inboundConnection.setPort(parsedPort); } else { inboundConnection = new InboundConnection(parsedPort); config.setDefaultServerConnection(inboundConnection); } }
ServerDelegate extends Delegate { @Override public void applyDelegate(Config config) { config.setDefaultRunningMode(RunningModeType.SERVER); int parsedPort = parsePort(port); InboundConnection inboundConnection = config.getDefaultServerConnection(); if (inboundConnection != null) { inboundConnection.setPort(parsedPort); } else { inboundConnection = new InboundConnection(parsedPort); config.setDefaultServerConnection(inboundConnection); } } }
ServerDelegate extends Delegate { @Override public void applyDelegate(Config config) { config.setDefaultRunningMode(RunningModeType.SERVER); int parsedPort = parsePort(port); InboundConnection inboundConnection = config.getDefaultServerConnection(); if (inboundConnection != null) { inboundConnection.setPort(parsedPort); } else { inboundConnection = new InboundConnection(parsedPort); config.setDefaultServerConnection(inboundConnection); } } ServerDelegate(); }
ServerDelegate extends Delegate { @Override public void applyDelegate(Config config) { config.setDefaultRunningMode(RunningModeType.SERVER); int parsedPort = parsePort(port); InboundConnection inboundConnection = config.getDefaultServerConnection(); if (inboundConnection != null) { inboundConnection.setPort(parsedPort); } else { inboundConnection = new InboundConnection(parsedPort); config.setDefaultServerConnection(inboundConnection); } } ServerDelegate(); Integer getPort(); void setPort(int port); @Override void applyDelegate(Config config); }
ServerDelegate extends Delegate { @Override public void applyDelegate(Config config) { config.setDefaultRunningMode(RunningModeType.SERVER); int parsedPort = parsePort(port); InboundConnection inboundConnection = config.getDefaultServerConnection(); if (inboundConnection != null) { inboundConnection.setPort(parsedPort); } else { inboundConnection = new InboundConnection(parsedPort); config.setDefaultServerConnection(inboundConnection); } } ServerDelegate(); Integer getPort(); void setPort(int port); @Override void applyDelegate(Config config);  }