use of org.apache.commons.configuration2.MapConfiguration in project janusgraph by JanusGraph.
the class GraphDatabaseConfigurationInstanceIdTest method instanceIdShouldEqualHostname.
@Test
public void instanceIdShouldEqualHostname() throws UnknownHostException {
final Map<String, Object> map = getStorageConfiguration();
map.put(UNIQUE_INSTANCE_ID_HOSTNAME.toStringWithoutRoot(), true);
final MapConfiguration config = ConfigurationUtil.loadMapConfiguration(map);
final StandardJanusGraph graph = new StandardJanusGraph(new GraphDatabaseConfigurationBuilder().build(new CommonsConfiguration(config)));
assertEquals(1, graph.openManagement().getOpenInstances().size());
assertEquals(toCurrentInstance(Inet4Address.getLocalHost().getHostName()), graph.openManagement().getOpenInstances().iterator().next());
graph.close();
}
use of org.apache.commons.configuration2.MapConfiguration in project janusgraph by JanusGraph.
the class GraphDatabaseConfigurationInstanceExecutorServiceTest method shouldCreateCustomBackendFixedThreadPoolSize.
@Test
public void shouldCreateCustomBackendFixedThreadPoolSize() {
final Map<String, Object> map = getStorageConfiguration();
map.put(UNIQUE_INSTANCE_ID_HOSTNAME.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_OPS.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_EXECUTOR_SERVICE_CORE_POOL_SIZE.toStringWithoutRoot(), 15);
final MapConfiguration config = ConfigurationUtil.loadMapConfiguration(map);
assertDoesNotThrow(() -> {
final StandardJanusGraph graph = new StandardJanusGraph(new GraphDatabaseConfigurationBuilder().build(new CommonsConfiguration(config)));
graph.traversal().V().hasNext();
graph.close();
});
}
use of org.apache.commons.configuration2.MapConfiguration in project janusgraph by JanusGraph.
the class GraphDatabaseConfigurationInstanceExecutorServiceTest method shouldCreateCustomBackendExecutorServiceWithoutExecutorServiceConfigurationConstructor.
@Test
public void shouldCreateCustomBackendExecutorServiceWithoutExecutorServiceConfigurationConstructor() {
final Map<String, Object> map = getStorageConfiguration();
map.put(UNIQUE_INSTANCE_ID_HOSTNAME.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_OPS.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_EXECUTOR_SERVICE_CLASS.toStringWithoutRoot(), CustomParameterlessExecutorServiceImplementation.class.getName());
final MapConfiguration config = ConfigurationUtil.loadMapConfiguration(map);
assertDoesNotThrow(() -> {
final StandardJanusGraph graph = new StandardJanusGraph(new GraphDatabaseConfigurationBuilder().build(new CommonsConfiguration(config)));
graph.traversal().V().hasNext();
graph.close();
});
}
use of org.apache.commons.configuration2.MapConfiguration in project janusgraph by JanusGraph.
the class GraphDatabaseConfigurationInstanceExecutorServiceTest method shouldCreateCustomBackendExecutorServiceWithoutBothExecutorServiceConfigurationConstructors.
@Test
public void shouldCreateCustomBackendExecutorServiceWithoutBothExecutorServiceConfigurationConstructors() {
final Map<String, Object> map = getStorageConfiguration();
map.put(UNIQUE_INSTANCE_ID_HOSTNAME.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_OPS.toStringWithoutRoot(), true);
map.put(PARALLEL_BACKEND_EXECUTOR_SERVICE_CORE_POOL_SIZE.toStringWithoutRoot(), 15);
map.put(PARALLEL_BACKEND_EXECUTOR_SERVICE_CLASS.toStringWithoutRoot(), CustomExecutorServiceWithBothConstructorsImplementation.class.getName());
final MapConfiguration config = ConfigurationUtil.loadMapConfiguration(map);
assertDoesNotThrow(() -> {
final StandardJanusGraph graph = new StandardJanusGraph(new GraphDatabaseConfigurationBuilder().build(new CommonsConfiguration(config)));
graph.traversal().V().hasNext();
graph.close();
});
}
use of org.apache.commons.configuration2.MapConfiguration in project bitflyer4j by after-the-sunrise.
the class EnvironmentImplTest method setUp.
@BeforeMethod
public void setUp() throws Exception {
conf = new MapConfiguration(new HashMap<>());
target = new EnvironmentImpl(conf, conf);
}
Aggregations