Remove Eclipse warnings in tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1676903 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dcfe4f77b7
commit
3275263c2b
@ -554,8 +554,9 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Save and check
|
// Save and check
|
||||||
wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
XSSFWorkbook wbBack = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
||||||
s = wb.getSheetAt(0);
|
wb.close();
|
||||||
|
s = wbBack.getSheetAt(0);
|
||||||
r = s.getRow(0);
|
r = s.getRow(0);
|
||||||
c = r.getCell(0);
|
c = r.getCell(0);
|
||||||
assertEquals(" with spaces ", c.getRichStringCellValue().toString());
|
assertEquals(" with spaces ", c.getRichStringCellValue().toString());
|
||||||
@ -574,7 +575,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Apply a font
|
// Apply a font
|
||||||
XSSFFont f = wb.createFont();
|
XSSFFont f = wbBack.createFont();
|
||||||
f.setBold(true);
|
f.setBold(true);
|
||||||
c.getRichStringCellValue().applyFont(0, 5, f);
|
c.getRichStringCellValue().applyFont(0, 5, f);
|
||||||
assertEquals("hello world", c.getRichStringCellValue().toString());
|
assertEquals("hello world", c.getRichStringCellValue().toString());
|
||||||
@ -594,12 +595,12 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Save and check
|
// Save and check
|
||||||
wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
wbBack = XSSFTestDataSamples.writeOutAndReadBack(wbBack);
|
||||||
s = wb.getSheetAt(0);
|
s = wbBack.getSheetAt(0);
|
||||||
r = s.getRow(0);
|
r = s.getRow(0);
|
||||||
c = r.getCell(0);
|
c = r.getCell(0);
|
||||||
assertEquals("hello world", c.getRichStringCellValue().toString());
|
assertEquals("hello world", c.getRichStringCellValue().toString());
|
||||||
wb.close();
|
wbBack.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -956,8 +957,9 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
|||||||
assertEquals(text, cell.getStringCellValue());
|
assertEquals(text, cell.getStringCellValue());
|
||||||
|
|
||||||
// Save the file and re-read it
|
// Save the file and re-read it
|
||||||
wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
XSSFWorkbook wbBack = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
||||||
sheet = wb.getSheetAt(0);
|
wb.close();
|
||||||
|
sheet = wbBack.getSheetAt(0);
|
||||||
row = sheet.getRow(2);
|
row = sheet.getRow(2);
|
||||||
cell = row.getCell(2);
|
cell = row.getCell(2);
|
||||||
assertEquals(text, cell.getStringCellValue());
|
assertEquals(text, cell.getStringCellValue());
|
||||||
@ -974,12 +976,12 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
|||||||
assertEquals("line.\n", r3.substring(r3.length()-6));
|
assertEquals("line.\n", r3.substring(r3.length()-6));
|
||||||
|
|
||||||
// Save and re-check
|
// Save and re-check
|
||||||
wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
wbBack = XSSFTestDataSamples.writeOutAndReadBack(wbBack);
|
||||||
sheet = wb.getSheetAt(0);
|
sheet = wbBack.getSheetAt(0);
|
||||||
row = sheet.getRow(2);
|
row = sheet.getRow(2);
|
||||||
cell = row.getCell(2);
|
cell = row.getCell(2);
|
||||||
assertEquals(text, cell.getStringCellValue());
|
assertEquals(text, cell.getStringCellValue());
|
||||||
wb.close();
|
wbBack.close();
|
||||||
|
|
||||||
// FileOutputStream out = new FileOutputStream("/tmp/test48877.xlsx");
|
// FileOutputStream out = new FileOutputStream("/tmp/test48877.xlsx");
|
||||||
// wb.write(out);
|
// wb.write(out);
|
||||||
@ -1214,16 +1216,17 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
|||||||
|
|
||||||
|
|
||||||
// Save, re-load and re-check
|
// Save, re-load and re-check
|
||||||
wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
XSSFWorkbook wbBack = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
||||||
s = wb.getSheetAt(0);
|
wb.close();
|
||||||
defaultStyle = wb.getCellStyleAt(defaultStyle.getIndex());
|
s = wbBack.getSheetAt(0);
|
||||||
blueStyle = wb.getCellStyleAt(blueStyle.getIndex());
|
defaultStyle = wbBack.getCellStyleAt(defaultStyle.getIndex());
|
||||||
pinkStyle = wb.getCellStyleAt(pinkStyle.getIndex());
|
blueStyle = wbBack.getCellStyleAt(blueStyle.getIndex());
|
||||||
|
pinkStyle = wbBack.getCellStyleAt(pinkStyle.getIndex());
|
||||||
|
|
||||||
assertEquals(pinkStyle, s.getColumnStyle(0));
|
assertEquals(pinkStyle, s.getColumnStyle(0));
|
||||||
assertEquals(defaultStyle, s.getColumnStyle(2));
|
assertEquals(defaultStyle, s.getColumnStyle(2));
|
||||||
assertEquals(blueStyle, s.getColumnStyle(3));
|
assertEquals(blueStyle, s.getColumnStyle(3));
|
||||||
wb.close();
|
wbBack.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2090,6 +2093,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
|||||||
* A .xlsx file with no Shared Strings table should open fine
|
* A .xlsx file with no Shared Strings table should open fine
|
||||||
* in read-only mode
|
* in read-only mode
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("resource")
|
||||||
@Test
|
@Test
|
||||||
public void bug57482() throws Exception {
|
public void bug57482() throws Exception {
|
||||||
for (PackageAccess access : new PackageAccess[] {
|
for (PackageAccess access : new PackageAccess[] {
|
||||||
@ -2432,5 +2436,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
|||||||
assertEquals("ISERROR(CSN!A1)", c.getCellFormula());
|
assertEquals("ISERROR(CSN!A1)", c.getCellFormula());
|
||||||
c = s.getRow(1).getCell(1);
|
c = s.getRow(1).getCell(1);
|
||||||
assertEquals("ISERROR(B2)", c.getCellFormula());
|
assertEquals("ISERROR(B2)", c.getCellFormula());
|
||||||
|
|
||||||
|
wb.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,8 +92,8 @@ public final class TestXSSFPictureData extends TestCase {
|
|||||||
assertNotNull(p3);
|
assertNotNull(p3);
|
||||||
|
|
||||||
//check that the added pictures are accessible after write
|
//check that the added pictures are accessible after write
|
||||||
wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
XSSFWorkbook wbBack = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
||||||
List<XSSFPictureData> pictures2 = wb.getAllPictures();
|
List<XSSFPictureData> pictures2 = wbBack.getAllPictures();
|
||||||
assertEquals(3, pictures2.size());
|
assertEquals(3, pictures2.size());
|
||||||
|
|
||||||
assertEquals("jpeg", pictures2.get(jpegIdx).suggestFileExtension());
|
assertEquals("jpeg", pictures2.get(jpegIdx).suggestFileExtension());
|
||||||
|
Loading…
Reference in New Issue
Block a user