use of org.apache.poi.POIXMLProperties.CoreProperties in project poi by apache.
the class TestPOIXMLProperties method testTransitiveSetters.
@Test
public void testTransitiveSetters() throws IOException {
XWPFDocument doc = new XWPFDocument();
CoreProperties cp = doc.getProperties().getCoreProperties();
Date dateCreated = LocaleUtil.getLocaleCalendar(2010, 6, 15, 10, 0, 0).getTime();
cp.setCreated(new Nullable<Date>(dateCreated));
assertEquals(dateCreated, cp.getCreated());
XWPFDocument doc2 = XWPFTestDataSamples.writeOutAndReadBack(doc);
doc.close();
cp = doc2.getProperties().getCoreProperties();
Date dt3 = cp.getCreated();
assertEquals(dateCreated, dt3);
doc2.close();
}
use of org.apache.poi.POIXMLProperties.CoreProperties in project poi by apache.
the class TestXSLFSlideShow method testMetadataBasics.
@Test
public void testMetadataBasics() throws IOException, OpenXML4JException, XmlException {
XSLFSlideShow xml = new XSLFSlideShow(pack);
assertNotNull(xml.getProperties().getCoreProperties());
assertNotNull(xml.getProperties().getExtendedProperties());
CTProperties props = xml.getProperties().getExtendedProperties().getUnderlyingProperties();
assertEquals("Microsoft Office PowerPoint", props.getApplication());
assertEquals(0, props.getCharacters());
assertEquals(0, props.getLines());
CoreProperties cprops = xml.getProperties().getCoreProperties();
assertNull(cprops.getTitle());
assertNull(cprops.getUnderlyingProperties().getSubjectProperty().getValue());
xml.close();
}
Aggregations