@Test public void testJobExecutorConfigurationProperties() { JobExecutor jobExecutor = new DefaultJobExecutor(); Map<String, String> propertiesToSet = new HashMap<String, String>(); propertiesToSet.put(MAX_JOBS_PER_ACQUISITION, Integer.toString(Integer.MAX_VALUE)); propertiesToSet.put(MAX_WAIT, Long.toString(Long.MAX_VALUE)); propertiesToSet.put(WAIT_INCREASE_FACTOR, Float.toString(Float.MAX_VALUE)); propertiesToSet.put(BACKOFF_TIME_IN_MILLIS, Integer.toString(Integer.MAX_VALUE)); PropertyHelper.applyProperties(jobExecutor, propertiesToSet); Assert.assertEquals(Integer.MAX_VALUE, jobExecutor.getMaxJobsPerAcquisition()); Assert.assertEquals(Long.MAX_VALUE, jobExecutor.getMaxWait()); Assert.assertEquals(Float.MAX_VALUE, jobExecutor.getWaitIncreaseFactor(), 0.0001d); Assert.assertEquals(Integer.MAX_VALUE, jobExecutor.getBackoffTimeInMillis()); }
public static void applyProperties(Object configuration, Map<String, String> properties) { for (Map.Entry<String, String> property : properties.entrySet()) { applyProperty(configuration, property.getKey(), property.getValue()); } }
PropertyHelper { public static void applyProperties(Object configuration, Map<String, String> properties) { for (Map.Entry<String, String> property : properties.entrySet()) { applyProperty(configuration, property.getKey(), property.getValue()); } } }
PropertyHelper { public static void applyProperties(Object configuration, Map<String, String> properties) { for (Map.Entry<String, String> property : properties.entrySet()) { applyProperty(configuration, property.getKey(), property.getValue()); } }  }
PropertyHelper { public static void applyProperties(Object configuration, Map<String, String> properties) { for (Map.Entry<String, String> property : properties.entrySet()) { applyProperty(configuration, property.getKey(), property.getValue()); } }  static boolean getBooleanProperty(Map<String, String> properties, String name, boolean defaultValue); static Object convertToClass(String value, Class<?> clazz); static void applyProperty(Object configuration, String key, String stringValue); static void applyProperties(Object configuration, Map<String, String> properties); static String resolveProperty(Properties props, String original); }
PropertyHelper { public static void applyProperties(Object configuration, Map<String, String> properties) { for (Map.Entry<String, String> property : properties.entrySet()) { applyProperty(configuration, property.getKey(), property.getValue()); } }  static boolean getBooleanProperty(Map<String, String> properties, String name, boolean defaultValue); static Object convertToClass(String value, Class<?> clazz); static void applyProperty(Object configuration, String key, String stringValue); static void applyProperties(Object configuration, Map<String, String> properties); static String resolveProperty(Properties props, String original);  }