Add disabled, failing unit test for bug #49940

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@997752 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2010-09-16 13:46:17 +00:00
parent 0e504bd9ca
commit d791eb68a9

View File

@ -17,6 +17,8 @@
package org.apache.poi.xssf.usermodel;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.List;
import org.apache.poi.POIXMLDocumentPart;
@ -428,5 +430,31 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
assertEquals(Cell.CELL_TYPE_ERROR, evaluator.evaluateInCell(cell).getCellType());
assertEquals("#REF!", FormulaError.forInt(cell.getErrorCellValue()).getString());
}
/**
* Repeatedly writing the same file which has styles
* TODO Currently failing
*/
public void DISABLEDtest49940() throws Exception {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("styles.xlsx");
assertEquals(3, wb.getNumberOfSheets());
assertEquals(10, wb.getStylesSource().getNumCellStyles());
ByteArrayOutputStream b1 = new ByteArrayOutputStream();
ByteArrayOutputStream b2 = new ByteArrayOutputStream();
ByteArrayOutputStream b3 = new ByteArrayOutputStream();
wb.write(b1);
wb.write(b2);
wb.write(b3);
for(byte[] data : new byte[][] {
b1.toByteArray(), b2.toByteArray(), b3.toByteArray()
}) {
ByteArrayInputStream bais = new ByteArrayInputStream(data);
wb = new XSSFWorkbook(bais);
assertEquals(3, wb.getNumberOfSheets());
assertEquals(10, wb.getStylesSource().getNumCellStyles());
}
}
}