lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r681533 - /incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterDelete.cs
Date Thu, 31 Jul 2008 22:54:59 GMT
Author: aroush
Date: Thu Jul 31 15:54:59 2008
New Revision: 681533

URL: http://svn.apache.org/viewvc?rev=681533&view=rev
Log:
LUCENENET-134 "broken test cases in unit test class TestIndexWriterDelete.cs"

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

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterDelete.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestIndexWriterDelete.cs?rev=681533&r1=681532&r2=681533&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterDelete.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriterDelete.cs Thu Jul 31 15:54:59
2008
@@ -69,18 +69,16 @@
 				if (sawMaybe && !failed)
 				{
 					bool seen = false;
-					// {{DOUG-2.3.1}} this code is suspect.  i have preserved the original (below) for 
-					// comparative purposes.
-					seen = new System.Exception().StackTrace.Contains("applyDeletes");
-					//StackTraceElement[] trace = new System.Exception().getStackTrace();
-					//for (int i = 0; i < trace.Length; i++)
-					//{
-					//    if ("applyDeletes".Equals(trace[i].getMethodName()))
-					//    {
-					//        seen = true;
-					//        break;
-					//    }
-					//}
+					System.Diagnostics.StackFrame[] frames = new System.Diagnostics.StackTrace().GetFrames();
+					for (int i = 0; i < frames.Length; i++)
+					{
+						System.String methodName = frames[i].GetMethod().Name;
+						if ("ApplyDeletes".Equals(methodName))
+						{
+							seen = true;
+							break;
+						}
+					}
 					if (!seen)
 					{
 						// Only fail once we are no longer in applyDeletes
@@ -90,18 +88,16 @@
 				}
 				if (!failed)
 				{
-					// {{DOUG-2.3.1}} this code is suspect.  i have preserved the original (below) for 
-					// comparative purposes.
-					sawMaybe = new System.Exception().StackTrace.Contains("applyDeletes");
-					//StackTraceElement[] trace = new System.Exception().getStackTrace();
-					//for (int i = 0; i < trace.Length; i++)
-					//{
-					//    if ("applyDeletes".Equals(trace[i].getMethodName()))
-					//    {
-					//        sawMaybe = true;
-					//        break;
-					//    }
-					//}
+					System.Diagnostics.StackFrame[] frames = new System.Diagnostics.StackTrace().GetFrames();
+					for (int i = 0; i < frames.Length; i++)
+					{
+						System.String methodName = frames[i].GetMethod().Name;
+						if ("ApplyDeletes".Equals(methodName))
+						{
+							sawMaybe = true;
+							break;
+						}
+					}
 				}
 			}
 		}
@@ -621,7 +617,7 @@
 						// System.out.println(" startFiles: " + i + ": " + startFiles[i]);
 						// }
 						
-						if (!startFiles.Equals(endFiles))
+						if (!SupportClass.Compare.CompareStringArrays(startFiles, endFiles))
 						{
 							System.String successStr;
 							if (success)
@@ -880,7 +876,7 @@
 				new IndexFileDeleter(dir, new KeepOnlyLastCommitDeletionPolicy(), infos, null, null);
 				System.String[] endFiles = dir.List();
 				
-				if (!startFiles.Equals(endFiles))
+				if (!SupportClass.Compare.CompareStringArrays(startFiles, endFiles))
 				{
 					Assert.Fail("docswriter abort() failed to delete unreferenced files:\n  before delete:\n
   " + ArrayToString(startFiles) + "\n  after delete:\n    " + ArrayToString(endFiles));
 				}



Mime
View raw message