Package com.thinkaurelius.titan.blueprints

Source Code of com.thinkaurelius.titan.blueprints.EmbeddedCassandraBlueprintsTest

package com.thinkaurelius.titan.blueprints;

import org.apache.commons.configuration.Configuration;
import org.junit.experimental.categories.Category;

import com.thinkaurelius.titan.CassandraStorageSetup;
import com.thinkaurelius.titan.core.TitanFactory;
import com.thinkaurelius.titan.diskstorage.StorageException;
import com.thinkaurelius.titan.diskstorage.cassandra.embedded.CassandraEmbeddedStoreManager;
import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration;
import com.tinkerpop.blueprints.Graph;

/**
* @author Matthias Broecheler (me@matthiasb.com)
*/

public class EmbeddedCassandraBlueprintsTest extends TitanBlueprintsTest {

    @Override
    public void shutDown() {
        //Do nothing
    }

    @Override
    public void startUp() {
        //Do nothing
    }

    @Override
    public Graph generateGraph() {
        Graph graph = TitanFactory.open(getGraphConfig());
        return graph;
    }

    @Override
    public void cleanUp() throws StorageException {
        CassandraEmbeddedStoreManager s = new CassandraEmbeddedStoreManager(
                getGraphConfig().subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE));
        s.clearStorage();
    }

    @Override
    public boolean supportsMultipleGraphs() {
        return false;
    }

    @Override
    public Graph generateGraph(String s) {
        throw new UnsupportedOperationException();
    }

    private Configuration getGraphConfig() {
        return CassandraStorageSetup.getEmbeddedCassandraGraphConfiguration(getClass().getSimpleName());
    }
}
TOP

Related Classes of com.thinkaurelius.titan.blueprints.EmbeddedCassandraBlueprintsTest

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.