package de.unikoblenz.west.lkastler;

import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;

import com.thinkaurelius.titan.core.TitanFactory;
import com.thinkaurelius.titan.core.TitanGraph;
import com.tinkerpop.blueprints.Vertex;

/**
 * simple test
 * 
 * @author lkastler
 *
 */
public class MainTest {

	static Logger log = LogManager.getLogger();
	
	@Test
	public void simpleTitanTest() {
		log.info("START");
		
		Configuration conf = new BaseConfiguration();
		conf.setProperty("storage.directory", "/tmp/graph");
		conf.setProperty("storage.backend", "berkeleyje");
		TitanGraph g = TitanFactory.open(conf);
		
		Vertex juno = g.addVertex(null);
		juno.setProperty("name", "juno");
		Vertex jupiter = g.addVertex(null);
		jupiter.setProperty("name", "jupiter");
		g.addEdge(null, juno, jupiter, "married");
		
		for(Vertex v : juno.query().labels("married").vertices()) {
			log.info(v.getProperty("name"));
		}
		log.info("END");
	}
}

@@ -71,20 +71,16 @@
 uration.
-Base
 Configur
@@ -118,32 +118,42 @@
 s.configuration.
+Properties
 Configuration;%0Ai
@@ -557,19 +557,36 @@
 anTest()
+ throws Throwable
  %7B%0A
-
 %09%09log.in
@@ -632,12 +632,18 @@
 new 
-Base
+Properties
 Conf
@@ -656,116 +656,73 @@
 ion(
-);%0A%09%09conf.setProperty(%22storage.directory%22, %22/tmp/graph%22);%0A%09%09conf.setProperty(%22storage.backend%22, %22berkeleyje%22
+this.getClass().getClassLoader().getResource(%22config.properties%22)
 );%0A%09

test for cassandra now