@Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); replyKeepAlive = cfg.getBoolean("reply-keepalive", true); } }
public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration (cfg); tpduSwap = cfg.getBoolean ("tpdu-swap", true); } }
@Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); delay = cfg.getLong("delay", 0L); }
@Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); timestampField = cfg.getInt("timestamp-field", 0); realmField = cfg.getInt("realm-field", 0); } }
public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration (cfg); tpduSwap = cfg.getBoolean ("tpdu-swap", true); lenlen = cfg.getBoolean ("include-header-length", false) ? 2 : 0; } }
/** * * Calls super.setConfiguration() and then reads the 'length-digits' property, * defaulting to 4 * * @param cfg Configuration * @throws ConfigurationException */ @Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); setLengthDigits(cfg.getInt("length-digits", 4)); } }
public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration (cfg); srcid = cfg.get ("srcid", "000000"); dstid = cfg.get ("dstid", "000000"); debugPoll = cfg.getBoolean("debug-poll", false); headerFormat = cfg.getInt("header-format", 2); replyKeepAlive = cfg.getBoolean("reply-keepalive", true); } }
@Test public void testSetConfiguration1() throws Throwable { BaseChannel gZIPChannel = new GZIPChannel(); gZIPChannel.setConfiguration(new SimpleConfiguration()); assertEquals("(GZIPChannel) gZIPChannel.getTimeout()", 300000, gZIPChannel.getTimeout()); assertEquals("(GZIPChannel) gZIPChannel.getMaxPacketLength()", 100000, gZIPChannel.getMaxPacketLength()); assertFalse("(GZIPChannel) gZIPChannel.overrideHeader", ((GZIPChannel) gZIPChannel).overrideHeader); }
@Test public void testSetConfiguration() throws Throwable { BaseChannel gZIPChannel = new GZIPChannel(new ISO93BPackager(), null); gZIPChannel.setSocketFactory(new SunJSSESocketFactory()); gZIPChannel.setConfiguration(new SimpleConfiguration()); assertEquals("(GZIPChannel) gZIPChannel.getTimeout()", 300000, gZIPChannel.getTimeout()); assertEquals("(GZIPChannel) gZIPChannel.getMaxPacketLength()", 100000, gZIPChannel.getMaxPacketLength()); assertFalse("(GZIPChannel) gZIPChannel.overrideHeader", ((GZIPChannel) gZIPChannel).overrideHeader); }
@Test public void testSetConfigurationThrowsNullPointerException() throws Throwable { BaseChannel x25Channel = new X25Channel(); Configuration cfg = new SimpleConfiguration((Properties) null); try { x25Channel.setConfiguration(cfg); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull("ex.getMessage()", ex.getMessage()); assertEquals("(X25Channel) x25Channel.getMaxPacketLength()", 100000, x25Channel.getMaxPacketLength()); assertEquals("(X25Channel) x25Channel.getPort()", 0, x25Channel.getPort()); assertEquals("(X25Channel) x25Channel.getTimeout()", 0, x25Channel.getTimeout()); assertNull("(X25Channel) x25Channel.getHost()", x25Channel.getHost()); assertNull("(X25Channel) x25Channel.getSocket()", x25Channel.getSocket()); assertFalse("(X25Channel) x25Channel.overrideHeader", ((X25Channel) x25Channel).overrideHeader); } }