test constructor
DirectoryProperty property1 = new DirectoryProperty("directory");
RawDataBlock[] rawBlocks = new RawDataBlock[ 4 ];
ByteArrayInputStream stream =
new ByteArrayInputStream(new byte[ 2048 ]);
for (int j = 0; j < 4; j++)
{
rawBlocks[ j ] = new RawDataBlock(stream);
}
POIFSDocument document = new POIFSDocument("document", rawBlocks,
2000);
DocumentProperty property2 = document.getDocumentProperty();
DirectoryNode parent = new DirectoryNode(property1, null, null);
DocumentNode node = new DocumentNode(property2, parent);
// verify we can retrieve the document
assertEquals(property2.getDocument(), node.getDocument());
// verify we can get the size
assertEquals(property2.getSize(), node.getSize());
// verify isDocumentEntry returns true
assertTrue(node.isDocumentEntry());
// verify isDirectoryEntry returns false
assertTrue(!node.isDirectoryEntry());
// verify getName behaves correctly
assertEquals(property2.getName(), node.getName());
// verify getParent behaves correctly
assertEquals(parent, node.getParent());