mirror of https://github.com/apache/poi.git
Start testing the contents of FeatRecord
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@894091 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9d432275a9
commit
e4a4574a1e
|
@ -104,4 +104,38 @@ public final class FeatRecord extends StandardRecord {
|
|||
(cellRefs.length * CellRangeAddress.ENCODED_SIZE)
|
||||
+rgbFeat.length;
|
||||
}
|
||||
|
||||
public int getIsf_sharedFeatureType() {
|
||||
return isf_sharedFeatureType;
|
||||
}
|
||||
public void setIsf_sharedFeatureType(int isfSharedFeatureType) {
|
||||
isf_sharedFeatureType = isfSharedFeatureType;
|
||||
}
|
||||
|
||||
public long getCbFeatData() {
|
||||
return cbFeatData;
|
||||
}
|
||||
public void setCbFeatData(long cbFeatData) {
|
||||
this.cbFeatData = cbFeatData;
|
||||
}
|
||||
|
||||
public CellRangeAddress[] getCellRefs() {
|
||||
return cellRefs;
|
||||
}
|
||||
public void setCellRefs(CellRangeAddress[] cellRefs) {
|
||||
this.cellRefs = cellRefs;
|
||||
}
|
||||
|
||||
public byte[] getRgbFeat() {
|
||||
return rgbFeat;
|
||||
}
|
||||
public void setRgbFeat(byte[] rgbFeat) {
|
||||
this.rgbFeat = rgbFeat;
|
||||
|
||||
if(isf_sharedFeatureType == FeatHdrRecord.SHAREDFEATURES_ISFFEC2) {
|
||||
cbFeatData = rgbFeat.length;
|
||||
} else {
|
||||
cbFeatData = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@ public final class TestFeatRecord extends TestCase {
|
|||
InternalWorkbook wb = HSSFTestHelper.getWorkbookForTest(hssf);
|
||||
|
||||
FeatRecord fr = null;
|
||||
FeatHdrRecord fhr = null;
|
||||
|
||||
assertEquals(1, hssf.getNumberOfSheets());
|
||||
|
||||
|
@ -125,6 +126,7 @@ public final class TestFeatRecord extends TestCase {
|
|||
countFR++;
|
||||
}
|
||||
if(r instanceof FeatHdrRecord) {
|
||||
fhr = (FeatHdrRecord)r;
|
||||
countFRH++;
|
||||
} else if (r.getSid() == FeatHdrRecord.sid) {
|
||||
countFRH++;
|
||||
|
@ -135,7 +137,23 @@ public final class TestFeatRecord extends TestCase {
|
|||
assertEquals(1, countFR);
|
||||
assertEquals(1, countFRH);
|
||||
assertNotNull(fr);
|
||||
assertNotNull(fhr);
|
||||
|
||||
// Now check the contents are as expected
|
||||
assertEquals(
|
||||
FeatHdrRecord.SHAREDFEATURES_ISFFEC2,
|
||||
fr.getIsf_sharedFeatureType()
|
||||
);
|
||||
|
||||
// Applies to one cell only
|
||||
assertEquals(1, fr.getCellRefs().length);
|
||||
assertEquals(0, fr.getCellRefs()[0].getFirstRow());
|
||||
assertEquals(0, fr.getCellRefs()[0].getLastRow());
|
||||
assertEquals(0, fr.getCellRefs()[0].getFirstColumn());
|
||||
assertEquals(0, fr.getCellRefs()[0].getLastColumn());
|
||||
|
||||
// TODO - more checking of shared features stuff
|
||||
assertEquals(4, fr.getCbFeatData());
|
||||
assertEquals(4, fr.getRgbFeat().length);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue