예제 #1
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);
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustCombineResultFromExistsPredicate() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MustCombineResultFromExistsPredicate()
        {
            // given
            IndexQuery.ExistsPredicate exists = IndexQuery.exists(PROP_KEY);
            long lastId = 0;

            foreach (IndexReader aliveReader in _aliveReaders)
            {
                when(aliveReader.Query(exists)).thenReturn(PrimitiveLongResourceCollections.iterator(null, lastId++, lastId++));
            }

            // when
            LongIterator result = _fusionIndexReader.query(exists);

            // then

            LongSet resultSet = PrimitiveLongCollections.asSet(result);

            for (long i = 0L; i < lastId; i++)
            {
                assertTrue("Expected to contain " + i + ", but was " + resultSet, resultSet.contains(i));
            }
        }