Repository: lucenenet Updated Branches: refs/heads/master e694ee94f -> 743ec24be
Lucene.Net.Tests.Store.TestDirectory.TestFsyncDoesntCreateNewFiles(): Commented out section that expects exception to be thrown from fsdir.Sync() when a file doesn't exist. Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/4347872d Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/4347872d Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/4347872d Branch: refs/heads/master Commit: 4347872dd155949b38f69baa7cb313d52aad5d27 Parents: e694ee9 Author: Shad Storhaug <[email protected]> Authored: Mon Jul 17 15:05:35 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Mon Jul 17 15:05:35 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Tests/Store/TestDirectory.cs | 40 ++++++++++++++---------- 1 file changed, 23 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4347872d/src/Lucene.Net.Tests/Store/TestDirectory.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests/Store/TestDirectory.cs b/src/Lucene.Net.Tests/Store/TestDirectory.cs index 2d22ae1..ed03fc9 100644 --- a/src/Lucene.Net.Tests/Store/TestDirectory.cs +++ b/src/Lucene.Net.Tests/Store/TestDirectory.cs @@ -403,23 +403,26 @@ namespace Lucene.Net.Store // directory is empty Assert.AreEqual(0, fsdir.ListAll().Length); - // fsync it - try - { - fsdir.Sync(Collections.Singleton("afile")); - Assert.Fail("didn't get expected exception, instead fsync created new files: " + - Arrays.AsList(fsdir.ListAll())); - } - catch (FileNotFoundException) - { - // ok - } - // LUCENENET specific - since NoSuchDirectoryException subclasses FileNotFoundException - // in Lucene, we need to catch it here to be on the safe side. - catch (System.IO.DirectoryNotFoundException) - { - // ok - } + + // LUCENENET specific: Since FSDirectory.Sync() does not actually do anything in .NET + // we decided to remove the exception as well. This is safe to ignore here. + //// fsync it + //try + //{ + // fsdir.Sync(Collections.Singleton("afile")); + // Assert.Fail("didn't get expected exception, instead fsync created new files: " + + // Collections.ToString(fsdir.ListAll())); + //} + //catch (FileNotFoundException) + //{ + // // ok + //} + //// LUCENENET specific - since NoSuchDirectoryException subclasses FileNotFoundException + //// in Lucene, we need to catch it here to be on the safe side. + //catch (System.IO.DirectoryNotFoundException) + //{ + // // ok + //} // directory is still empty Assert.AreEqual(0, fsdir.ListAll().Length); @@ -479,6 +482,8 @@ namespace Lucene.Net.Store } } + +#pragma warning disable 612, 618 [Test] [LuceneNetSpecific] public void TestLUCENENET521() @@ -507,6 +512,7 @@ namespace Lucene.Net.Store System.Threading.Tasks.Task.WaitAll(task); return; } +#pragma warning restore 612, 618 private static void Search(Index.IndexReader r, int times) {
