@Test public void testSetTimeoutValueNoSuffix() { Map<String, String> props = new HashMap<String, String>(); props.put("test", "7"); Configuration.setTimeoutValue(props, "test"); Assert.assertTrue(props.get("test").equals("7000")); }
protected static void setTimeoutValue(Map<String, String> properties, String propertyName) { if (properties == null) { return; } String value = properties.get(propertyName); if (value == null) { return; } try { properties.put(propertyName, Integer.toString(timeStringToMillis(value))); } catch (InvalidTimeException e) { log.warn( "Invalid value {0} for configuration property ''{1}'', timeout has been disabled.", value, propertyName ); properties.put(propertyName, "0"); } catch (ConfigurationException e) { log.warn("Invalid value ''{0}'' for configuration property ''{1}''.", value, propertyName); } }
Configuration { protected static void setTimeoutValue(Map<String, String> properties, String propertyName) { if (properties == null) { return; } String value = properties.get(propertyName); if (value == null) { return; } try { properties.put(propertyName, Integer.toString(timeStringToMillis(value))); } catch (InvalidTimeException e) { log.warn( "Invalid value {0} for configuration property ''{1}'', timeout has been disabled.", value, propertyName ); properties.put(propertyName, "0"); } catch (ConfigurationException e) { log.warn("Invalid value ''{0}'' for configuration property ''{1}''.", value, propertyName); } } }
Configuration { protected static void setTimeoutValue(Map<String, String> properties, String propertyName) { if (properties == null) { return; } String value = properties.get(propertyName); if (value == null) { return; } try { properties.put(propertyName, Integer.toString(timeStringToMillis(value))); } catch (InvalidTimeException e) { log.warn( "Invalid value {0} for configuration property ''{1}'', timeout has been disabled.", value, propertyName ); properties.put(propertyName, "0"); } catch (ConfigurationException e) { log.warn("Invalid value ''{0}'' for configuration property ''{1}''.", value, propertyName); } }  }
Configuration { protected static void setTimeoutValue(Map<String, String> properties, String propertyName) { if (properties == null) { return; } String value = properties.get(propertyName); if (value == null) { return; } try { properties.put(propertyName, Integer.toString(timeStringToMillis(value))); } catch (InvalidTimeException e) { log.warn( "Invalid value {0} for configuration property ''{1}'', timeout has been disabled.", value, propertyName ); properties.put(propertyName, "0"); } catch (ConfigurationException e) { log.warn("Invalid value ''{0}'' for configuration property ''{1}''.", value, propertyName); } }  void setConfigurationProperties(Map<String, String> configurationProperties); }
Configuration { protected static void setTimeoutValue(Map<String, String> properties, String propertyName) { if (properties == null) { return; } String value = properties.get(propertyName); if (value == null) { return; } try { properties.put(propertyName, Integer.toString(timeStringToMillis(value))); } catch (InvalidTimeException e) { log.warn( "Invalid value {0} for configuration property ''{1}'', timeout has been disabled.", value, propertyName ); properties.put(propertyName, "0"); } catch (ConfigurationException e) { log.warn("Invalid value ''{0}'' for configuration property ''{1}''.", value, propertyName); } }  void setConfigurationProperties(Map<String, String> configurationProperties);  }