Exemplo n.º 1
0
 public PartitionedIndexStorage(DirectoryFactory directoryFactory, FileSystemAbstraction fileSystem, File rootFolder)
 {
     this._fileSystem       = fileSystem;
     this._folderLayout     = new IndexFolderLayout(rootFolder);
     this._directoryFactory = directoryFactory;
     this._failureStorage   = new FailureStorage(fileSystem, _folderLayout);
 }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldReserveFailureFile() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldReserveFailureFile()
        {
            // GIVEN
            FailureStorage storage = new FailureStorage(_fs, _indexFolderLayout);

            // WHEN
            storage.ReserveForIndex();

            // THEN
            File failureFile = storage.FailureFile();

            assertTrue(_fs.fileExists(failureFile));
            assertTrue(_fs.getFileSize(failureFile) > 100);
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldStoreFailure() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldStoreFailure()
        {
            // GIVEN
            FailureStorage storage = new FailureStorage(_fs, _indexFolderLayout);

            storage.ReserveForIndex();
            string failure = format("A failure message%nspanning%nmultiple lines.");

            // WHEN
            storage.StoreIndexFailure(failure);

            // THEN
            File failureFile = storage.FailureFile();

            assertTrue(_fs.fileExists(failureFile));
            assertTrue(_fs.getFileSize(failureFile) > 100);
            assertEquals(failure, storage.LoadIndexFailure());
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldAppendFailureIfAlreadyExists() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldAppendFailureIfAlreadyExists()
        {
            // GIVEN
            FailureStorage storage = new FailureStorage(_fs, _indexFolderLayout);

            storage.ReserveForIndex();
            string failure1 = "Once upon a time there was a first failure";
            string failure2 = "Then there was another";

            storage.StoreIndexFailure(failure1);

            // WHEN
            storage.StoreIndexFailure(failure2);

            // THEN
            string allFailures = storage.LoadIndexFailure();

            assertThat(allFailures, containsString(failure1));
            assertThat(allFailures, containsString(failure2));
        }