public virtual void TestDetectClose()
{
Directory dir = new RAMDirectory();
dir.Close();
try
{
dir.CreateOutput("test");
Assert.Fail("did not hit expected exception");
}
catch (AlreadyClosedException ace)
{
}
dir = FSDirectory.Open(new System.IO.FileInfo(SupportClass.AppSettings.Get("tempDir", System.IO.Path.GetTempPath())));
dir.Close();
try
{
dir.CreateOutput("test");
Assert.Fail("did not hit expected exception");
}
catch (AlreadyClosedException ace)
{
}
}