use of org.neo4j.kernel.configuration.Config in project neo4j by neo4j.
the class ServerSettingsTest method webServerThreadCountDefaultShouldBeDocumented.
@Test
public void webServerThreadCountDefaultShouldBeDocumented() throws Exception {
Config config = Config.serverDefaults();
String documentedDefaultValue = config.getConfigValues().entrySet().stream().filter(c -> c.getKey().equals(ServerSettings.webserver_max_threads.name())).map(Entry::getValue).findAny().orElseThrow(() -> new RuntimeException("Setting not present!")).documentedDefaultValue().orElseThrow(() -> new RuntimeException("Default value not present!"));
assertEquals("Number of available processors (max 500).", documentedDefaultValue);
}
use of org.neo4j.kernel.configuration.Config in project neo4j by neo4j.
the class ServerSettingsTest method connectorSettingHasItsOwnValues.
@Test
public void connectorSettingHasItsOwnValues() throws Exception {
Config config = Config.serverDefaults(stringMap("dbms.connector.http.address", "localhost:123"));
ConfigValue address = config.getConfigValues().entrySet().stream().filter(c -> c.getKey().equals("dbms.connector.http.address")).map(Entry::getValue).findAny().orElseThrow(() -> new RuntimeException("Setting not present!"));
assertTrue(address.deprecated());
assertEquals(Optional.of("dbms.connector.http.listen_address"), address.replacement());
}
use of org.neo4j.kernel.configuration.Config in project neo4j by neo4j.
the class ConfigAdapterTest method shouldGetPropertyInRightFormat.
@Test
public void shouldGetPropertyInRightFormat() throws Exception {
// GIVEN
Config config = Config.defaults();
ConfigAdapter wrappingConfiguration = new ConfigAdapter(config);
// WHEN
wrappingConfiguration.setProperty(ServerSettings.rest_api_path.name(), "http://localhost:7474///db///data///");
final Object dataPath = wrappingConfiguration.getProperty(ServerSettings.rest_api_path.name());
// THEN
assertEquals(new URI(ServerSettings.rest_api_path.getDefaultValue()), dataPath);
}
use of org.neo4j.kernel.configuration.Config in project neo4j by neo4j.
the class ConfigAdapterTest method shouldGetDefaultPropertyByKey.
@Test
public void shouldGetDefaultPropertyByKey() throws Exception {
// GIVEN
Config config = Config.defaults();
ConfigAdapter wrappingConfiguration = new ConfigAdapter(config);
// WHEN
final Object propertyValue = wrappingConfiguration.getProperty(ServerSettings.rest_api_path.name());
// THEN
assertEquals(new URI(ServerSettings.rest_api_path.getDefaultValue()), propertyValue);
}
use of org.neo4j.kernel.configuration.Config in project neo4j by neo4j.
the class ConfigAdapterTest method shouldAbleToAccessRegisteredPropertyByName.
@Test
public void shouldAbleToAccessRegisteredPropertyByName() {
Config config = Config.defaults();
ConfigAdapter wrappingConfiguration = new ConfigAdapter(config);
assertEquals(60000L, wrappingConfiguration.getProperty(ServerSettings.transaction_idle_timeout.name()));
}
Aggregations