use of org.apache.poi.hpsf.SummaryInformation in project poi by apache.
the class TestHPSFBugs method test56138.
/**
* CodePage Strings can be zero length
*/
@Test
public void test56138() throws IOException, NoPropertySetStreamException {
InputStream is = _samples.openResourceAsStream("TestZeroLengthCodePage.mpp");
NPOIFSFileSystem fs = new NPOIFSFileSystem(is);
is.close();
SummaryInformation si = (SummaryInformation) PropertySetFactory.create(fs.getRoot(), SummaryInformation.DEFAULT_STREAM_NAME);
DocumentSummaryInformation dsi = (DocumentSummaryInformation) PropertySetFactory.create(fs.getRoot(), DocumentSummaryInformation.DEFAULT_STREAM_NAME);
// Test
assertEquals("MSProject", si.getApplicationName());
assertEquals("project1", si.getTitle());
assertEquals("Jon Iles", si.getAuthor());
assertEquals("", dsi.getCompany());
assertEquals(2, dsi.getSectionCount());
fs.close();
}
use of org.apache.poi.hpsf.SummaryInformation in project poi by apache.
the class TestBasic method bug52117LastPrinted.
@Test
public void bug52117LastPrinted() throws IOException, HPSFException {
File f = samples.getFile("TestBug52117.doc");
POIFile poiFile = Util.readPOIFiles(f, new String[] { POI_FILES[0] }).get(0);
InputStream in = new ByteArrayInputStream(poiFile.getBytes());
SummaryInformation si = (SummaryInformation) PropertySetFactory.create(in);
Date lastPrinted = si.getLastPrinted();
long editTime = si.getEditTime();
assertTrue(Filetime.isUndefined(lastPrinted));
assertEquals(1800000000L, editTime);
}
Aggregations