LUCENE-8835: Irony - our tests don't emulate windows well enough

This commit is contained in:
Simon Willnauer 2019-06-12 17:56:06 +02:00
parent bfb5b41144
commit 608d9134ad
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,7 @@ import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.TestIndexWriterReader; import org.apache.lucene.index.TestIndexWriterReader;
import org.apache.lucene.mockfile.FilterPath; import org.apache.lucene.mockfile.FilterPath;
import org.apache.lucene.mockfile.WindowsFS; import org.apache.lucene.mockfile.WindowsFS;
import org.apache.lucene.util.Constants;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
public class TestFileSwitchDirectory extends BaseDirectoryTestCase { public class TestFileSwitchDirectory extends BaseDirectoryTestCase {
@ -140,6 +141,7 @@ public class TestFileSwitchDirectory extends BaseDirectoryTestCase {
public void testDeleteAndList() throws IOException { public void testDeleteAndList() throws IOException {
// relies on windows semantics // relies on windows semantics
Path path = createTempDir(); Path path = createTempDir();
assumeFalse("Irony we seem to not emulate windows well enough", Constants.WINDOWS);
FileSystem fs = new WindowsFS(path.getFileSystem()).getFileSystem(URI.create("file:///")); FileSystem fs = new WindowsFS(path.getFileSystem()).getFileSystem(URI.create("file:///"));
Path indexPath = new FilterPath(path, fs); Path indexPath = new FilterPath(path, fs);
try (final FileSwitchDirectory dir = new FileSwitchDirectory(Collections.singleton("tim"), try (final FileSwitchDirectory dir = new FileSwitchDirectory(Collections.singleton("tim"),