//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void latestLogFileContainingACheckPointAndAStartBefore() public virtual void LatestLogFileContainingACheckPointAndAStartBefore() { // given SetupLogFiles(LogFile(Start(), CheckPoint())); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, false, NO_TRANSACTION_ID, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void bigFileLatestCheckpointFindsStartAfter() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void BigFileLatestCheckpointFindsStartAfter() { long firstTxAfterCheckpoint = int.MaxValue + 4L; LogTailScanner tailScanner = new FirstTxIdConfigurableTailScanner(firstTxAfterCheckpoint, _logFiles, _reader, _monitors); LogEntryStart startEntry = new LogEntryStart(1, 2, 3L, 4L, new sbyte[] { 5, 6 }, new LogPosition(_endLogVersion, int.MaxValue + 17L)); CheckPoint checkPoint = new CheckPoint(new LogPosition(_endLogVersion, 16L)); LogTailInformation logTailInformation = tailScanner.CheckpointTailInformation(_endLogVersion, startEntry, _endLogVersion, _latestLogEntryVersion, checkPoint, false); AssertLatestCheckPoint(true, true, firstTxAfterCheckpoint, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void latestLogFileContainingMultipleCheckPointsOneStartInBetween() public virtual void LatestLogFileContainingMultipleCheckPointsOneStartInBetween() { // given SetupLogFiles(LogFile(CheckPoint(), Start(), CheckPoint())); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, false, NO_TRANSACTION_ID, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void twoLogFilesNoCheckPointsOneStartWithoutCommit() public virtual void TwoLogFilesNoCheckPointsOneStartWithoutCommit() { // given SetupLogFiles(LogFile(), LogFile(Start())); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(false, true, NO_TRANSACTION_ID, _startLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void oneLogFileNoCheckPoints() public virtual void OneLogFileNoCheckPoints() { // given SetupLogFiles(LogFile()); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(false, true, NO_TRANSACTION_ID, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void noLogFilesFound() public virtual void NoLogFilesFound() { // given no files SetupLogFiles(); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(false, false, NO_TRANSACTION_ID, -1, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void latestLogEmptyStartEntryBeforeAndAfterCheckPointInTheLastButOneLog() public virtual void LatestLogEmptyStartEntryBeforeAndAfterCheckPointInTheLastButOneLog() { // given long txId = 432; SetupLogFiles(LogFile(Start(), CheckPoint(), Start(), Commit(txId)), LogFile()); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, true, txId, _startLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void twoLogFilesStartAndCommitInDifferentFiles() public virtual void TwoLogFilesStartAndCommitInDifferentFiles() { // given long txId = 6; SetupLogFiles(LogFile(Start()), LogFile(Commit(txId))); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(false, true, 6, _startLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void twoLogFilesNoCheckPointsTwoCommits() public virtual void TwoLogFilesNoCheckPointsTwoCommits() { // given long txId = 21; SetupLogFiles(LogFile(), LogFile(Start(), Commit(txId), Start(), Commit(txId + 1))); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(false, true, txId, _startLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void oneLogFileNoCheckPointsOneStart() public virtual void OneLogFileNoCheckPointsOneStart() { // given long txId = 10; SetupLogFiles(LogFile(Start(), Commit(txId))); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(false, true, txId, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void olderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToALaterPositionThanStart() public virtual void OlderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToALaterPositionThanStart() { // given PositionEntry position = position(); SetupLogFiles(LogFile(Start(), Commit(3), position), LogFile(CheckPoint(position))); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, false, NO_TRANSACTION_ID, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void olderLogFileContainingACheckPointAndNewerFileIsEmpty() public virtual void OlderLogFileContainingACheckPointAndNewerFileIsEmpty() { // given StartEntry start = start(); SetupLogFiles(LogFile(start, CheckPoint()), LogFile()); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, true, NO_TRANSACTION_ID, _startLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void olderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToAPreviousPositionThanStartWithoutCommit() public virtual void OlderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToAPreviousPositionThanStartWithoutCommit() { // given StartEntry start = start(); SetupLogFiles(LogFile(start), LogFile(CheckPoint(start))); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, false, NO_TRANSACTION_ID, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void latestLogFileContainingMultipleCheckPointsOneStartAfterBoth() public virtual void LatestLogFileContainingMultipleCheckPointsOneStartAfterBoth() { // given long txId = 11; SetupLogFiles(LogFile(CheckPoint(), CheckPoint(), Start(), Commit(txId))); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, true, txId, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void latestLogFileContainingACheckPointAndAStartWithoutCommitAfter() public virtual void LatestLogFileContainingACheckPointAndAStartWithoutCommitAfter() { // given StartEntry start = start(); SetupLogFiles(LogFile(start, CheckPoint(start))); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, true, NO_TRANSACTION_ID, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void twoLogFilesSecondIsCorruptedBeforeCommit() throws java.io.IOException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void TwoLogFilesSecondIsCorruptedBeforeCommit() { SetupLogFiles(LogFile(CheckPoint()), LogFile(Start(), Commit(2))); File highestLogFile = _logFiles.HighestLogFile; _fsRule.truncate(highestLogFile, _fsRule.getFileSize(highestLogFile) - 3); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, true, NO_TRANSACTION_ID, _startLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void olderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToAPreviousPositionThanStart() public virtual void OlderLogFileContainingAStartAndNewerFileContainingACheckPointPointingToAPreviousPositionThanStart() { // given long txId = 123; StartEntry start = start(); SetupLogFiles(LogFile(start, Commit(txId)), LogFile(CheckPoint(start))); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, true, txId, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void twoLogFilesCheckPointTargetsPrevious() public virtual void TwoLogFilesCheckPointTargetsPrevious() { // given long txId = 6; PositionEntry position = position(); SetupLogFiles(LogFile(Start(), Commit(txId - 1), position), LogFile(Start(), Commit(txId)), LogFile(CheckPoint(position))); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, true, txId, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void latestLogFileContainingACheckPointAndAStartAfter() public virtual void LatestLogFileContainingACheckPointAndAStartAfter() { // given long txId = 35; StartEntry start = start(); SetupLogFiles(LogFile(start, Commit(txId), CheckPoint(start))); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, true, txId, _endLogVersion, logTailInformation); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void twoLogFilesSecondIsCorruptedBeforeAfterCommit() throws java.io.IOException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void TwoLogFilesSecondIsCorruptedBeforeAfterCommit() { int firstTxId = 2; SetupLogFiles(LogFile(CheckPoint()), LogFile(Start(), Commit(firstTxId), Start(), Commit(3))); File highestLogFile = _logFiles.HighestLogFile; _fsRule.truncate(highestLogFile, _fsRule.getFileSize(highestLogFile) - 3); // when LogTailInformation logTailInformation = _tailScanner.TailInformation; // then AssertLatestCheckPoint(true, true, firstTxId, _startLogVersion, logTailInformation); }
private void AssertLatestCheckPoint(bool hasCheckPointEntry, bool commitsAfterLastCheckPoint, long firstTxIdAfterLastCheckPoint, long logVersion, LogTailInformation logTailInformation) { assertEquals(hasCheckPointEntry, logTailInformation.LastCheckPoint != null); assertEquals(commitsAfterLastCheckPoint, logTailInformation.CommitsAfterLastCheckpoint()); if (commitsAfterLastCheckPoint) { assertEquals(firstTxIdAfterLastCheckPoint, logTailInformation.FirstTxIdAfterLastCheckPoint); } assertEquals(logVersion, logTailInformation.OldestLogVersionFound); }