Remove Eclipse warnings, remove duplicate test, rename tests to also run tests in base class
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1521015 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e6ed66a126
commit
4a3c974e3b
@ -64,7 +64,7 @@ public final class HSSFPalette {
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the first occurance of a given color
|
||||
* Finds the first occurrence of a given color
|
||||
*
|
||||
* @param red the RGB red component, between 0 and 255 inclusive
|
||||
* @param green the RGB green component, between 0 and 255 inclusive
|
||||
@ -194,11 +194,13 @@ public final class HSSFPalette {
|
||||
_blue = blue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getIndex()
|
||||
{
|
||||
return _byteOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short[] getTriplet()
|
||||
{
|
||||
return new short[]
|
||||
@ -209,6 +211,7 @@ public final class HSSFPalette {
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHexString()
|
||||
{
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
@ -592,7 +592,8 @@ public interface Sheet extends Iterable<Row> {
|
||||
* @param leftcol the left column to show in desktop window pane
|
||||
* @deprecated Use {@link #showInPane(int, int)} as there can be more than 32767 rows.
|
||||
*/
|
||||
void showInPane(short toprow, short leftcol);
|
||||
@Deprecated
|
||||
void showInPane(short toprow, short leftcol);
|
||||
|
||||
/**
|
||||
* Shifts rows between startRow and endRow n number of rows.
|
||||
|
@ -22,13 +22,13 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.poi.ss.formula.ptg.Ptg;
|
||||
import org.apache.poi.ss.formula.SharedFormula;
|
||||
import org.apache.poi.ss.formula.eval.ErrorEval;
|
||||
import org.apache.poi.ss.SpreadsheetVersion;
|
||||
import org.apache.poi.ss.formula.FormulaParser;
|
||||
import org.apache.poi.ss.formula.FormulaRenderer;
|
||||
import org.apache.poi.ss.formula.FormulaType;
|
||||
import org.apache.poi.ss.formula.SharedFormula;
|
||||
import org.apache.poi.ss.formula.eval.ErrorEval;
|
||||
import org.apache.poi.ss.formula.ptg.Ptg;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.Comment;
|
||||
@ -39,9 +39,9 @@ import org.apache.poi.ss.usermodel.Hyperlink;
|
||||
import org.apache.poi.ss.usermodel.RichTextString;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.ss.util.CellReference;
|
||||
import org.apache.poi.util.Internal;
|
||||
import org.apache.poi.xssf.model.SharedStringsTable;
|
||||
import org.apache.poi.xssf.model.StylesTable;
|
||||
import org.apache.poi.util.Internal;
|
||||
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
|
||||
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellFormula;
|
||||
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellFormulaType;
|
||||
@ -790,6 +790,7 @@ public final class XSSFCell implements Cell {
|
||||
* Errors are displayed as #ERR<errIdx>
|
||||
* </p>
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (getCellType()) {
|
||||
case CELL_TYPE_BLANK:
|
||||
|
@ -26,8 +26,6 @@ import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.util.CellReference;
|
||||
import org.apache.poi.util.Internal;
|
||||
import org.apache.poi.util.POILogFactory;
|
||||
import org.apache.poi.util.POILogger;
|
||||
import org.apache.poi.xssf.model.CalculationChain;
|
||||
import org.apache.poi.xssf.model.StylesTable;
|
||||
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
|
||||
@ -37,7 +35,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRow;
|
||||
* High level representation of a row of a spreadsheet.
|
||||
*/
|
||||
public class XSSFRow implements Row, Comparable<XSSFRow> {
|
||||
private static final POILogger _logger = POILogFactory.getLogger(XSSFRow.class);
|
||||
//private static final POILogger _logger = POILogFactory.getLogger(XSSFRow.class);
|
||||
|
||||
/**
|
||||
* the xml bean containing all cell definitions for this row
|
||||
@ -93,7 +91,8 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
|
||||
*
|
||||
* @return an iterator over cells in this row.
|
||||
*/
|
||||
public Iterator<Cell> cellIterator() {
|
||||
@SuppressWarnings("unchecked")
|
||||
public Iterator<Cell> cellIterator() {
|
||||
return (Iterator<Cell>)(Iterator<? extends Cell>)_cells.values().iterator();
|
||||
}
|
||||
|
||||
@ -202,7 +201,7 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
|
||||
public XSSFCell getCell(int cellnum, MissingCellPolicy policy) {
|
||||
if(cellnum < 0) throw new IllegalArgumentException("Cell index must be >= 0");
|
||||
|
||||
XSSFCell cell = (XSSFCell)_cells.get(cellnum);
|
||||
XSSFCell cell = _cells.get(cellnum);
|
||||
if(policy == RETURN_NULL_AND_BLANK) {
|
||||
return cell;
|
||||
}
|
||||
|
@ -51,7 +51,8 @@ public final class TestXSSFSheet extends BaseTestSheet {
|
||||
}
|
||||
|
||||
//TODO column styles are not yet supported by XSSF
|
||||
public void testDefaultColumnStyle() {
|
||||
@Override
|
||||
public void testDefaultColumnStyle() {
|
||||
//super.testDefaultColumnStyle();
|
||||
}
|
||||
|
||||
@ -914,7 +915,7 @@ public final class TestXSSFSheet extends BaseTestSheet {
|
||||
* Rows and cells can be created in random order,
|
||||
* but CTRows are kept in ascending order
|
||||
*/
|
||||
public void testCreateRow() {
|
||||
public void testCreateRowA() {
|
||||
XSSFWorkbook workbook = new XSSFWorkbook();
|
||||
XSSFSheet sheet = workbook.createSheet();
|
||||
CTWorksheet wsh = sheet.getCTWorksheet();
|
||||
|
@ -30,11 +30,11 @@ import org.apache.poi.hssf.model.HSSFFormulaParser;
|
||||
import org.apache.poi.hssf.model.InternalWorkbook;
|
||||
import org.apache.poi.hssf.record.FormulaRecord;
|
||||
import org.apache.poi.hssf.record.Record;
|
||||
import org.apache.poi.ss.formula.ptg.Ptg;
|
||||
import org.apache.poi.ss.formula.ptg.Ref3DPtg;
|
||||
import org.apache.poi.hssf.usermodel.HSSFEvaluationWorkbook;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
||||
import org.apache.poi.ss.formula.ptg.Ptg;
|
||||
import org.apache.poi.ss.formula.ptg.Ref3DPtg;
|
||||
/**
|
||||
* Tests for {@link EventWorkbookBuilder}
|
||||
*/
|
||||
@ -42,6 +42,7 @@ public final class TestEventWorkbookBuilder extends TestCase {
|
||||
private MockHSSFListener mockListen;
|
||||
private SheetRecordCollectingListener listener;
|
||||
|
||||
@Override
|
||||
public void setUp() {
|
||||
HSSFRequest req = new HSSFRequest();
|
||||
mockListen = new MockHSSFListener();
|
||||
@ -146,8 +147,8 @@ public final class TestEventWorkbookBuilder extends TestCase {
|
||||
|
||||
private static final class MockHSSFListener implements HSSFListener {
|
||||
public MockHSSFListener() {}
|
||||
private final List _records = new ArrayList();
|
||||
private final List _frecs = new ArrayList();
|
||||
private final List<Record> _records = new ArrayList<Record>();
|
||||
private final List<Record> _frecs = new ArrayList<Record>();
|
||||
|
||||
public void processRecord(Record record) {
|
||||
_records.add(record);
|
||||
|
@ -25,7 +25,6 @@ import junit.framework.TestCase;
|
||||
|
||||
import org.apache.poi.hssf.HSSFTestDataSamples;
|
||||
import org.apache.poi.hssf.record.PaletteRecord;
|
||||
import org.apache.poi.hssf.usermodel.HSSFPalette;
|
||||
import org.apache.poi.hssf.util.HSSFColor;
|
||||
|
||||
/**
|
||||
@ -36,6 +35,7 @@ public final class TestHSSFPalette extends TestCase {
|
||||
private HSSFPalette _hssfPalette;
|
||||
|
||||
|
||||
@Override
|
||||
public void setUp()
|
||||
{
|
||||
_palette = new PaletteRecord();
|
||||
@ -268,12 +268,12 @@ public final class TestHSSFPalette extends TestCase {
|
||||
}
|
||||
|
||||
private void compareToDefaults(ColorComparator c) {
|
||||
Map colors = HSSFColor.getIndexHash();
|
||||
Iterator it = colors.keySet().iterator();
|
||||
Map<Integer,HSSFColor> colors = HSSFColor.getIndexHash();
|
||||
Iterator<Integer> it = colors.keySet().iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
Number index = (Number) it.next();
|
||||
HSSFColor expectedColor = (HSSFColor) colors.get(index);
|
||||
Number index = it.next();
|
||||
HSSFColor expectedColor = colors.get(index);
|
||||
HSSFColor paletteColor = _hssfPalette.getColor(index.shortValue());
|
||||
c.compare(expectedColor, paletteColor);
|
||||
}
|
||||
|
@ -28,13 +28,13 @@ import org.apache.poi.ddf.EscherDgRecord;
|
||||
import org.apache.poi.hssf.HSSFITestDataProvider;
|
||||
import org.apache.poi.hssf.HSSFTestDataSamples;
|
||||
import org.apache.poi.hssf.model.DrawingManager2;
|
||||
import org.apache.poi.hssf.model.InternalWorkbook;
|
||||
import org.apache.poi.hssf.model.InternalSheet;
|
||||
import org.apache.poi.hssf.model.InternalWorkbook;
|
||||
import org.apache.poi.hssf.record.*;
|
||||
import org.apache.poi.ss.formula.ptg.Ptg;
|
||||
import org.apache.poi.ss.formula.ptg.Area3DPtg;
|
||||
import org.apache.poi.hssf.record.aggregates.WorksheetProtectionBlock;
|
||||
import org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector;
|
||||
import org.apache.poi.ss.formula.ptg.Area3DPtg;
|
||||
import org.apache.poi.ss.formula.ptg.Ptg;
|
||||
import org.apache.poi.ss.usermodel.BaseTestSheet;
|
||||
import org.apache.poi.ss.usermodel.DataValidation;
|
||||
import org.apache.poi.ss.usermodel.DataValidationConstraint;
|
||||
@ -44,7 +44,6 @@ import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||
import org.apache.poi.ss.util.Region;
|
||||
import org.apache.poi.util.TempFile;
|
||||
|
||||
/**
|
||||
@ -363,7 +362,7 @@ public final class TestHSSFSheet extends BaseTestSheet {
|
||||
assertEquals(expectedHashA, sheet2.getSheet().getProtectionBlock().getPasswordHash());
|
||||
}
|
||||
|
||||
public void testProtectSheet() {
|
||||
public void testProtectSheetA() {
|
||||
int expectedHash = (short)0xfef1;
|
||||
HSSFWorkbook wb = new HSSFWorkbook();
|
||||
HSSFSheet s = wb.createSheet();
|
||||
@ -517,21 +516,6 @@ public final class TestHSSFSheet extends BaseTestSheet {
|
||||
assertEquals("HSSFSheet.getLeftCol()", leftcol, sheet.getLeftCol());
|
||||
}
|
||||
|
||||
/** cell with formula becomes null on cloning a sheet*/
|
||||
public void test35084() {
|
||||
|
||||
HSSFWorkbook wb = new HSSFWorkbook();
|
||||
HSSFSheet s = wb.createSheet("Sheet1");
|
||||
HSSFRow r = s.createRow(0);
|
||||
r.createCell(0).setCellValue(1);
|
||||
r.createCell(1).setCellFormula("A1*2");
|
||||
HSSFSheet s1 = wb.cloneSheet(0);
|
||||
r = s1.getRow(0);
|
||||
assertEquals("double", r.getCell(0).getNumericCellValue(), 1, 0); // sanity check
|
||||
assertNotNull(r.getCell(1));
|
||||
assertEquals("formula", r.getCell(1).getCellFormula(), "A1*2");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ -702,7 +686,7 @@ public final class TestHSSFSheet extends BaseTestSheet {
|
||||
assertTrue(wb3.getSheetAt(3).getForceFormulaRecalculation());
|
||||
}
|
||||
|
||||
public void testColumnWidth() {
|
||||
public void testColumnWidthA() {
|
||||
//check we can correctly read column widths from a reference workbook
|
||||
HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("colwidth.xls");
|
||||
|
||||
|
@ -394,6 +394,7 @@ public abstract class BaseTestSheet extends TestCase {
|
||||
assertEquals(40000, sheet.getColumnWidth(10));
|
||||
}
|
||||
|
||||
|
||||
public void testDefaultRowHeight() {
|
||||
Workbook workbook = _testDataProvider.createWorkbook();
|
||||
Sheet sheet = workbook.createSheet();
|
||||
@ -538,8 +539,8 @@ public abstract class BaseTestSheet extends TestCase {
|
||||
double marginRight = defaultMargins[1];
|
||||
double marginTop = defaultMargins[2];
|
||||
double marginBottom = defaultMargins[3];
|
||||
double marginHeader = defaultMargins[4];
|
||||
double marginFooter = defaultMargins[5];
|
||||
//double marginHeader = defaultMargins[4];
|
||||
//double marginFooter = defaultMargins[5];
|
||||
|
||||
Workbook workbook = _testDataProvider.createWorkbook();
|
||||
Sheet sheet = workbook.createSheet("Sheet 1");
|
||||
|
Loading…
Reference in New Issue
Block a user