@ParameterizedTest
@ValueSource( ints = {0, 1} )
@DisabledOnOs( OS.WINDOWS )
void creatingSwapperForInternallyLockedFileMustThrow( int noChannelStriping ) throws Exception
{
PageSwapperFactory factory = createSwapperFactory();
factory.open( fileSystem, Configuration.EMPTY );
File file = testDir.file( "file" );
StoreFileChannel channel = fileSystem.create( file );
try ( FileLock fileLock = channel.tryLock() )
{
assertThat( fileLock, is( not( nullValue() ) ) );
assertThrows( FileLockException.class, () -> createSwapper( factory, file, 4, NO_CALLBACK, true, bool( noChannelStriping ) ) );
}
}