public virtual void TestReadNestedCFP()
{
Directory newDir = NewDirectory();
CompoundFileDirectory csw = new CompoundFileDirectory(newDir, "d.cfs", NewIOContext(Random()), true);
CompoundFileDirectory nested = new CompoundFileDirectory(newDir, "b.cfs", NewIOContext(Random()), true);
IndexOutput @out = nested.CreateOutput("b.xyz", NewIOContext(Random()));
IndexOutput out1 = nested.CreateOutput("b_1.xyz", NewIOContext(Random()));
@out.WriteInt(0);
out1.WriteInt(1);
@out.Dispose();
out1.Dispose();
nested.Dispose();
newDir.Copy(csw, "b.cfs", "b.cfs", NewIOContext(Random()));
newDir.Copy(csw, "b.cfe", "b.cfe", NewIOContext(Random()));
newDir.DeleteFile("b.cfs");
newDir.DeleteFile("b.cfe");
csw.Dispose();
Assert.AreEqual(2, newDir.ListAll().Length);
csw = new CompoundFileDirectory(newDir, "d.cfs", NewIOContext(Random()), false);
Assert.AreEqual(2, csw.ListAll().Length);
nested = new CompoundFileDirectory(csw, "b.cfs", NewIOContext(Random()), false);
Assert.AreEqual(2, nested.ListAll().Length);
IndexInput openInput = nested.OpenInput("b.xyz", NewIOContext(Random()));
Assert.AreEqual(0, openInput.ReadInt());
openInput.Dispose();
openInput = nested.OpenInput("b_1.xyz", NewIOContext(Random()));
Assert.AreEqual(1, openInput.ReadInt());
openInput.Dispose();
nested.Dispose();
csw.Dispose();
newDir.Dispose();
}