Package com.tinkerpop.frames.domain.incidences

Examples of com.tinkerpop.frames.domain.incidences.Created


        CreatedBy createdBy = lop.getCreatedBy().iterator().next();
        assertEquals(lop, createdBy.getDomain());
        assertTrue(createdBy.getRange().equals(marko) || createdBy.getRange().equals(peter) || createdBy.getRange().equals(josh));
       
        Created created = marko.getCreated().iterator().next();
        //Please note: the below results are actually incorrect: the domain and range are incorrectly tagged
        // in Created for usage with @Incidence. I'm not going to fix that in the test-cases as Domain and
        // Range are deprecated now. The incorrect annotations probable show better than anything that
        // the now deprecated annotations are quite confusing:
        assertEquals(lop, created.getRange()); //range actually returns a Person, not a Project...
        assertEquals(marko, created.getDomain()); //domain actually returns a Project, not a Person...
       



    }
View Full Code Here


    @Test
    public void testEquality() {

        //Deprecated Domain/Range:
        Created created = marko.getCreated().iterator().next();
        WeightedEdge weightedEdge = framedGraph.frame(created.asEdge(), Direction.OUT, WeightedEdge.class);
        assertEquals(created, weightedEdge);
       
        //Initial/Terminal:
        CreatedInfo createdInfo = marko.getCreatedInfo().iterator().next();
        assertEquals(createdInfo, weightedEdge);
View Full Code Here

    /**
     * Uses deprecated Domain/Range annotations
     */
    @Test
    public void testAddingIncidencesDeprecated() {
        Created markoCreatedRipple = marko.addCreated(ripple);
        assertEquals(newHashSet(markoCreatedRipple, markoCreatedLop),
                     newHashSet(marko.getCreated()));
        assertNull(markoCreatedRipple.getWeight());
        markoCreatedRipple.setWeight(0.0f);
        assertEquals(0.0f, markoCreatedRipple.getWeight(), 0.01f);
    }
View Full Code Here

        assertEquals(lop.getLanguage(), "java");

        CreatedInfo markoCreatedLopInfo = framedGraph.getEdge(9, CreatedInfo.class);
        assertEquals(markoCreatedLopInfo.getWeight(), 0.4f, 0.1f);
        //Same with using deprecated Domain/Range annotations:
        Created markoCreatedLop = framedGraph.getEdge(9, Direction.OUT, Created.class);
        assertEquals(markoCreatedLop.getWeight(), 0.4f, 0.1f);
        CreatedBy lopCreatedByMarko = framedGraph.getEdge(9, Direction.IN, CreatedBy.class);
        assertEquals(lopCreatedByMarko.getWeight(), 0.4f, 0.1f);

        Person temp = framedGraph.frame(graph.addVertex(null), Person.class);
        assertNull(temp.getName());
View Full Code Here

        markoCreatedLopInfo.setWeight(99.0f);
        assertEquals(markoCreatedLopInfo.getWeight(), 99.0f, 0.1f);
        markoCreatedLopInfo.setWeight(0.4f);
       
        //Same with deprecated Domain/Range annotations:
        Created markoCreatedLop = framedGraph.getEdge(9, Direction.OUT, Created.class);
        assertEquals(markoCreatedLop.getWeight(), 0.4f, 0.1f);
        markoCreatedLop.setWeight(99.0f);
        assertEquals(markoCreatedLop.getWeight(), 99.0f, 0.1f);
    }
View Full Code Here

        assertEquals("v[1]", marko.toString());

        CreatedInfo markoCreatedLopInfo = framedGraph.getEdge(9, CreatedInfo.class);
        assertEquals("e[9][1-created->3]", markoCreatedLopInfo.toString());
        //Using deprecated Domain/Range annotations:
        Created markoCreatedLop = framedGraph.getEdge(9, Direction.OUT, Created.class);
        assertEquals("e[9][1-created->3]", markoCreatedLop.toString());
    }
View Full Code Here

TOP

Related Classes of com.tinkerpop.frames.domain.incidences.Created

Copyright © 2018 www.massapicom. 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.