Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCloseIndexAndLabelScanSnapshots() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldCloseIndexAndLabelScanSnapshots()
        {
            // Given
            LabelScanStore        labelScanStore  = mock(typeof(LabelScanStore));
            IndexingService       indexingService = mock(typeof(IndexingService));
            ExplicitIndexProvider explicitIndexes = mock(typeof(ExplicitIndexProvider));

            when(explicitIndexes.AllIndexProviders()).thenReturn(Collections.emptyList());
            DatabaseLayout databaseLayout = mock(typeof(DatabaseLayout));

            when(databaseLayout.MetadataStore()).thenReturn(mock(typeof(File)));
            LogFiles logFiles = mock(typeof(LogFiles));

            FilesInStoreDirAre(databaseLayout, _standardStoreDirFiles, _standardStoreDirDirectories);
            StorageEngine       storageEngine = mock(typeof(StorageEngine));
            NeoStoreFileListing fileListing   = new NeoStoreFileListing(databaseLayout, logFiles, labelScanStore, indexingService, explicitIndexes, storageEngine);

            ResourceIterator <File> scanSnapshot  = ScanStoreFilesAre(labelScanStore, new string[] { "blah/scan.store", "scan.more" });
            ResourceIterator <File> indexSnapshot = IndexFilesAre(indexingService, new string[] { "schema/index/my.index" });

            ResourceIterator <StoreFileMetadata> result = fileListing.Builder().excludeLogFiles().build();

            // When
            result.Close();

            // Then
            verify(scanSnapshot).close();
            verify(indexSnapshot).close();
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void doNotListFilesFromAdditionalProviderThatRegisterTwice() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void DoNotListFilesFromAdditionalProviderThatRegisterTwice()
        {
            NeoStoreFileListing neoStoreFileListing = _neoStoreDataSource.NeoStoreFileListing;
            MarkerFileProvider  provider            = new MarkerFileProvider();

            neoStoreFileListing.RegisterStoreFileProvider(provider);
            neoStoreFileListing.RegisterStoreFileProvider(provider);
            ResourceIterator <StoreFileMetadata> metadataResourceIterator = neoStoreFileListing.Builder().build();

            assertEquals(1, metadataResourceIterator.Where(metadata => "marker".Equals(metadata.file().Name)).Count());
        }
Ejemplo n.º 3
0
 internal StoreFileListingBuilder(NeoStoreFileListing outerInstance)
 {
     this._outerInstance = outerInstance;
 }