Fix compiler warnings and ensure CTChartSheets stays included and is not refactored out by automated import reorganization

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1738752 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2016-04-12 10:09:44 +00:00
parent bf77655e00
commit 78a05ca7a0

View File

@ -17,16 +17,12 @@
package org.apache.poi.xssf.usermodel; package org.apache.poi.xssf.usermodel;
import static org.junit.Assert.assertEquals; import org.apache.poi.ss.util.CellAddress;
import static org.junit.Assert.assertNotNull; import org.apache.poi.xssf.XSSFTestDataSamples;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.junit.Test; import org.junit.Test;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTChartsheet; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTChartsheet;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.XSSFTestDataSamples; import static org.junit.Assert.*;
public final class TestXSSFChartSheet { public final class TestXSSFChartSheet {
@ -40,6 +36,8 @@ public final class TestXSSFChartSheet {
assertTrue(wb.getSheetAt(2) instanceof XSSFChartSheet); assertTrue(wb.getSheetAt(2) instanceof XSSFChartSheet);
assertEquals("Chart1", wb.getSheetAt(2).getSheetName()); assertEquals("Chart1", wb.getSheetAt(2).getSheetName());
final CTChartsheet ctChartsheet = ((XSSFChartSheet) wb.getSheetAt(2)).getCTChartsheet();
assertNotNull(ctChartsheet);
} }
@Test @Test
@ -47,9 +45,9 @@ public final class TestXSSFChartSheet {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("chart_sheet.xlsx"); XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("chart_sheet.xlsx");
XSSFChartSheet sheet = (XSSFChartSheet)wb.getSheetAt(2); XSSFChartSheet sheet = (XSSFChartSheet)wb.getSheetAt(2);
for(Row row : sheet) { assertFalse("Row iterator for charts sheets should return zero rows",
fail("Row iterator for charts sheets should return zero rows"); sheet.iterator().hasNext());
}
//access to a arbitrary row //access to a arbitrary row
assertNull(sheet.getRow(1)); assertNull(sheet.getRow(1));
@ -59,7 +57,9 @@ public final class TestXSSFChartSheet {
assertEquals(0, sheet.getNumMergedRegions()); assertEquals(0, sheet.getNumMergedRegions());
assertNull(sheet.getActiveCell()); assertNull(sheet.getActiveCell());
assertTrue(sheet.getAutobreaks()); assertTrue(sheet.getAutobreaks());
//noinspection deprecation
assertNull(sheet.getCellComment(0, 0)); assertNull(sheet.getCellComment(0, 0));
assertNull(sheet.getCellComment(new CellAddress(0, 0)));
assertEquals(0, sheet.getColumnBreaks().length); assertEquals(0, sheet.getColumnBreaks().length);
assertTrue(sheet.getRowSumsBelow()); assertTrue(sheet.getRowSumsBelow());
assertNotNull(sheet.createDrawingPatriarch()); assertNotNull(sheet.createDrawingPatriarch());