Lines 47-52
import org.junit.Test;
Link Here
|
47 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellType; |
47 |
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellType; |
48 |
|
48 |
|
49 |
public final class TestSXSSFBugs extends BaseTestBugzillaIssues { |
49 |
public final class TestSXSSFBugs extends BaseTestBugzillaIssues { |
|
|
50 |
|
50 |
public TestSXSSFBugs() { |
51 |
public TestSXSSFBugs() { |
51 |
super(SXSSFITestDataProvider.instance); |
52 |
super(SXSSFITestDataProvider.instance); |
52 |
} |
53 |
} |
Lines 238-241
public final class TestSXSSFBugs extends BaseTestBugzillaIssues {
Link Here
|
238 |
} |
239 |
} |
239 |
} |
240 |
} |
240 |
} |
241 |
} |
|
|
242 |
|
243 |
@Test |
244 |
public void test64595() throws Exception { |
245 |
try (Workbook workbook = new SXSSFWorkbook(100)) { |
246 |
Sheet sheet = workbook.createSheet("RawData"); |
247 |
Row row = sheet.createRow(0); |
248 |
Cell cell; |
249 |
|
250 |
cell = row.createCell(0); |
251 |
cell.setCellValue("Ernie & Bert"); |
252 |
|
253 |
cell = row.createCell(1); |
254 |
// Set a precalculated formula value containing a special character. |
255 |
cell.setCellValue("Ernie & Bert are cool!"); |
256 |
cell.setCellFormula("A1 & \" are cool!\""); |
257 |
|
258 |
// While unfixed reading the workbook would throw a POIXMLException |
259 |
// since the file was corrupt due to missing quotation. |
260 |
try (Workbook wbBack = SXSSFITestDataProvider.instance.writeOutAndReadBack(workbook)) { |
261 |
assertNotNull(wbBack); |
262 |
cell = wbBack.getSheetAt(0).getRow(0).getCell(1); |
263 |
assertEquals("Ernie & Bert are cool!", cell.getStringCellValue()); |
264 |
assertEquals("A1 & \" are cool!\"", cell.getCellFormula()); |
265 |
} |
266 |
} |
267 |
} |
268 |
|
241 |
} |
269 |
} |