lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r881392 - in /incubator/lucene.net/trunk/C#/src: Lucene.Net/Index/IndexWriter.cs Lucene.Net/SupportClass.cs Test/Index/TestIndexWriter.cs
Date Tue, 17 Nov 2009 17:33:11 GMT
Author: digy
Date: Tue Nov 17 17:33:07 2009
New Revision: 881392

URL: http://svn.apache.org/viewvc?rev=881392&view=rev
Log:
LUCENENET-255 TestIndexWriter's failing tests

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexWriter.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/IndexWriter.cs?rev=881392&r1=881391&r2=881392&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexWriter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexWriter.cs Tue Nov 17 17:33:07
2009
@@ -4611,7 +4611,7 @@
 		// This is called after pending added and deleted
 		// documents have been flushed to the Directory but before
 		// the change is committed (new segments_N file written).
-		internal virtual void  DoAfterFlush()
+		protected  virtual void  DoAfterFlush()
 		{
 		}
 		

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/SupportClass.cs?rev=881392&r1=881391&r2=881392&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs Tue Nov 17 17:33:07 2009
@@ -292,10 +292,7 @@
         /// </summary>
         public void Join()
         {
-            lock (this)
-            {
-                threadField.Join();
-            }
+            threadField.Join();
         }
 
         /// <summary>
@@ -304,10 +301,7 @@
         /// <param name="MiliSeconds">Time of wait in milliseconds</param>
         public void Join(long MiliSeconds)
         {
-            lock (this)
-            {
-                threadField.Join(new System.TimeSpan(MiliSeconds * 10000));
-            }
+            threadField.Join(new System.TimeSpan(MiliSeconds * 10000));
         }
 
         /// <summary>
@@ -317,10 +311,7 @@
         /// <param name="NanoSeconds">Time of wait in nanoseconds</param>
         public void Join(long MiliSeconds, int NanoSeconds)
         {
-            lock (this)
-            {
-                threadField.Join(new System.TimeSpan(MiliSeconds * 10000 + NanoSeconds *
100));
-            }
+            threadField.Join(new System.TimeSpan(MiliSeconds * 10000 + NanoSeconds * 100));
         }
 
         /// <summary>
@@ -350,10 +341,7 @@
         /// <param name="stateInfo">An object that contains application-specific information,
such as state, which can be used by the thread being aborted</param>
         public void Abort(object stateInfo)
         {
-            lock (this)
-            {
-                threadField.Abort(stateInfo);
-            }
+            threadField.Abort(stateInfo);
         }
 
         /// <summary>

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestIndexWriter.cs?rev=881392&r1=881391&r2=881392&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs Tue Nov 17 17:33:07 2009
@@ -127,7 +127,7 @@
 				}
 				private int count = 0;
 				
-				public virtual bool IncrementToken()
+				public override bool IncrementToken()
 				{
 					if (count++ == 5)
 					{
@@ -408,7 +408,7 @@
 				}
 				
 			}
-			public virtual void  Message(System.String message)
+			public override void  Message(System.String message)
 			{
 				if (message.StartsWith("now flush at close") && 0 == thrown.Count)
 				{
@@ -2477,7 +2477,7 @@
 				this.doFail = false;
 			}
 			
-			public virtual void  Eval(MockRAMDirectory dir)
+			public override void  Eval(MockRAMDirectory dir)
 			{
 				if (doFail)
 				{
@@ -2487,9 +2487,10 @@
 					for (int i = 0; i < trace.FrameCount; i++)
 					{
 						System.Diagnostics.StackFrame sf = trace.GetFrame(i);
-						if ("Lucene.Net.Index.FreqProxTermsWriter".Equals(sf.GetType()) && "AppendPostings".Equals(sf.GetMethod()))
+                        string className = sf.GetMethod().DeclaringType.Namespace + "." +
sf.GetMethod().DeclaringType.Name;
+                        if ("Lucene.Net.Index.FreqProxTermsWriter".Equals(className) &&
"AppendPostings".Equals(sf.GetMethod().Name))
 							sawAppend = true;
-						if ("DoFlush".Equals(sf.GetMethod()))
+						if ("DoFlush".Equals(sf.GetMethod().Name))
 							sawFlush = true;
 					}
 					
@@ -3123,7 +3124,7 @@
 			{
 				this.onlyOnce = onlyOnce;
 			}
-			public virtual void  Eval(MockRAMDirectory dir)
+			public override void  Eval(MockRAMDirectory dir)
 			{
 				if (doFail)
 				{
@@ -3131,7 +3132,7 @@
 					for (int i = 0; i < trace.FrameCount; i++)
 					{
 						System.Diagnostics.StackFrame sf = trace.GetFrame(i);
-						if ("Abort".Equals(sf.GetMethod()) || "FlushDocument".Equals(sf.GetMethod()))
+						if ("Abort".Equals(sf.GetMethod().Name) || "FlushDocument".Equals(sf.GetMethod().Name))
 						{
 							if (onlyOnce)
 								doFail = false;
@@ -3281,7 +3282,7 @@
 			{
 				this.onlyOnce = onlyOnce;
 			}
-			public virtual void  Eval(MockRAMDirectory dir)
+			public override void  Eval(MockRAMDirectory dir)
 			{
 				if (doFail)
 				{
@@ -3289,7 +3290,7 @@
 					for (int i = 0; i < trace.FrameCount; i++)
 					{
 						System.Diagnostics.StackFrame sf = trace.GetFrame(i);
-						if ("closeDocStore".Equals(sf.GetMethod()))
+						if ("CloseDocStore".Equals(sf.GetMethod().Name))
 						{
 							if (onlyOnce)
 								doFail = false;
@@ -3336,7 +3337,7 @@
 			{
 				this.onlyOnce = onlyOnce;
 			}
-			public virtual void  Eval(MockRAMDirectory dir)
+			public override void  Eval(MockRAMDirectory dir)
 			{
 				if (doFail)
 				{
@@ -3344,7 +3345,8 @@
 					for (int i = 0; i < trace.FrameCount; i++)
 					{
 						System.Diagnostics.StackFrame sf = trace.GetFrame(i);
-						if ("Flush".Equals(sf.GetMethod()) && "Lucene.Net.Index.DocFieldProcessor".Equals(sf.GetType()))
+                        string className = sf.GetMethod().DeclaringType.Namespace + "." +
sf.GetMethod().DeclaringType.Name;
+						if ("Flush".Equals(sf.GetMethod().Name) && "Lucene.Net.Index.DocFieldProcessor".Equals(className))
 						{
 							if (onlyOnce)
 								doFail = false;
@@ -3492,7 +3494,7 @@
 		private class FailOnlyInSync:MockRAMDirectory.Failure
 		{
 			internal bool didFail;
-			public virtual void  Eval(MockRAMDirectory dir)
+			public override void  Eval(MockRAMDirectory dir)
 			{
 				if (doFail)
 				{
@@ -3500,7 +3502,8 @@
 					for (int i = 0; i < trace.FrameCount; i++)
 					{
 						System.Diagnostics.StackFrame sf = trace.GetFrame(i);
-						if (doFail && "Lucene.Net.Store.MockRAMDirectory".Equals(sf.GetType()) &&
"Sync".Equals(sf.GetMethod()))
+                        string className = sf.GetMethod().DeclaringType.Namespace + "." +
sf.GetMethod().DeclaringType.Name;
+						if (doFail && "Lucene.Net.Store.MockRAMDirectory".Equals(className) &&
"Sync".Equals(sf.GetMethod().Name))
 						{
 							didFail = true;
 							throw new System.IO.IOException("now failing on purpose during sync");
@@ -3860,7 +3863,7 @@
 			
 			internal bool doFail;
 			
-			internal virtual bool TestPoint(System.String name)
+			public override bool TestPoint(System.String name)
 			{
 				if (doFail && name.Equals("DocumentsWriter.ThreadState.init start"))
 					throw new System.SystemException("intentionally failing");
@@ -3944,7 +3947,7 @@
 			internal bool doFail;
 			internal bool failed;
 			
-			internal virtual bool TestPoint(System.String name)
+			public override bool TestPoint(System.String name)
 			{
 				if (doFail && name.Equals("startMergeInit"))
 				{
@@ -4006,7 +4009,7 @@
 			
 			internal bool wasCalled;
 			
-			public virtual void  DoAfterFlush()
+			protected override void  DoAfterFlush()
 			{
 				wasCalled = true;
 			}
@@ -4042,7 +4045,7 @@
 			
 			internal bool fail1, fail2;
 			
-			public virtual void  Eval(MockRAMDirectory dir)
+			public override void  Eval(MockRAMDirectory dir)
 			{
 				System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace();
 				bool isCommit = false;
@@ -4050,9 +4053,10 @@
 				for (int i = 0; i < trace.FrameCount; i++)
 				{
 					System.Diagnostics.StackFrame sf = trace.GetFrame(i);
-					if ("Lucene.Net.Index.SegmentInfos".Equals(sf.GetType()) && "PrepareCommit".Equals(sf.GetMethod()))
+                    string className = sf.GetMethod().DeclaringType.Namespace + "." + sf.GetMethod().DeclaringType.Name;
+					if ("Lucene.Net.Index.SegmentInfos".Equals(className) && "PrepareCommit".Equals(sf.GetMethod().Name))
 						isCommit = true;
-					if ("Lucene.Net.Store.MockRAMDirectory".Equals(sf.GetType()) && "DeleteFile".Equals(sf.GetMethod()))
+					if ("Lucene.Net.Store.MockRAMDirectory".Equals(className) && "DeleteFile".Equals(sf.GetMethod().Name))
 						isDelete = true;
 				}
 				
@@ -4890,7 +4894,7 @@
 			
 			internal bool doFail;
 			
-			internal virtual bool TestPoint(System.String name)
+			public override bool TestPoint(System.String name)
 			{
 				if (doFail && name.Equals("rollback before checkpoint"))
 					throw new System.SystemException("intentionally failing");



Mime
View raw message