You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ar...@apache.org on 2008/07/30 00:08:11 UTC

svn commit: r680858 - /incubator/lucene.net/trunk/C#/src/Test/Index/TestConcurrentMergeScheduler.cs

Author: aroush
Date: Tue Jul 29 15:08:11 2008
New Revision: 680858

URL: http://svn.apache.org/viewvc?rev=680858&view=rev
Log:
LUCENENET-126 "Nunit test: Index/TestConcurrentMergeScheduler/TestFlushExceptions"

Modified:
    incubator/lucene.net/trunk/C#/src/Test/Index/TestConcurrentMergeScheduler.cs

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestConcurrentMergeScheduler.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestConcurrentMergeScheduler.cs?rev=680858&r1=680857&r2=680858&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestConcurrentMergeScheduler.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestConcurrentMergeScheduler.cs Tue Jul 29 15:08:11 2008
@@ -53,19 +53,12 @@
 			{
 				if (doFail)
 				{
-					// {{DOUG-2.3.1}} this code is suspect.  i have preserved the original (below) for 
-					// comparative purposes.
-					if (new System.Exception().StackTrace.Contains("doFlush"))
-						throw new System.IO.IOException("now failing during flush");
-					//StackTraceElement[] trace = new System.Exception().getStackTrace();
-					//for (int i = 0; i < trace.Length; i++)
-					//{
-					//    if ("doFlush".Equals(trace[i].getMethodName()))
-					//    {
-					//        //new RuntimeException().printStackTrace(System.out);
-					//        throw new System.IO.IOException("now failing during flush");
-					//    }
-					//}
+					System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace();
+					foreach (System.Diagnostics.StackFrame f in st.GetFrames())
+					{
+						if ("DoFlush" == f.GetMethod().Name)
+							throw new System.IO.IOException("now failing during flush");
+					}
 				}
 			}
 		}