Package com.tinkerpop.blueprints

Source Code of com.tinkerpop.blueprints.GraphFactoryTest

package com.tinkerpop.blueprints;

import com.tinkerpop.blueprints.impls.tg.TinkerGraph;
import junit.framework.TestCase;
import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration;

import java.util.HashMap;
import java.util.Map;

/**
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
public class GraphFactoryTest extends TestCase {

    public void testOpenInMemoryTinkerGraphViaApacheConfig(){
        final Configuration conf = new BaseConfiguration();
        conf.setProperty("blueprints.graph", "com.tinkerpop.blueprints.impls.tg.TinkerGraph");
        final Graph g = GraphFactory.open(conf);

        assertNotNull(g);
        assertTrue(g instanceof TinkerGraph);
    }

    public void testOpenInMemoryTinkerGraphViaMap(){
        final Map<String,Object> conf = new HashMap<String,Object>();
        conf.put("blueprints.graph", "com.tinkerpop.blueprints.impls.tg.TinkerGraph");
        final Graph g = GraphFactory.open(conf);

        assertNotNull(g);
        assertTrue(g instanceof TinkerGraph);
    }
}
TOP

Related Classes of com.tinkerpop.blueprints.GraphFactoryTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.