Search in sources :

Example 6 with Settings

use of org.apache.tinkerpop.gremlin.server.Settings in project janusgraph by JanusGraph.

the class JanusGraphGrpcServerBaseTest method getGraphManager.

protected static GraphManager getGraphManager() {
    Settings settings = new Settings();
    HashMap<String, String> map = new HashMap<>();
    map.put("graph", "src/test/resources/janusgraph-inmemory.properties");
    map.put("graph2", "src/test/resources/janusgraph-inmemory.properties");
    map.put("tinkergraph", "src/test/resources/tinkergraph.properties");
    settings.graphs = map;
    return new DefaultGraphManager(settings);
}
Also used : HashMap(java.util.HashMap) DefaultGraphManager(org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager) Settings(org.apache.tinkerpop.gremlin.server.Settings)

Example 7 with Settings

use of org.apache.tinkerpop.gremlin.server.Settings in project janusgraph by JanusGraph.

the class AbstractConfiguredGraphFactoryTest method setup.

@BeforeEach
public void setup() {
    if (gm != null)
        return;
    gm = new JanusGraphManager(new Settings());
    final MapConfiguration config = getManagementConfig();
    final StandardJanusGraph graph = new StandardJanusGraph(new GraphDatabaseConfigurationBuilder().build(new CommonsConfiguration(config)));
    // Instantiate the ConfigurationManagementGraph Singleton
    new ConfigurationManagementGraph(graph);
}
Also used : GraphDatabaseConfigurationBuilder(org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder) MapConfiguration(org.apache.commons.configuration2.MapConfiguration) JanusGraphManager(org.janusgraph.graphdb.management.JanusGraphManager) CommonsConfiguration(org.janusgraph.diskstorage.configuration.backend.CommonsConfiguration) Settings(org.apache.tinkerpop.gremlin.server.Settings) StandardJanusGraph(org.janusgraph.graphdb.database.StandardJanusGraph) ConfigurationManagementGraph(org.janusgraph.graphdb.management.ConfigurationManagementGraph) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 8 with Settings

use of org.apache.tinkerpop.gremlin.server.Settings in project janusgraph by JanusGraph.

the class JanusGraphSettingsUtilsTest method testSetDefaultSerializers.

@Test
public void testSetDefaultSerializers() throws Exception {
    Settings settings = JanusGraphSettings.read("src/test/resources/janusgraph-server-without-serializers.yaml");
    assertEquals(5, settings.serializers.size());
}
Also used : Settings(org.apache.tinkerpop.gremlin.server.Settings) JanusGraphSettings(org.janusgraph.graphdb.server.JanusGraphSettings) Test(org.junit.jupiter.api.Test)

Example 9 with Settings

use of org.apache.tinkerpop.gremlin.server.Settings in project janusgraph by JanusGraph.

the class JanusGraphSettingsUtilsTest method testDontOverwriteSerializers.

@Test
public void testDontOverwriteSerializers() throws Exception {
    Settings settings = JanusGraphSettings.read("src/test/resources/janusgraph-server-with-serializers.yaml");
    assertEquals(11, settings.serializers.size());
}
Also used : Settings(org.apache.tinkerpop.gremlin.server.Settings) JanusGraphSettings(org.janusgraph.graphdb.server.JanusGraphSettings) Test(org.junit.jupiter.api.Test)

Example 10 with Settings

use of org.apache.tinkerpop.gremlin.server.Settings in project janusgraph by JanusGraph.

the class JanusGraphSettingsUtilsTest method testSetDefaultSerializersWithGraphSONWithRegistry.

@Test
public void testSetDefaultSerializersWithGraphSONWithRegistry() throws Exception {
    Settings settings = JanusGraphSettings.read("src/test/resources/janusgraph-server-without-serializers.yaml");
    Optional<Settings.SerializerSettings> graphson = settings.serializers.stream().filter(it -> it.className.equals("org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0") && it.config.get("ioRegistries") != null).findFirst();
    assertTrue(graphson.isPresent());
    assertTrue(((List) graphson.get().config.get("ioRegistries")).contains("org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry"));
}
Also used : Test(org.junit.jupiter.api.Test) List(java.util.List) Settings(org.apache.tinkerpop.gremlin.server.Settings) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Optional(java.util.Optional) JanusGraphSettings(org.janusgraph.graphdb.server.JanusGraphSettings) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Settings(org.apache.tinkerpop.gremlin.server.Settings) JanusGraphSettings(org.janusgraph.graphdb.server.JanusGraphSettings) Test(org.junit.jupiter.api.Test)

Aggregations

Settings (org.apache.tinkerpop.gremlin.server.Settings)12 Test (org.junit.jupiter.api.Test)9 JanusGraphSettings (org.janusgraph.graphdb.server.JanusGraphSettings)7 List (java.util.List)3 Optional (java.util.Optional)3 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)3 Assertions.assertTrue (org.junit.jupiter.api.Assertions.assertTrue)3 HashMap (java.util.HashMap)2 MapConfiguration (org.apache.commons.configuration2.MapConfiguration)2 CommonsConfiguration (org.janusgraph.diskstorage.configuration.backend.CommonsConfiguration)2 GraphDatabaseConfigurationBuilder (org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder)2 StandardJanusGraph (org.janusgraph.graphdb.database.StandardJanusGraph)2 GremlinServer (org.apache.tinkerpop.gremlin.server.GremlinServer)1 DefaultGraphManager (org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager)1 ManagementSystem (org.janusgraph.graphdb.database.management.ManagementSystem)1 ConfigurationManagementGraph (org.janusgraph.graphdb.management.ConfigurationManagementGraph)1 JanusGraphManager (org.janusgraph.graphdb.management.JanusGraphManager)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1