コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void partitionSearcherIsClosed() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void PartitionSearcherIsClosed()
        {
            PartitionSearcher        partitionSearcher = mock(typeof(PartitionSearcher));
            SimpleUniquenessVerifier verifier          = new SimpleUniquenessVerifier(partitionSearcher);

            verifier.Dispose();

            verify(partitionSearcher).close();
        }
コード例 #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void runUniquenessVerification(org.neo4j.storageengine.api.NodePropertyAccessor nodePropertyAccessor, org.apache.lucene.search.IndexSearcher indexSearcher) throws java.io.IOException, org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        private void RunUniquenessVerification(NodePropertyAccessor nodePropertyAccessor, IndexSearcher indexSearcher)
        {
            try
            {
                PartitionSearcher partitionSearcher = mock(typeof(PartitionSearcher));
                when(partitionSearcher.IndexSearcher).thenReturn(indexSearcher);

                using (UniquenessVerifier verifier = new SimpleUniquenessVerifier(partitionSearcher))
                {
                    verifier.Verify(nodePropertyAccessor, _propertyKeyIds);
                }
            }
            finally
            {
                _searcherManager.release(indexSearcher);
            }
        }