Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void mustDeleteLogFilesThatCanBePruned()
        public virtual void MustDeleteLogFilesThatCanBePruned()
        {
            when(_factory.strategyFromConfigValue(eq(_fs), eq(_logFiles), eq(_clock), anyString())).thenReturn(upTo => LongStream.range(3, upTo));
            LogPruning pruning = new LogPruningImpl(_fs, _logFiles, _logProvider, _factory, _clock, _config);

            pruning.PruneLogs(5);
            InOrder order = inOrder(_fs);

            order.verify(_fs).deleteFile(new File("3"));
            order.verify(_fs).deleteFile(new File("4"));
            // Log file 5 is not deleted; it's the lowest version expected to remain after pruning.
            verifyNoMoreInteractions(_fs);
        }
Пример #2
0
 private void UpdateConfiguration(string pruningConf)
 {
     this._pruneStrategy = _strategyFactory.strategyFromConfigValue(_fs, _logFiles, _clock, pruningConf);
     _msgLog.info("Retention policy updated, value will take effect during the next evaluation.");
 }