//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @ParameterizedTest @ValueSource(ints = {7, 11, 14, 20, 35, 58}) void partitionedIndexPopulation(int affectedNodes) throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: internal virtual void PartitionedIndexPopulation(int affectedNodes) { File rootFolder = new File(_testDir.directory("partitionIndex" + affectedNodes), "uniqueIndex" + affectedNodes); using (SchemaIndex uniqueIndex = LuceneSchemaIndexBuilder.create(_descriptor, Config.defaults()).withFileSystem(_fileSystem).withIndexRootFolder(rootFolder).build()) { uniqueIndex.open(); // index is empty and not yet exist assertEquals(0, uniqueIndex.allDocumentsReader().maxCount()); assertFalse(uniqueIndex.exists()); using (LuceneIndexAccessor indexAccessor = new LuceneIndexAccessor(uniqueIndex, _descriptor)) { GenerateUpdates(indexAccessor, affectedNodes); indexAccessor.Force(Org.Neo4j.Io.pagecache.IOLimiter_Fields.Unlimited); // now index is online and should contain updates data assertTrue(uniqueIndex.Online); using (IndexReader indexReader = indexAccessor.NewReader(), IndexSampler indexSampler = indexReader.CreateSampler()) { long[] nodes = PrimitiveLongCollections.asArray(indexReader.Query(IndexQuery.exists(1))); assertEquals(affectedNodes, nodes.Length); IndexSample sample = indexSampler.SampleIndex(); assertEquals(affectedNodes, sample.IndexSize()); assertEquals(affectedNodes, sample.UniqueValues()); assertEquals(affectedNodes, sample.SampleSize()); } } } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void defaultQueryImplementationMustThrowForUnsupportedIndexOrder() internal virtual void DefaultQueryImplementationMustThrowForUnsupportedIndexOrder() { // Given IndexReader indexReader = StubIndexReader(); // Then string expectedMessage = string.Format("This reader only have support for index order {0}. Provided index order was {1}.", IndexOrder.NONE, IndexOrder.ASCENDING); System.NotSupportedException operationException = assertThrows(typeof(System.NotSupportedException), () => indexReader.Query(new SimpleNodeValueClient(), IndexOrder.ASCENDING, false, IndexQuery.exists(1))); assertEquals(expectedMessage, operationException.Message); }