You're closing the reader in SpatialTestCase.TearDown(), while
SpecialTestCase.commit() only checks if it is null, not closed. Setting
indexReader = null in TearDown() solves the AlreadyClosedException.
There's another issue with cultures, SpatialContext.ReadStandardShape
calls Double.Parse which is culture-sensitive. I'm running with
CurrentCulture = sv-SE, something that can be overcome with
[SetCulture("en-US")] on your tests.
BaseRecursivePrefixTreeStrategyTestCase.minifiedTest : Failed
System.FormatException : Input string was not in a correct format.
at System.Number.ParseDouble(String value, NumberStyles options,
NumberFormatInfo numfmt)
at System.Double.Parse(String s)
at Spatial4n.Core.Context.SpatialContext.ReadStandardShape(String str)
in SpatialContext.cs: line 372
at Spatial4n.Core.Context.SpatialContext.ReadShape(String value) in
SpatialContext.cs: line 160
at
Lucene.Net.Contrib.Spatial.Test.Prefix.BaseRecursivePrefixTreeStrategyTestCase.minifiedTest()
in BaseRecursivePrefixTreeStrategyTestCase.cs: line 74
// Simon
On 2012-05-30 12:22, Itamar Syn-Hershko wrote:
I was finally able to get git and svn talk to one another, and pushed my
recent changes into trunk.
The new Spatial contrib is bearing the non-standard version of 2.9.9, on
purpose. It also contains Spatial4n in a binary form, mimicking the way it
works in Java Lucene.
The few tests that present pass, but when run in a chain I get the
following failure - hadn't had time to run it down:
Test
'Lucene.Net.Contrib.Spatial.Test.Prefix.TestRecursivePrefixTreeStrategy.BaseRecursivePrefixTreeStrategyTestCase.testFilterWithVariableScanLevel'
failed:
Lucene.Net.Store.AlreadyClosedException : this IndexReader is closed
Index\IndexReader.cs(204,0): at Lucene.Net.Index.IndexReader.EnsureOpen()
Index\DirectoryReader.cs(497,0): at
Lucene.Net.Index.DirectoryReader.DoReopen(Boolean openReadOnly, IndexCommit
commit)
Index\DirectoryReader.cs(462,0): at
Lucene.Net.Index.DirectoryReader.Reopen()
SpatialTestCase.cs(111,0): at
Lucene.Net.Contrib.Spatial.Test.SpatialTestCase.commit()
SpatialTestCase.cs(94,0): at
Lucene.Net.Contrib.Spatial.Test.SpatialTestCase.addDocumentsAndCommit(List`1
documents)
StrategyTestCase.cs(67,0): at
Lucene.Net.Contrib.Spatial.Test.StrategyTestCase`1.getAddAndVerifyIndexedDocuments(String
testDataFile)
Prefix\BaseRecursivePrefixTreeStrategyTestCase.cs(53,0): at
Lucene.Net.Contrib.Spatial.Test.Prefix.BaseRecursivePrefixTreeStrategyTestCase.testFilterWithVariableScanLevel()
Ideas welcome.