/**
* Excel .xls style indexed colours in a .xlsx file
*/
+ @SuppressWarnings("deprecation")
@Test
public void bug50786() throws Exception {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("50786-indexed_colours.xlsx");
* then being set explicitly still should allow the
* fetching of the RGB.
*/
+ @SuppressWarnings("deprecation")
@Test
public void bug50784() throws Exception {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("50784-font_theme_colours.xlsx");
// Now check the spreadsheet itself
try {
- new XSSFWorkbook(pkg);
+ new XSSFWorkbook(pkg).close();
fail("Should fail as too much expansion occurs");
} catch(POIXMLException e) {
// Expected
// XSSF Workbook gives helpful error
try {
- new XSSFWorkbook(pkg);
+ new XSSFWorkbook(pkg).close();
fail(".xlsb files not supported");
} catch (XLSBUnsupportedException e) {
// Good, detected and warned
public void bug57880() throws Exception {
int numStyles = 33000;
XSSFWorkbook wb = new XSSFWorkbook();
- XSSFSheet s = wb.createSheet("TestSheet");
+ //XSSFSheet s = wb.createSheet("TestSheet");
XSSFDataFormat fmt = wb.getCreationHelper().createDataFormat();
for (int i=1; i<numStyles; i++) {
short df = fmt.getFormat("test"+i);
XSSFCellStyle style = wb.createCellStyle();
assertEquals(i, style.getUIndex());
style.setDataFormat(df);
- XSSFCell c = s.createRow(i).createCell(0, Cell.CELL_TYPE_NUMERIC);
+ /*XSSFCell c = s.createRow(i).createCell(0, Cell.CELL_TYPE_NUMERIC);
c.setCellStyle(style);
- c.setCellValue(i);
+ c.setCellValue(i);*/
}
-
+
// using temp file instead of ByteArrayOutputStream because of OOM in gump run
File tmp = TempFile.createTempFile("poi-test", ".bug57880");
FileOutputStream fos = new FileOutputStream(tmp);
fos.close();
wb.close();
- fmt = null; s = null; wb = null;
+ fmt = null; /*s = null;*/ wb = null;
// System.gc();
wb = new XSSFWorkbook(tmp);
fmt = wb.getCreationHelper().createDataFormat();
- s = wb.getSheetAt(0);
+ // s = wb.getSheetAt(0);
for (int i=1; i<numStyles; i++) {
XSSFCellStyle style = wb.getCellStyleAt((short)i);
assertNotNull(style);
import java.text.AttributedString;
import java.util.HashMap;
import java.util.Map;
-import java.util.Random;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.PaneInformation;
public void bug58260() throws IOException {
//Create workbook and worksheet
Workbook wb = _testDataProvider.createWorkbook();
- Sheet worksheet = wb.createSheet("sample");
+ //Sheet worksheet = wb.createSheet("sample");
//Loop through and add all values from array list
// use a fixed seed to always produce the same file which makes comparing stuff easier
- Random rnd = new Random(4352345);
+ //Random rnd = new Random(4352345);
int maxStyles = (wb instanceof HSSFWorkbook) ? 4009 : 64000;
for(int i = 0;i < maxStyles;i++) {
//Create new row
- Row row = worksheet.createRow(i);
+ //Row row = worksheet.createRow(i);
//Create cell style
final CellStyle style;
}
//Create cell
- Cell cell = row.createCell(0);
+ //Cell cell = row.createCell(0);
//Set cell style
- cell.setCellStyle(style);
+ //cell.setCellStyle(style);
//Set cell value
- cell.setCellValue("r" + rnd.nextInt());
+ //cell.setCellValue("r" + rnd.nextInt());
}
// should fail if we try to add more now