Lucene.Net.TestFramework.Store.MockDirectoryWrapper: added 
DirectoryNotFoundException to the random errors that are thrown


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/cce500f7
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/cce500f7
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/cce500f7

Branch: refs/heads/api-work
Commit: cce500f759ffa9718ede859e9910f5dd8f0e9e6c
Parents: 76efed0
Author: Shad Storhaug <[email protected]>
Authored: Thu Mar 30 20:01:47 2017 +0700
Committer: Shad Storhaug <[email protected]>
Committed: Thu Mar 30 20:01:47 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cce500f7/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs 
b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
index 43e6005..1c6eb46 100644
--- a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
+++ b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
@@ -531,7 +531,7 @@ namespace Lucene.Net.Store
                 }
                 else
                 {
-                    throw RandomState.NextBoolean() ? new 
FileNotFoundException("a randomSystem.IO.IOException (" + name + ")") : new 
FileNotFoundException("a randomSystem.IO.IOException (" + name + ")");
+                    throw RandomState.NextBoolean() ? (IOException)new 
FileNotFoundException("a randomSystem.IO.IOException (" + name + ")") : new 
DirectoryNotFoundException("a randomSystem.IO.IOException (" + name + ")");
                 }
             }
         }
@@ -1318,7 +1318,7 @@ namespace Lucene.Net.Store
             MaybeYield();
             if (!LuceneTestCase.SlowFileExists(m_input, name))
             {
-                throw RandomState.NextBoolean() ? new 
FileNotFoundException(name) : new FileNotFoundException(name);
+                throw RandomState.NextBoolean() ? (IOException)new 
FileNotFoundException(name) : new DirectoryNotFoundException(name);
             }
             // cannot open a file for input if it's still open for
             // output, except for segments.gen and segments_N

Reply via email to