Search in sources :

Example 1 with BaseSynchronizedGraph

use of org.pentaho.metaverse.api.model.BaseSynchronizedGraph in project pentaho-metaverse by pentaho.

the class SynchronizedGraphFactoryTest method testWrapGraph.

@Test
public void testWrapGraph() throws Exception {
    Graph g = new TinkerGraph();
    BaseSynchronizedGraph wrapped = (BaseSynchronizedGraph) SynchronizedGraphFactory.wrapGraph(g);
    assertNotNull(wrapped);
    assertTrue(wrapped.getGraph() instanceof IdGraph);
    assertTrue(wrapped.getGraph() instanceof KeyIndexableGraph);
}
Also used : BaseSynchronizedGraph(org.pentaho.metaverse.api.model.BaseSynchronizedGraph) KeyIndexableGraph(com.tinkerpop.blueprints.KeyIndexableGraph) IdGraph(com.tinkerpop.blueprints.util.wrappers.id.IdGraph) TinkerGraph(com.tinkerpop.blueprints.impls.tg.TinkerGraph) Graph(com.tinkerpop.blueprints.Graph) TinkerGraph(com.tinkerpop.blueprints.impls.tg.TinkerGraph) KeyIndexableGraph(com.tinkerpop.blueprints.KeyIndexableGraph) IdGraph(com.tinkerpop.blueprints.util.wrappers.id.IdGraph) BaseSynchronizedGraph(org.pentaho.metaverse.api.model.BaseSynchronizedGraph) Test(org.junit.Test)

Example 2 with BaseSynchronizedGraph

use of org.pentaho.metaverse.api.model.BaseSynchronizedGraph in project pentaho-metaverse by pentaho.

the class SynchronizedGraphFactoryTest method testOpen_Map.

@Test
public void testOpen_Map() throws Exception {
    Map<String, String> config = new HashMap<String, String>();
    config.put("blueprints.graph", "com.tinkerpop.blueprints.impls.tg.TinkerGraph");
    Graph g = SynchronizedGraphFactory.open(config);
    assertTrue(g instanceof BaseSynchronizedGraph);
}
Also used : BaseSynchronizedGraph(org.pentaho.metaverse.api.model.BaseSynchronizedGraph) KeyIndexableGraph(com.tinkerpop.blueprints.KeyIndexableGraph) IdGraph(com.tinkerpop.blueprints.util.wrappers.id.IdGraph) TinkerGraph(com.tinkerpop.blueprints.impls.tg.TinkerGraph) Graph(com.tinkerpop.blueprints.Graph) HashMap(java.util.HashMap) BaseSynchronizedGraph(org.pentaho.metaverse.api.model.BaseSynchronizedGraph) Test(org.junit.Test)

Example 3 with BaseSynchronizedGraph

use of org.pentaho.metaverse.api.model.BaseSynchronizedGraph in project pentaho-metaverse by pentaho.

the class SynchronizedGraphFactoryTest method testOpen_Configuration.

@Test
public void testOpen_Configuration() throws Exception {
    Configuration config = new PropertiesConfiguration();
    config.addProperty("blueprints.graph", "com.tinkerpop.blueprints.impls.tg.TinkerGraph");
    Graph g = SynchronizedGraphFactory.open(config);
    assertTrue(g instanceof BaseSynchronizedGraph);
}
Also used : BaseSynchronizedGraph(org.pentaho.metaverse.api.model.BaseSynchronizedGraph) KeyIndexableGraph(com.tinkerpop.blueprints.KeyIndexableGraph) IdGraph(com.tinkerpop.blueprints.util.wrappers.id.IdGraph) TinkerGraph(com.tinkerpop.blueprints.impls.tg.TinkerGraph) Graph(com.tinkerpop.blueprints.Graph) Configuration(org.apache.commons.configuration.Configuration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) BaseSynchronizedGraph(org.pentaho.metaverse.api.model.BaseSynchronizedGraph) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) Test(org.junit.Test)

Example 4 with BaseSynchronizedGraph

use of org.pentaho.metaverse.api.model.BaseSynchronizedGraph in project pentaho-metaverse by pentaho.

the class SynchronizedGraphFactoryTest method testOpen_File.

@Test
public void testOpen_File() throws Exception {
    String config = "src/test/resources/graph.properties";
    Graph g = SynchronizedGraphFactory.open(config);
    assertTrue(g instanceof BaseSynchronizedGraph);
}
Also used : BaseSynchronizedGraph(org.pentaho.metaverse.api.model.BaseSynchronizedGraph) KeyIndexableGraph(com.tinkerpop.blueprints.KeyIndexableGraph) IdGraph(com.tinkerpop.blueprints.util.wrappers.id.IdGraph) TinkerGraph(com.tinkerpop.blueprints.impls.tg.TinkerGraph) Graph(com.tinkerpop.blueprints.Graph) BaseSynchronizedGraph(org.pentaho.metaverse.api.model.BaseSynchronizedGraph) Test(org.junit.Test)

Aggregations

Graph (com.tinkerpop.blueprints.Graph)4 KeyIndexableGraph (com.tinkerpop.blueprints.KeyIndexableGraph)4 TinkerGraph (com.tinkerpop.blueprints.impls.tg.TinkerGraph)4 IdGraph (com.tinkerpop.blueprints.util.wrappers.id.IdGraph)4 Test (org.junit.Test)4 BaseSynchronizedGraph (org.pentaho.metaverse.api.model.BaseSynchronizedGraph)4 HashMap (java.util.HashMap)1 Configuration (org.apache.commons.configuration.Configuration)1 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)1