mirror of https://github.com/apache/poi.git
fix junit tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1849047 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
150a00654e
commit
458b9e3aed
|
@ -73,20 +73,16 @@ public class HemfPlusExtractorTest {
|
||||||
|
|
||||||
|
|
||||||
private EmfCommentDataPlus getCommentRecord(String testFileName, int recordIndex) throws Exception {
|
private EmfCommentDataPlus getCommentRecord(String testFileName, int recordIndex) throws Exception {
|
||||||
EmfCommentDataPlus returnRecord = null;
|
|
||||||
|
|
||||||
try (InputStream is = POIDataSamples.getSpreadSheetInstance().openResourceAsStream(testFileName)) {
|
try (InputStream is = POIDataSamples.getSpreadSheetInstance().openResourceAsStream(testFileName)) {
|
||||||
HemfPicture ex = new HemfPicture(is);
|
HemfPicture ex = new HemfPicture(is);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (HemfRecord record : ex) {
|
for (HemfRecord record : ex) {
|
||||||
if (i == recordIndex) {
|
if (record instanceof EmfComment && i++ == recordIndex) {
|
||||||
EmfComment commentRecord = ((EmfComment) record);
|
EmfComment commentRecord = (EmfComment)record;
|
||||||
returnRecord = (EmfCommentDataPlus) commentRecord.getCommentData();
|
return (EmfCommentDataPlus) commentRecord.getCommentData();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return returnRecord;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,8 +207,8 @@ public class HemfPictureTest {
|
||||||
assertEquals(27864, header.getBytes());
|
assertEquals(27864, header.getBytes());
|
||||||
assertEquals(31, header.getRecords());
|
assertEquals(31, header.getRecords());
|
||||||
assertEquals(3, header.getHandles());
|
assertEquals(3, header.getHandles());
|
||||||
assertEquals(346000, header.getMicroDimension().getWidth());
|
assertEquals(346000, header.getMicroDimension().getWidth(), 0);
|
||||||
assertEquals(194000, header.getMicroDimension().getHeight());
|
assertEquals(194000, header.getMicroDimension().getHeight(), 0);
|
||||||
|
|
||||||
List<HemfRecord> records = pic.getRecords();
|
List<HemfRecord> records = pic.getRecords();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue