示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void partitionedReaderCloseAllSearchers() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void PartitionedReaderCloseAllSearchers()
        {
            PartitionedIndexReader partitionedIndexReader = CreatePartitionedReader();

            partitionedIndexReader.Close();

            verify(_partitionSearcher1).close();
            verify(_partitionSearcher2).close();
            verify(_partitionSearcher3).close();
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void countNodesOverPartitions()
        public virtual void CountNodesOverPartitions()
        {
            PartitionedIndexReader indexReader = CreatePartitionedReaderFromReaders();

            when(_indexReader1.countIndexedNodes(1, new int[] { PROP_KEY }, Values.of("a"))).thenReturn(1L);
            when(_indexReader2.countIndexedNodes(1, new int[] { PROP_KEY }, Values.of("a"))).thenReturn(2L);
            when(_indexReader3.countIndexedNodes(1, new int[] { PROP_KEY }, Values.of("a"))).thenReturn(3L);

            assertEquals(6, indexReader.CountIndexedNodes(1, new int[] { PROP_KEY }, Values.of("a")));
        }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void samplingOverPartitions() throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void SamplingOverPartitions()
        {
            PartitionedIndexReader indexReader = CreatePartitionedReaderFromReaders();

            when(_indexReader1.createSampler()).thenReturn(new SimpleSampler(this, 1));
            when(_indexReader2.createSampler()).thenReturn(new SimpleSampler(this, 2));
            when(_indexReader3.createSampler()).thenReturn(new SimpleSampler(this, 3));

            IndexSampler sampler = indexReader.CreateSampler();

            assertEquals(new IndexSample(6, 6, 6), sampler.SampleIndex());
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void scanOverPartitions() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ScanOverPartitions()
        {
            PartitionedIndexReader indexReader = CreatePartitionedReaderFromReaders();

            IndexQuery.ExistsPredicate query = IndexQuery.exists(1);
            when(_indexReader1.query(query)).thenReturn(PrimitiveLongResourceCollections.iterator(null, 1));
            when(_indexReader2.query(query)).thenReturn(PrimitiveLongResourceCollections.iterator(null, 2));
            when(_indexReader3.query(query)).thenReturn(PrimitiveLongResourceCollections.iterator(null, 3));

            LongSet results = PrimitiveLongCollections.asSet(indexReader.Query(query));

            VerifyResult(results);
        }
示例#5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void rangeSeekByPrefixOverPartitions() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void RangeSeekByPrefixOverPartitions()
        {
            PartitionedIndexReader indexReader = CreatePartitionedReaderFromReaders();

            IndexQuery.StringPrefixPredicate query = IndexQuery.stringPrefix(1, stringValue("prefix"));
            when(_indexReader1.query(query)).thenReturn(PrimitiveLongResourceCollections.iterator(null, 1));
            when(_indexReader2.query(query)).thenReturn(PrimitiveLongResourceCollections.iterator(null, 2));
            when(_indexReader3.query(query)).thenReturn(PrimitiveLongResourceCollections.iterator(null, 3));

            LongSet results = PrimitiveLongCollections.asSet(indexReader.Query(query));

            VerifyResult(results);
        }
示例#6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void rangeSeekByStringOverPartitions() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void RangeSeekByStringOverPartitions()
        {
            PartitionedIndexReader indexReader = CreatePartitionedReaderFromReaders();

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.neo4j.internal.kernel.api.IndexQuery.RangePredicate<?> query = org.neo4j.internal.kernel.api.IndexQuery.range(1, "a", false, "b", true);
            IndexQuery.RangePredicate <object> query = IndexQuery.range(1, "a", false, "b", true);
            when(_indexReader1.query(query)).thenReturn(PrimitiveLongResourceCollections.iterator(null, 1));
            when(_indexReader2.query(query)).thenReturn(PrimitiveLongResourceCollections.iterator(null, 2));
            when(_indexReader3.query(query)).thenReturn(PrimitiveLongResourceCollections.iterator(null, 3));

            LongSet results = PrimitiveLongCollections.asSet(indexReader.Query(query));

            VerifyResult(results);
        }