Procházet zdrojové kódy

Added Dependency for Tinkerpop framework

Jan Enders před 8 roky
rodič
revize
ff2483da25

+ 5 - 0
scopviz/pom.xml

@@ -21,5 +21,10 @@
       <version>3.8.1</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+    	<groupId>com.tinkerpop.blueprints</groupId>
+    	<artifactId>blueprints-core</artifactId>
+    	<version>2.6.0</version>
+    </dependency>
   </dependencies>
 </project>

+ 16 - 6
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/App.java

@@ -1,13 +1,23 @@
 package de.tu_darmstadt.informatik.tk.scopviz;
 
+import com.tinkerpop.blueprints.impls.tg.*;
+import com.tinkerpop.blueprints.*;
+
 /**
  * Hello world!
  *
  */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
+public class App {
+
+	public static void main(String[] args) {
+		
+		Graph graph = new TinkerGraph();
+		Vertex a = graph.addVertex(null);
+		Vertex b = graph.addVertex(null);
+		a.setProperty("name", "marko");
+		b.setProperty("name", "peter");
+		Edge e = graph.addEdge(null, a, b, "knows");
+		System.out.println(e.getVertex(Direction.OUT).getProperty("name") + "--" + e.getLabel() + "-->" + e.getVertex(Direction.IN).getProperty("name"));
+		System.out.println("Hello World!");
+	}
 }

+ 22 - 26
scopviz/src/test/java/de/tu_darmstadt/informatik/tk/scopviz/AppTest.java

@@ -7,32 +7,28 @@ import junit.framework.TestSuite;
 /**
  * Unit test for simple App.
  */
-public class AppTest 
-    extends TestCase
-{
-    /**
-     * Create the test case
-     *
-     * @param testName name of the test case
-     */
-    public AppTest( String testName )
-    {
-        super( testName );
-    }
+public class AppTest extends TestCase {
+	/**
+	 * Create the test case
+	 *
+	 * @param testName
+	 *            name of the test case
+	 */
+	public AppTest(String testName) {
+		super(testName);
+	}
 
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite()
-    {
-        return new TestSuite( AppTest.class );
-    }
+	/**
+	 * @return the suite of tests being tested
+	 */
+	public static Test suite() {
+		return new TestSuite(AppTest.class);
+	}
 
-    /**
-     * Rigourous Test :-)
-     */
-    public void testApp()
-    {
-        assertTrue( true );
-    }
+	/**
+	 * Rigourous Test :-)
+	 */
+	public void testApp() {
+		assertTrue(true);
+	}
 }