Package com.tinkerpop.gremlin.structure

Examples of com.tinkerpop.gremlin.structure.Element


        ElementHelper.getLabelValue("test", 321, T.label, "", "testagain", "that");
    }

    @Test
    public void shouldAttachKeyValuesButNotLabelsOrId() {
        final Element mockElement = mock(Element.class);
        ElementHelper.attachProperties(mockElement, "test", 123, T.id, 321, T.label, "friends");
        verify(mockElement, times(1)).property("test", 123);
        verify(mockElement, times(0)).property(T.id.getAccessor(), 321);
        verify(mockElement, times(0)).property(T.label.getAccessor(), "friends");
    }
View Full Code Here


        verify(mockElement, times(0)).property(T.label.getAccessor(), "friends");
    }

    @Test(expected = ClassCastException.class)
    public void shouldFailTryingToAttachNonStringKey() {
        final Element mockElement = mock(Element.class);
        ElementHelper.attachProperties(mockElement, "test", 123, 321, "test");
    }
View Full Code Here

        }
    }

    @Test
    public void shouldFailElementAreEqualTestBecauseSecondArgumentIsNull() {
        final Element mockElement = mock(Element.class);
        try {
            ElementHelper.areEqual(mockElement, null);
            fail("Should throw exception since the second argument is null");
        } catch (IllegalArgumentException iae) {
            assertEquals(Graph.Exceptions.argumentCanNotBeNull("b").getMessage(), iae.getMessage());
View Full Code Here

        }
    }

    @Test
    public void shouldDetermineElementsAreEqualAsTheyAreSameObject() {
        final Element mockElement = mock(Element.class);
        assertTrue(ElementHelper.areEqual(mockElement, mockElement));
    }
View Full Code Here

        assertTrue(ElementHelper.areEqual(mockElement, mockElement));
    }

    @Test
    public void shouldDetermineElementsAreNotEqualAsAIsVertexAndBIsEdge() {
        final Element mockVertex = mock(Vertex.class);
        final Element mockEdge = mock(Edge.class);
        assertFalse(ElementHelper.areEqual(mockVertex, mockEdge));
    }
View Full Code Here

        assertFalse(ElementHelper.areEqual(mockVertex, mockEdge));
    }

    @Test
    public void shouldDetermineElementsAreNotEqualAsBIsVertexAndAIsEdge() {
        final Element mockVertex = mock(Vertex.class);
        final Element mockEdge = mock(Edge.class);
        assertFalse(ElementHelper.areEqual(mockEdge, mockVertex));
    }
View Full Code Here

        assertFalse(ElementHelper.areEqual(mockEdge, mockVertex));
    }

    @Test
    public void shouldDetermineVerticesAreEqual() {
        final Element mockVertexA = mock(Vertex.class);
        final Element mockVertexB = mock(Vertex.class);
        when(mockVertexA.id()).thenReturn("1");
        when(mockVertexB.id()).thenReturn("1");
        assertTrue(ElementHelper.areEqual(mockVertexA, mockVertexB));
    }
View Full Code Here

        assertTrue(ElementHelper.areEqual(mockVertexA, mockVertexB));
    }

    @Test
    public void shouldDetermineVerticesAreNotEqual() {
        final Element mockVertexA = mock(Vertex.class);
        final Element mockVertexB = mock(Vertex.class);
        when(mockVertexA.id()).thenReturn("1");
        when(mockVertexB.id()).thenReturn("2");
        assertFalse(ElementHelper.areEqual(mockVertexA, mockVertexB));
    }
View Full Code Here

        assertFalse(ElementHelper.areEqual(mockVertexA, mockVertexB));
    }

    @Test
    public void shouldDetermineEdgesAreEqual() {
        final Element mockEdgeA = mock(Edge.class);
        final Element mockEdgeB = mock(Edge.class);
        when(mockEdgeA.id()).thenReturn("1");
        when(mockEdgeB.id()).thenReturn("1");
        assertTrue(ElementHelper.areEqual(mockEdgeA, mockEdgeB));
    }
View Full Code Here

        assertTrue(ElementHelper.areEqual(mockEdgeA, mockEdgeB));
    }

    @Test
    public void shouldDetermineEdgesAreNotEqual() {
        final Element mockEdgeA = mock(Edge.class);
        final Element mockEdgeB = mock(Edge.class);
        when(mockEdgeA.id()).thenReturn("1");
        when(mockEdgeB.id()).thenReturn("2");
        assertFalse(ElementHelper.areEqual(mockEdgeA, mockEdgeB));
    }
View Full Code Here

TOP

Related Classes of com.tinkerpop.gremlin.structure.Element

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.