@Test public void loadProperties() throws IOException { try (InputStream inputStream = getClass().getResourceAsStream("/example-jmxtrans.properties")) { Properties properties = new Properties(); properties.load(inputStream); JmxTransConfiguration configuration = new JmxTransConfiguration(); configuration.loadProperties(properties); assertThat(configuration.isContinueOnJsonError()).isTrue(); assertThat(configuration.isRunEndlessly()).isTrue(); assertThat(configuration.getRunPeriod()).isEqualTo(45); assertThat(configuration.getQueryProcessorExecutorPoolSize()).isEqualTo(4); assertThat(configuration.getQueryProcessorExecutorWorkQueueCapacity()).isEqualTo(1000); assertThat(configuration.getResultProcessorExecutorPoolSize()).isEqualTo(8); assertThat(configuration.getResultProcessorExecutorWorkQueueCapacity()).isEqualTo(2000); assertThat(configuration.getAdditionalJars()).containsExactly(new File("lib1.jar"), new File("lib2.jar")); } }
@VisibleForTesting void loadProperties(Properties properties) { TypedProperties typedProperties = new TypedProperties(properties); for(PropertySetter setter: SETTERS) { setter.setValue(typedProperties, this); } }
JmxTransConfiguration { @VisibleForTesting void loadProperties(Properties properties) { TypedProperties typedProperties = new TypedProperties(properties); for(PropertySetter setter: SETTERS) { setter.setValue(typedProperties, this); } } }
JmxTransConfiguration { @VisibleForTesting void loadProperties(Properties properties) { TypedProperties typedProperties = new TypedProperties(properties); for(PropertySetter setter: SETTERS) { setter.setValue(typedProperties, this); } }  }
JmxTransConfiguration { @VisibleForTesting void loadProperties(Properties properties) { TypedProperties typedProperties = new TypedProperties(properties); for(PropertySetter setter: SETTERS) { setter.setValue(typedProperties, this); } }  File getProcessConfigDirOrFile(); Iterable<File> getAdditionalJars(); }
JmxTransConfiguration { @VisibleForTesting void loadProperties(Properties properties) { TypedProperties typedProperties = new TypedProperties(properties); for(PropertySetter setter: SETTERS) { setter.setValue(typedProperties, this); } }  File getProcessConfigDirOrFile(); Iterable<File> getAdditionalJars();  }