Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void buildContextWithCustomAbsoluteLogFilesLocations() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void BuildContextWithCustomAbsoluteLogFilesLocations()
        {
            File     customLogDirectory      = TestDirectory.directory("absoluteCustomLogDirectory");
            Config   customLogLocationConfig = Config.defaults(logical_logs_location, customLogDirectory.AbsolutePath);
            LogFiles logFiles = builder(TestDirectory.databaseLayout(), _fileSystem).withConfig(customLogLocationConfig).withLogVersionRepository(new SimpleLogVersionRepository()).withTransactionIdStore(new SimpleTransactionIdStore()).build();

            logFiles.Init();
            logFiles.Start();

            assertEquals(customLogDirectory, logFiles.HighestLogFile.ParentFile);
            logFiles.Shutdown();
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void buildContextWithCustomLogFilesLocations() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void BuildContextWithCustomLogFilesLocations()
        {
            string         customLogLocation       = "customLogLocation";
            Config         customLogLocationConfig = Config.defaults(logical_logs_location, customLogLocation);
            DatabaseLayout databaseLayout          = TestDirectory.databaseLayout();
            LogFiles       logFiles = builder(databaseLayout, _fileSystem).withConfig(customLogLocationConfig).withLogVersionRepository(new SimpleLogVersionRepository()).withTransactionIdStore(new SimpleTransactionIdStore()).build();

            logFiles.Init();
            logFiles.Start();

            assertEquals(databaseLayout.File(customLogLocation), logFiles.HighestLogFile.ParentFile);
            logFiles.Shutdown();
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldFindTheVersionBasedOnTheFilename() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldFindTheVersionBasedOnTheFilename()
        {
            // given
            LogFiles logFiles = CreateLogFiles();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.io.File file = new java.io.File("v....2");
            File file = new File("v....2");

            // when
            long logVersion = logFiles.GetLogVersion(file);

            // then
            assertEquals(2, logVersion);
            logFiles.Shutdown();
        }