Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ParameterizedTest @ValueSource(ints = {0, 1}) @DisabledOnOs(org.junit.jupiter.api.condition.OS.WINDOWS) void creatingSwapperForInternallyLockedFileMustThrow(int noChannelStriping) throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void CreatingSwapperForInternallyLockedFileMustThrow(int noChannelStriping)
        {
            PageSwapperFactory factory = CreateSwapperFactory();

            factory.Open(_fileSystem, Configuration.EMPTY);
            File file = TestDir.file("file");

            StoreFileChannel channel = _fileSystem.create(file);

            using (FileLock fileLock = channel.TryLock())
            {
                assertThat(fileLock, @is(not(nullValue())));
                assertThrows(typeof(FileLockException), () => CreateSwapper(factory, file, 4, NoCallback, true, Bool(noChannelStriping)));
            }
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ParameterizedTest @ValueSource(ints = {0, 1}) @DisabledOnOs(org.junit.jupiter.api.condition.OS.WINDOWS) void mustUnlockFileWhenThePageSwapperIsClosed(int noChannelStriping) throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void MustUnlockFileWhenThePageSwapperIsClosed(int noChannelStriping)
        {
            PageSwapperFactory factory = CreateSwapperFactory();

            factory.Open(_fileSystem, Configuration.EMPTY);
            File file = TestDir.file("file");

            _fileSystem.create(file).close();

            CreateSwapper(factory, file, 4, NoCallback, false, false).close();

            using (StoreFileChannel channel = _fileSystem.open(file, OpenMode.READ_WRITE), FileLock fileLock = channel.TryLock())
            {
                assertThat(fileLock, @is(not(nullValue())));
            }
        }