Package org.neo4j.batchimport.index

Examples of org.neo4j.batchimport.index.LongIterableIndexHits


        verify(index, times(1)).add(eq(0L), eq(map("a", "foo")));
    }

    @Test
    public void testImportRelWithIndexLookup() throws Exception {
        when(index.get("a","foo")).thenReturn(new LongIterableIndexHits(asList(42L)));
        importer.importRelationships(new StringReader("a:string:index-a\tb\tTYPE\nfoo\t123\tFOOBAR"));
        importer.finish();
        verify(index, times(1)).get(eq("a"), eq("foo"));
        verify(inserter, times(1)).createRelationship(eq(42L), eq(123L), Matchers.any(RelationshipType.class),eq(map()));
    }
View Full Code Here


        verify(inserter, times(1)).createRelationship(eq(42L), eq(123L), Matchers.any(RelationshipType.class),eq(map()));
    }

    @Test
    public void testImportRelationshipsWithNonIndexedNodes() throws Exception {
        when(index.get("node","a")).thenReturn(new LongIterableIndexHits(asList(1L)));
        when(index.get("node","b")).thenReturn(new LongIterableIndexHits(Arrays.<Long>asList()));
        importer.importRelationships(new StringReader("node:string:index-a\tnode:string:index-a\ttype\na\ta\tTYPE\na\tb\tTYPE\nb\ta\tTYPE"));
        importer.finish();
        verify(inserter, times(1)).createRelationship(eq(1L), eq(1L), argThat(new RelationshipMatcher("TYPE")),eq(map()));
        verify(inserter, never()).createRelationship(eq(1L), eq(-1L), argThat(new RelationshipMatcher("TYPE")),eq(map()));
        verify(inserter, never()).createRelationship(eq(-1L), eq(1L), argThat(new RelationshipMatcher("TYPE")),eq(map()));
View Full Code Here

TOP

Related Classes of org.neo4j.batchimport.index.LongIterableIndexHits

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.