use of org.apache.tinkerpop.gremlin.server.Settings in project janusgraph by JanusGraph.
the class JanusGraphSettingsUtilsTest method testSetDefaultSerializersWithGryoWithResultToString.
@Test
public void testSetDefaultSerializersWithGryoWithResultToString() throws Exception {
Settings settings = JanusGraphSettings.read("src/test/resources/janusgraph-server-without-serializers.yaml");
Optional<Settings.SerializerSettings> graphBinary = settings.serializers.stream().filter(it -> it.className.equals("org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0")).skip(1).findFirst();
assertTrue(graphBinary.isPresent());
assertTrue((boolean) graphBinary.get().config.get("serializeResultToString"));
}
use of org.apache.tinkerpop.gremlin.server.Settings in project janusgraph by JanusGraph.
the class JanusGraphSettingsUtilsTest method testSetDefaultSerializersWithGryoWithRegistry.
@Test
public void testSetDefaultSerializersWithGryoWithRegistry() throws Exception {
Settings settings = JanusGraphSettings.read("src/test/resources/janusgraph-server-without-serializers.yaml");
Optional<Settings.SerializerSettings> gryo = settings.serializers.stream().filter(it -> it.className.equals("org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0") && it.config.get("ioRegistries") != null).findFirst();
assertTrue(gryo.isPresent());
assertTrue(((List) gryo.get().config.get("ioRegistries")).contains("org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry"));
}
use of org.apache.tinkerpop.gremlin.server.Settings in project janusgraph by JanusGraph.
the class JanusGraphServerTest method testSerializersAreConfigured.
@Test
public void testSerializersAreConfigured() {
final JanusGraphServer server = new JanusGraphServer("src/test/resources/janusgraph-server-without-serializers.yaml");
CompletableFuture<Void> start = server.start();
assertFalse(start.isCompletedExceptionally());
Settings settings = server.getJanusGraphSettings();
assertEquals(5, settings.serializers.size());
CompletableFuture<Void> stop = server.stop();
CompletableFuture.allOf(start, stop).join();
}
use of org.apache.tinkerpop.gremlin.server.Settings in project janusgraph by JanusGraph.
the class AbstractGremlinServerIntegrationTest method startServer.
public void startServer(final Settings settings) throws Exception {
if (null == settings) {
startServer();
} else {
final Settings overridenSettings = overrideSettings(settings);
if (GREMLIN_SERVER_EPOLL) {
overridenSettings.useEpollEventLoop = true;
}
this.server = new GremlinServer(overridenSettings);
server.start().join();
}
}
use of org.apache.tinkerpop.gremlin.server.Settings in project janusgraph by JanusGraph.
the class ManagementLoggerGraphCacheEvictionTest method graphShouldBeRemovedFromCache.
@Test
public void graphShouldBeRemovedFromCache() throws InterruptedException {
final JanusGraphManager jgm = new JanusGraphManager(new Settings());
assertNotNull(jgm);
assertNotNull(JanusGraphManager.getInstance());
assertNull(jgm.getGraph("graph1"));
final Map<String, Object> map = new HashMap<>();
map.put(STORAGE_BACKEND.toStringWithoutRoot(), "inmemory");
map.put(GRAPH_NAME.toStringWithoutRoot(), "graph1");
final MapConfiguration config = ConfigurationUtil.loadMapConfiguration(map);
final StandardJanusGraph graph = new StandardJanusGraph(new GraphDatabaseConfigurationBuilder().build(new CommonsConfiguration(config)));
jgm.putGraph("graph1", graph);
assertEquals("graph1", ((StandardJanusGraph) JanusGraphManager.getInstance().getGraph("graph1")).getGraphName());
final ManagementSystem mgmt = (ManagementSystem) graph.openManagement();
mgmt.evictGraphFromCache();
mgmt.commit();
// wait for log to be asynchronously pulled
Thread.sleep(10000);
assertNull(jgm.getGraph("graph1"));
}
Aggregations