@Override public void run () { shutdownServer (); if (!cfg.getBoolean ("keep-channels")) { shutdownChannels (); } } }.start();
public boolean getBoolean(String propertyName){ return cfg.getBoolean(prefix + propertyName); } public boolean getBoolean(String propertyName, boolean defaultValue){
public boolean getBoolean(String propertyName, boolean defaultValue){ return cfg.getBoolean(prefix + propertyName, defaultValue); } public double getDouble(String propertyName){
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; } }
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); replyKeepAlive = cfg.getBoolean("reply-keepalive", true); } }
public int prepareForAbort (long id, Serializable o) { if (cfg.getBoolean ("on-abort", false)) return prepare (id, o); return PREPARED; } public void setConfiguration (Configuration cfg) {
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); } }
public void setConfiguration (Configuration cfg) { this.cfg = cfg; request = cfg.get ("request", ContextConstants.REQUEST.toString()); ignoreCardValidation = cfg.getBoolean("ignore-card-validation", false); }
/** * Default config params are: min-len Minimun length, * max-len Max length, break-on-error break condition. * @param cfg configuration instance * @throws ConfigurationException */ public void setConfiguration(Configuration cfg) throws ConfigurationException { this.cfg = cfg; this.minLen = cfg.getInt( "min-len", 0 ); this.maxLen = cfg.getInt( "max-len", 999999 ); this.breakOnError = cfg.getBoolean( "break-on-error", false ); }
public void setConfiguration(Configuration cfg) throws ConfigurationException { prepareDelay = cfg.getLong ("prepare-delay"); commitDelay = cfg.getLong ("commit-delay"); abortDelay = cfg.getLong ("abort-delay"); random = cfg.getBoolean ("random") ? new Random() : null; } void sleep (long delay) {
public void setConfiguration (Configuration cfg) { this.requestName = cfg.get("request", ContextConstants.REQUEST.toString()); this.destinationName = cfg.get ("destination", ContextConstants.DESTINATION.toString()); this.defaultDestination = cfg.get("default-destination", null); this.validator = cfg.getBoolean("ignore-luhn") ? new IgnoreLuhnCardValidator() : Card.Builder.DEFAULT_CARD_VALIDATOR; this.failOnNoRoute = cfg.getBoolean("fail"); }
public void setConfiguration(Configuration cfg) throws ConfigurationException { this.cfg = cfg; keyStore = cfg.get("keystore"); clientAuthNeeded = cfg.getBoolean("clientauth"); serverAuthNeeded = cfg.getBoolean("serverauth"); serverName = cfg.get("servername"); password = cfg.get("storepassword", null); keyPassword = cfg.get("keypassword", null); enabledCipherSuites = cfg.getAll("addEnabledCipherSuite"); enabledProtocols = cfg.getAll("addEnabledProtocol"); } public Configuration getConfiguration() {
/** * @param cfg Configuration object * @throws ConfigurationException */ @Override public void setConfiguration(Configuration cfg) throws ConfigurationException { this.cfg = cfg; queueName = cfg.get("queue", null); if (queueName == null) throw new ConfigurationException("'queue' property not configured"); timeout = cfg.getLong("timeout", timeout); frozen = cfg.getBoolean("frozen", true); }
@Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); enableTLS = cfg.getBoolean("TLS", false); keyStore = cfg.get("keystore"); password = cfg.get("storepassword", getPassword()); keyPassword = cfg.get("keypassword", getKeyPassword()); clientAuthNeeded = cfg.getBoolean("client-auth", false); serverAuthNeeded = cfg.getBoolean("server-auth", false); enabledCipherSuites = cfg.getAll("enabled-cipher"); enabledProtocols = cfg.getAll("enable-protocol"); queue = cfg.get("queue"); }
public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; timeout = cfg.getLong ("timeout", DEFAULT_TIMEOUT); waitTimeout = cfg.getLong ("wait-timeout", DEFAULT_WAIT_TIMEOUT); requestName = cfg.get ("request", ContextConstants.REQUEST.toString()); responseName = cfg.get ("response", ContextConstants.RESPONSE.toString()); destination = cfg.get ("destination", ContextConstants.DESTINATION.toString()); continuations = cfg.getBoolean("continuations", true); ignoreUnreachable = cfg.getBoolean("ignore-host-unreachable", false); }
@Test public void testSetConfiguration() throws ConfigurationException { delay.setConfiguration(cfg); verify(cfg, atLeastOnce()).getLong("prepare-delay"); verify(cfg, atLeastOnce()).getLong("commit-delay"); verify(cfg, atLeastOnce()).getLong("abort-delay"); verify(cfg, atLeastOnce()).getBoolean("random"); }
public void setConfiguration(Configuration cfg) throws ConfigurationException { setVetoUnmatched(cfg.getBoolean("veto-unmatched")); setSpace(cfg.get("space","")); setKeyPrefix(cfg.get("key-prefix", ""+hashCode())); setTimeout(cfg.getLong("timeout", TIMEOUT)); setOverwriteOriginalFields(cfg.getBoolean("overwrite-original-fields", true)); int dir = cfg.get("direction","incoming").equals("incoming") ? ISOMsg.INCOMING : ISOMsg.OUTGOING; setMatchDirection(dir); setKey(ISOUtil.toIntArray(cfg.get("key", "11 41"))); setSavedFields(ISOUtil.toIntArray(cfg.get("saved-fields", ""))); setIgnoredFields(ISOUtil.toIntArray(cfg.get("ignored-fields", ""))); } public void setSpace(String uri){
@Test public void testSetConfigurationNoRandomOrSetVars() throws ConfigurationException { // given given(cfg.getLong("prepare-delay")).willReturn(0L); given(cfg.getLong("commit-delay")).willReturn(0L); given(cfg.getLong("abort-delay")).willReturn(0L); given(cfg.getBoolean("random")).willReturn(false); // when delay.setConfiguration(cfg); // then verify(cfg, atLeastOnce()).getLong("prepare-delay"); verify(cfg, atLeastOnce()).getLong("commit-delay"); verify(cfg, atLeastOnce()).getLong("abort-delay"); verify(cfg, atLeastOnce()).getBoolean("random"); }
@Before public void setUp() throws Exception { delay = new Delay(); delay.random = random; given(random.nextLong()).willReturn(1L); given(cfg.getLong("prepare-delay")).willReturn(12345L); given(cfg.getLong("commit-delay")).willReturn(54321L); given(cfg.getLong("abort-delay")).willReturn(98765L); given(cfg.getBoolean("random")).willReturn(true); }