//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReturnTheFullFileAsPreviouslyInactiveWhenActiveContainsCorruptEntry() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldReturnTheFullFileAsPreviouslyInactiveWhenActiveContainsCorruptEntry() { // given EphemeralFileSystemAbstraction fsa = _fileSystemRule.get(); fsa.Mkdir(_testDir.directory()); File fileA = fileA(); StoreChannel channel = fsa.Create(fileA); ByteBuffer buffer = WriteLong(42); channel.WriteAll(buffer); channel.Force(false); buffer.clear(); buffer.putLong(101); // extraneous bytes buffer.flip(); channel.WriteAll(buffer); channel.Force(false); File fileB = fileB(); fsa.Create(fileB); StateRecoveryManager <long> manager = new StateRecoveryManager <long>(fsa, new LongMarshal()); // when //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.causalclustering.core.state.StateRecoveryManager.RecoveryStatus recoveryStatus = manager.recover(fileA, fileB); StateRecoveryManager.RecoveryStatus recoveryStatus = manager.Recover(fileA, fileB); // then assertEquals(fileB, recoveryStatus.activeFile()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReturnPreviouslyInactiveWhenOneFileFullAndOneEmpty() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldReturnPreviouslyInactiveWhenOneFileFullAndOneEmpty() { // given EphemeralFileSystemAbstraction fsa = _fileSystemRule.get(); fsa.Mkdir(_testDir.directory()); File fileA = fileA(); StoreChannel channel = fsa.Create(fileA); FillUpAndForce(channel); File fileB = fileB(); fsa.Create(fileB); StateRecoveryManager <long> manager = new StateRecoveryManager <long>(fsa, new LongMarshal()); // when //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.causalclustering.core.state.StateRecoveryManager.RecoveryStatus recoveryStatus = manager.recover(fileA, fileB); StateRecoveryManager.RecoveryStatus recoveryStatus = manager.Recover(fileA, fileB); // then assertEquals(fileB, recoveryStatus.activeFile()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRecoverFromPartiallyWrittenEntriesInBothFiles() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldRecoverFromPartiallyWrittenEntriesInBothFiles() { // given EphemeralFileSystemAbstraction fsa = _fileSystemRule.get(); fsa.Mkdir(_testDir.directory()); StateRecoveryManager <long> manager = new StateRecoveryManager <long>(fsa, new LongMarshal()); WriteSomeLongsIn(fsa, FileA(), 3, 4); WriteSomeLongsIn(fsa, FileB(), 5, 6); WriteSomeGarbage(fsa, FileA()); WriteSomeGarbage(fsa, FileB()); // when //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.causalclustering.core.state.StateRecoveryManager.RecoveryStatus recovered = manager.recover(fileA(), fileB()); StateRecoveryManager.RecoveryStatus recovered = manager.Recover(FileA(), FileB()); // then assertEquals(FileA(), recovered.activeFile()); assertEquals(6L, recovered.recoveredState()); }