Search in sources :

Example 21 with Person

use of com.tinkerpop.frames.domain.classes.Person in project frames by tinkerpop.

the class JavaHandlerTest method testMethodNotImplemented.

@Test(expected = JavaHandlerException.class)
public void testMethodNotImplemented() {
    Person person = g.getVertex(1, Person.class);
    person.notImplemented();
}
Also used : Person(com.tinkerpop.frames.domain.classes.Person) Test(org.junit.Test)

Example 22 with Person

use of com.tinkerpop.frames.domain.classes.Person in project frames by tinkerpop.

the class FramedVertexTest method testDeprecatedKnowsPeople.

@Test
public void testDeprecatedKnowsPeople() {
    Person marko = framedGraph.frame(graph.getVertex(1), Person.class);
    assertEquals(newHashSet(vadas, josh), newHashSet(marko.getDeprecatedKnowsPeople()));
}
Also used : Person(com.tinkerpop.frames.domain.classes.Person) Test(org.junit.Test)

Example 23 with Person

use of com.tinkerpop.frames.domain.classes.Person in project frames by tinkerpop.

the class FramedVertexTest method testBooleanGetMethods.

@Test
public void testBooleanGetMethods() {
    Person marko = framedGraph.frame(graph.getVertex(1), Person.class);
    marko.setBoolean(true);
    assertTrue(marko.isBoolean());
    assertTrue(marko.isBooleanPrimitive());
    assertTrue(marko.canBoolean());
    assertTrue(marko.canBooleanPrimitive());
}
Also used : Person(com.tinkerpop.frames.domain.classes.Person) Test(org.junit.Test)

Example 24 with Person

use of com.tinkerpop.frames.domain.classes.Person in project frames by tinkerpop.

the class FrameInitializerTest method testEdgeInitialization.

@Test
public void testEdgeInitialization() {
    Person person1 = framedGraph.addVertex(null, Person.class);
    Person person2 = framedGraph.addVertex(null, Person.class);
    person1.addKnows(person2);
    assertEquals(Float.valueOf(1.0f), person1.getKnows().iterator().next().getWeight());
}
Also used : Person(com.tinkerpop.frames.domain.classes.Person) Test(org.junit.Test)

Example 25 with Person

use of com.tinkerpop.frames.domain.classes.Person in project frames by tinkerpop.

the class FrameInitializerTest method testDeprecatedRegistration.

@Test
public void testDeprecatedRegistration() {
    Graph graph = TinkerGraphFactory.createTinkerGraph();
    FramedGraph<Graph> framedGraph = new FramedGraph(graph);
    framedGraph.registerFrameInitializer(nameDefaulter);
    Person person = framedGraph.addVertex(null, Person.class);
    assertEquals("Defaulted", person.getName());
}
Also used : Graph(com.tinkerpop.blueprints.Graph) Person(com.tinkerpop.frames.domain.classes.Person) Test(org.junit.Test)

Aggregations

Person (com.tinkerpop.frames.domain.classes.Person)25 Test (org.junit.Test)21 Graph (com.tinkerpop.blueprints.Graph)15 TinkerGraph (com.tinkerpop.blueprints.impls.tg.TinkerGraph)11 Vertex (com.tinkerpop.blueprints.Vertex)6 Edge (com.tinkerpop.blueprints.Edge)5 FramedGraph (com.tinkerpop.frames.FramedGraph)4 Knows (com.tinkerpop.frames.domain.incidences.Knows)4 FramedGraphFactory (com.tinkerpop.frames.FramedGraphFactory)3 Created (com.tinkerpop.frames.domain.incidences.Created)3 CreatedInfo (com.tinkerpop.frames.domain.incidences.CreatedInfo)3 TransactionalGraph (com.tinkerpop.blueprints.TransactionalGraph)2 FramedGraphConfiguration (com.tinkerpop.frames.FramedGraphConfiguration)2 Project (com.tinkerpop.frames.domain.classes.Project)2 AbstractModule (com.tinkerpop.frames.modules.AbstractModule)2 TypeResolver (com.tinkerpop.frames.modules.TypeResolver)2 HashSet (java.util.HashSet)2 GraphQuery (com.tinkerpop.blueprints.GraphQuery)1 Predicate (com.tinkerpop.blueprints.Predicate)1 CreatedBy (com.tinkerpop.frames.domain.incidences.CreatedBy)1