Fix bug (broken junit) introduced in r773412. Also hooked up test.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@773441 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Josh Micich 2009-05-11 00:50:45 +00:00
parent 93c369411f
commit df9cd1738e
3 changed files with 10 additions and 7 deletions

View File

@ -25,6 +25,7 @@ import org.apache.poi.hssf.record.BOFRecord;
import org.apache.poi.hssf.record.EOFRecord;
import org.apache.poi.hssf.record.Record;
import org.apache.poi.hssf.record.RecordBase;
import org.apache.poi.hssf.record.UnknownRecord;
/**
* Manages the all the records associated with a chart sub-stream.<br/>
@ -47,6 +48,11 @@ public final class ChartSubstreamRecordAggregate extends RecordAggregate {
while (rs.peekNextClass() != EOFRecord.class) {
if (PageSettingsBlock.isComponentRecord(rs.peekNextSid())) {
if (_psBlock != null) {
if (rs.peekNextSid() == UnknownRecord.HEADER_FOOTER_089C) {
// test samples: 45538_classic_Footer.xls, 45538_classic_Header.xls
_psBlock.addLateHeaderFooter(rs.getNext());
continue;
}
throw new IllegalStateException(
"Found more than one PageSettingsBlock in chart sub-stream");
}

View File

@ -48,10 +48,7 @@ public final class HSSFTests {
suite.addTest(AllUserModelTests.suite());
suite.addTest(AllRecordTests.suite());
suite.addTest(AllHSSFUtilTests.suite());
if (false) { // TODO - hook this test up
suite.addTest(new TestSuite(TestExcelExtractor.class));
}
suite.addTest(new TestSuite(TestEventRecordFactory.class));
suite.addTest(new TestSuite(TestModelFactory.class));
suite.addTest(AllSSFormulaTests.suite());

View File

@ -165,7 +165,7 @@ public final class TestExcelExtractor extends TestCase {
);
}
public void testWithComments() throws Exception {
public void testWithComments() {
ExcelExtractor extractor = createExtractor("SimpleWithComments.xls");
extractor.setIncludeSheetNames(false);
@ -187,7 +187,7 @@ public final class TestExcelExtractor extends TestCase {
);
}
public void testWithBlank() throws Exception {
public void testWithBlank() {
ExcelExtractor extractor = createExtractor("MissingBits.xls");
String def = extractor.getText();
extractor.setIncludeBlankCells(true);
@ -277,7 +277,7 @@ public final class TestExcelExtractor extends TestCase {
/**
* Test that we get text from headers and footers
*/
public void test45538() throws Exception {
public void test45538() {
String[] files = {
"45538_classic_Footer.xls", "45538_form_Footer.xls",
"45538_classic_Header.xls", "45538_form_Header.xls"