Package com.tinkerpop.gremlin.structure

Examples of com.tinkerpop.gremlin.structure.Vertex.property()


    @Test
    @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
    public void shouldNotConstructNewWithSomethingAlreadyDetached() {
        final Vertex v = g.addVertex();
        final VertexProperty vp = v.property("test", "this");
        final DetachedVertexProperty dvp = DetachedVertexProperty.detach(vp);
        assertSame(dvp, DetachedVertexProperty.detach(dvp));
    }

    @Test
View Full Code Here


    @Test
    @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
    public void shouldConstructDetachedPropertyWithPropertyFromVertex() {
        final Vertex v = g.addVertex();
        final VertexProperty vp = v.property("test", "this");
        final DetachedVertexProperty mp = DetachedVertexProperty.detach(vp);
        assertEquals("test", mp.key());
        assertEquals("this", mp.value());
        assertFalse(mp.isHidden());
        assertEquals(DetachedVertex.class, mp.element().getClass());
View Full Code Here

    @Test
    @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
    public void shouldConstructDetachedPropertyWithHiddenFromVertex() {
        final Vertex v = g.addVertex();
        final VertexProperty vp = v.property(Graph.Key.hide("test"), "this");
        final DetachedVertexProperty mp = DetachedVertexProperty.detach(vp);
        assertEquals("test", mp.key());
        assertEquals("this", mp.value());
        assertTrue(mp.isHidden());
        assertEquals(DetachedVertex.class, mp.element().getClass());
View Full Code Here

    @Test(expected = UnsupportedOperationException.class)
    @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
    public void shouldNotSupportRemove() {
        final Vertex v = g.addVertex();
        final VertexProperty vp = v.property("test", "this");
        DetachedVertexProperty.detach(vp).remove();
    }

    @Test
    @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
View Full Code Here

    @Test
    @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
    public void shouldBeEqualsPropertiesAsIdIsTheSame() {
        final Vertex v = g.addVertex();
        final VertexProperty vp = v.property("test", "this");
        final DetachedVertexProperty mp1 = DetachedVertexProperty.detach(vp);
        final DetachedVertexProperty mp2 = DetachedVertexProperty.detach(vp);
        assertTrue(mp1.equals(mp2));
    }
View Full Code Here

    @Test
    @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
    public void shouldNotBeEqualsPropertiesAsIdIsDifferent() {
        final Vertex v = g.addVertex();
        final VertexProperty vp1 = v.property("test", "this");
        final DetachedVertexProperty mp1 = DetachedVertexProperty.detach(vp1);
        final VertexProperty vp2 = v.property("testing", "this");
        final DetachedVertexProperty mp2 = DetachedVertexProperty.detach(vp2);
        assertFalse(mp1.equals(mp2));
    }
View Full Code Here

    @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
    public void shouldNotBeEqualsPropertiesAsIdIsDifferent() {
        final Vertex v = g.addVertex();
        final VertexProperty vp1 = v.property("test", "this");
        final DetachedVertexProperty mp1 = DetachedVertexProperty.detach(vp1);
        final VertexProperty vp2 = v.property("testing", "this");
        final DetachedVertexProperty mp2 = DetachedVertexProperty.detach(vp2);
        assertFalse(mp1.equals(mp2));
    }

    @Test
View Full Code Here

        ));

        final Vertex v = swg.addVertex("any", "thing");

        assertNotNull(v);
        assertEquals("thing", v.property("any").value());
        assertEquals(3, v.values("anonymous").toList().size());
        assertTrue(v.values("anonymous").toList().contains("working1"));
        assertTrue(v.values("anonymous").toList().contains("working2"));
        assertTrue(v.values("anonymous").toList().contains("working3"));
        assertEquals("anything", v.property("try").value());
View Full Code Here

        assertEquals("thing", v.property("any").value());
        assertEquals(3, v.values("anonymous").toList().size());
        assertTrue(v.values("anonymous").toList().contains("working1"));
        assertTrue(v.values("anonymous").toList().contains("working2"));
        assertTrue(v.values("anonymous").toList().contains("working3"));
        assertEquals("anything", v.property("try").value());
    }

    @Test
    @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
    public void shouldOverwritePropertyValuesToVertex() {
View Full Code Here

        ));

        final Vertex v = swg.addVertex("any", "thing");

        assertNotNull(v);
        assertEquals("thing", v.property("any").value());
        assertEquals(1, v.values("anonymous").toList().size());
        assertTrue(v.values("anonymous").toList().contains("working3"));
        assertEquals("anything", v.property("try").value());
    }
View Full Code Here

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.