use of org.apache.poi.hemf.hemfplus.record.HemfPlusRecordType in project poi by apache.
the class HemfPlusExtractorTest method testBasic.
@Test
public void testBasic() throws Exception {
//test header
HemfCommentEMFPlus emfPlus = getCommentRecord("SimpleEMF_windows.emf", 0);
List<HemfPlusRecord> records = emfPlus.getRecords();
assertEquals(1, records.size());
assertEquals(HemfPlusRecordType.header, records.get(0).getRecordType());
HemfPlusHeader header = (HemfPlusHeader) records.get(0);
assertEquals(240, header.getLogicalDpiX());
assertEquals(240, header.getLogicalDpiY());
assertEquals(1, header.getFlags());
assertEquals(1, header.getEmfPlusFlags());
//test that the HemfCommentEMFPlus record at offset 1
//contains 6 HemfCommentEMFPlus records within it
List<HemfPlusRecordType> expected = new ArrayList<HemfPlusRecordType>();
expected.add(HemfPlusRecordType.setPixelOffsetMode);
expected.add(HemfPlusRecordType.setAntiAliasMode);
expected.add(HemfPlusRecordType.setCompositingQuality);
expected.add(HemfPlusRecordType.setPageTransform);
expected.add(HemfPlusRecordType.setInterpolationMode);
expected.add(HemfPlusRecordType.getDC);
emfPlus = getCommentRecord("SimpleEMF_windows.emf", 1);
records = emfPlus.getRecords();
assertEquals(expected.size(), records.size());
for (int i = 0; i < expected.size(); i++) {
assertEquals(expected.get(i), records.get(i).getRecordType());
}
}
Aggregations