doTestHyperlinkContents(sheet);
assertEquals(HyperlinkType.URL,
- sheet.getRow(17).getCell(2).getHyperlink().getTypeEnum());
+ sheet.getRow(17).getCell(2).getHyperlink().getType());
assertEquals("POI SS Link",
sheet.getRow(17).getCell(2).getHyperlink().getLabel());
assertEquals("http://poi.apache.org/spreadsheet/",
doTestHyperlinkContents(sheet);
assertEquals(HyperlinkType.URL,
- sheet.getRow(17).getCell(2).getHyperlink().getTypeEnum());
+ sheet.getRow(17).getCell(2).getHyperlink().getType());
assertEquals("POI SS Link",
sheet.getRow(17).getCell(2).getHyperlink().getLabel());
assertEquals("http://poi.apache.org/spreadsheet/",
// First is a link to poi
assertEquals(HyperlinkType.URL,
- sheet.getRow(3).getCell(2).getHyperlink().getTypeEnum());
+ sheet.getRow(3).getCell(2).getHyperlink().getType());
assertEquals(null,
sheet.getRow(3).getCell(2).getHyperlink().getLabel());
assertEquals("http://poi.apache.org/",
// Next is an internal doc link
assertEquals(HyperlinkType.DOCUMENT,
- sheet.getRow(14).getCell(2).getHyperlink().getTypeEnum());
+ sheet.getRow(14).getCell(2).getHyperlink().getType());
assertEquals("Internal hyperlink to A2",
sheet.getRow(14).getCell(2).getHyperlink().getLabel());
assertEquals("Sheet1!A2",
// Next is a file
assertEquals(HyperlinkType.FILE,
- sheet.getRow(15).getCell(2).getHyperlink().getTypeEnum());
+ sheet.getRow(15).getCell(2).getHyperlink().getType());
assertEquals(null,
sheet.getRow(15).getCell(2).getHyperlink().getLabel());
assertEquals("WithVariousData.xlsx",
// Last is a mailto
assertEquals(HyperlinkType.EMAIL,
- sheet.getRow(16).getCell(2).getHyperlink().getTypeEnum());
+ sheet.getRow(16).getCell(2).getHyperlink().getType());
assertEquals(null,
sheet.getRow(16).getCell(2).getHyperlink().getLabel());
assertEquals("mailto:dev@poi.apache.org?subject=XSSF%20Hyperlinks",
assertEquals(sh1.getNumberOfComments(), sh2.getNumberOfComments());
XSSFHyperlink l1 = sh1.getHyperlink(0, 1);
- assertEquals(HyperlinkType.DOCUMENT, l1.getTypeEnum());
+ assertEquals(HyperlinkType.DOCUMENT, l1.getType());
assertEquals("B1", l1.getCellRef());
assertEquals("Sort on Titel", l1.getTooltip());
XSSFHyperlink l2 = sh2.getHyperlink(0, 1);
assertEquals(l1.getTooltip(), l2.getTooltip());
- assertEquals(HyperlinkType.DOCUMENT, l2.getTypeEnum());
+ assertEquals(HyperlinkType.DOCUMENT, l2.getType());
assertEquals("B1", l2.getCellRef());
}
XSSFHyperlink link = sh.getHyperlink(A2);
assertEquals("address", "A2", link.getCellRef());
- assertEquals("link type", HyperlinkType.URL, link.getTypeEnum());
+ assertEquals("link type", HyperlinkType.URL, link.getType());
assertEquals("link target", "http://twitter.com/#!/apacheorg", link.getAddress());
link = sh.getHyperlink(A3);
assertEquals("address", "A3", link.getCellRef());
- assertEquals("link type", HyperlinkType.URL, link.getTypeEnum());
+ assertEquals("link type", HyperlinkType.URL, link.getType());
assertEquals("link target", "http://www.bailii.org/databases.html#ie", link.getAddress());
link = sh.getHyperlink(A4);
assertEquals("address", "A4", link.getCellRef());
- assertEquals("link type", HyperlinkType.URL, link.getTypeEnum());
+ assertEquals("link type", HyperlinkType.URL, link.getType());
assertEquals("link target", "https://en.wikipedia.org/wiki/Apache_POI#See_also", link.getAddress());
link = sh.getHyperlink(A7);
assertEquals("address", "A7", link.getCellRef());
- assertEquals("link type", HyperlinkType.DOCUMENT, link.getTypeEnum());
+ assertEquals("link type", HyperlinkType.DOCUMENT, link.getType());
assertEquals("link target", "Sheet1", link.getAddress());
wb.close();
// Blank
cell = CellUtil.getCell(destRow, col++);
- assertEquals("[Blank] C7 cell type", CellType.BLANK, cell.getCellTypeEnum());
+ assertEquals("[Blank] C7 cell type", CellType.BLANK, cell.getCellType());
// Error
cell = CellUtil.getCell(destRow, col++);
- assertEquals("[Error] D7 cell type", CellType.ERROR, cell.getCellTypeEnum());
+ assertEquals("[Error] D7 cell type", CellType.ERROR, cell.getCellType());
final FormulaError error = FormulaError.forInt(cell.getErrorCellValue());
assertEquals("[Error] D7 cell value", FormulaError.NA, error); //FIXME: XSSFCell and HSSFCell expose different interfaces. getErrorCellString would be helpful here
// Date
cell = CellUtil.getCell(destRow, col++);
- assertEquals("[Date] E7 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
+ assertEquals("[Date] E7 cell type", CellType.NUMERIC, cell.getCellType());
final Date date = LocaleUtil.getLocaleCalendar(2000, Calendar.JANUARY, 1).getTime();
assertEquals("[Date] E7 cell value", date, cell.getDateCellValue());
// Boolean
cell = CellUtil.getCell(destRow, col++);
- assertEquals("[Boolean] F7 cell type", CellType.BOOLEAN, cell.getCellTypeEnum());
+ assertEquals("[Boolean] F7 cell type", CellType.BOOLEAN, cell.getCellType());
assertEquals("[Boolean] F7 cell value", true, cell.getBooleanCellValue());
// String
cell = CellUtil.getCell(destRow, col++);
- assertEquals("[String] G7 cell type", CellType.STRING, cell.getCellTypeEnum());
+ assertEquals("[String] G7 cell type", CellType.STRING, cell.getCellType());
assertEquals("[String] G7 cell value", "Hello", cell.getStringCellValue());
// Int
cell = CellUtil.getCell(destRow, col++);
- assertEquals("[Int] H7 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
+ assertEquals("[Int] H7 cell type", CellType.NUMERIC, cell.getCellType());
assertEquals("[Int] H7 cell value", 15, (int) cell.getNumericCellValue());
// Float
cell = CellUtil.getCell(destRow, col++);
- assertEquals("[Float] I7 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
+ assertEquals("[Float] I7 cell type", CellType.NUMERIC, cell.getCellType());
assertEquals("[Float] I7 cell value", 12.5, cell.getNumericCellValue(), FLOAT_PRECISION);
// Cell Formula
cell = CellUtil.getCell(destRow, col++);
assertEquals("J7", new CellReference(cell).formatAsString());
- assertEquals("[Cell Formula] J7 cell type", CellType.FORMULA, cell.getCellTypeEnum());
+ assertEquals("[Cell Formula] J7 cell type", CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula] J7 cell formula", "5+2", cell.getCellFormula());
System.out.println("Cell formula evaluation currently unsupported");
cell = CellUtil.getCell(destRow, col++);
assertEquals("K7", new CellReference(cell).formatAsString());
assertEquals("[Cell Formula with Reference] K7 cell type",
- CellType.FORMULA, cell.getCellTypeEnum());
+ CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula with Reference] K7 cell formula",
"J7+H$2", cell.getCellFormula());
// Cell Formula with Reference spanning multiple rows
cell = CellUtil.getCell(destRow, col++);
assertEquals("[Cell Formula with Reference spanning multiple rows] L7 cell type",
- CellType.FORMULA, cell.getCellTypeEnum());
+ CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula with Reference spanning multiple rows] L7 cell formula",
"G7&\" \"&G8", cell.getCellFormula());
// Cell Formula with Reference spanning multiple rows
cell = CellUtil.getCell(destRow, col++);
assertEquals("[Cell Formula with Area Reference] M7 cell type",
- CellType.FORMULA, cell.getCellTypeEnum());
+ CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula with Area Reference] M7 cell formula",
"SUM(H7:I8)", cell.getCellFormula());
System.out.println("Array formulas currently unsupported");
// FIXME: Array Formula set with Sheet.setArrayFormula() instead of cell.setFormula()
/*
- assertEquals("[Array Formula] N7 cell type", CellType.FORMULA, cell.getCellTypeEnum());
+ assertEquals("[Array Formula] N7 cell type", CellType.FORMULA, cell.getCellType());
assertEquals("[Array Formula] N7 cell formula", "{SUM(H7:J7*{1,2,3})}", cell.getCellFormula());
*/
// Data Format
cell = CellUtil.getCell(destRow, col++);
- assertEquals("[Data Format] O7 cell type;", CellType.NUMERIC, cell.getCellTypeEnum());
+ assertEquals("[Data Format] O7 cell type;", CellType.NUMERIC, cell.getCellType());
assertEquals("[Data Format] O7 cell value", 100.20, cell.getNumericCellValue(), FLOAT_PRECISION);
//FIXME: currently fails
final String moneyFormat = "\"$\"#,##0.00_);[Red]\\(\"$\"#,##0.00\\)";
// Blank
col++;
cell = CellUtil.getCell(destRow1, col);
- assertEquals("[Blank] C10 cell type", CellType.BLANK, cell.getCellTypeEnum());
+ assertEquals("[Blank] C10 cell type", CellType.BLANK, cell.getCellType());
cell = CellUtil.getCell(destRow2, col);
- assertEquals("[Blank] C11 cell type", CellType.BLANK, cell.getCellTypeEnum());
+ assertEquals("[Blank] C11 cell type", CellType.BLANK, cell.getCellType());
// Error
col++;
cell = CellUtil.getCell(destRow1, col);
- assertEquals("[Error] D10 cell type", CellType.ERROR, cell.getCellTypeEnum());
+ assertEquals("[Error] D10 cell type", CellType.ERROR, cell.getCellType());
FormulaError error = FormulaError.forInt(cell.getErrorCellValue());
assertEquals("[Error] D10 cell value", FormulaError.NA, error); //FIXME: XSSFCell and HSSFCell expose different interfaces. getErrorCellString would be helpful here
cell = CellUtil.getCell(destRow2, col);
- assertEquals("[Error] D11 cell type", CellType.ERROR, cell.getCellTypeEnum());
+ assertEquals("[Error] D11 cell type", CellType.ERROR, cell.getCellType());
error = FormulaError.forInt(cell.getErrorCellValue());
assertEquals("[Error] D11 cell value", FormulaError.NAME, error); //FIXME: XSSFCell and HSSFCell expose different interfaces. getErrorCellString would be helpful here
// Date
col++;
cell = CellUtil.getCell(destRow1, col);
- assertEquals("[Date] E10 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
+ assertEquals("[Date] E10 cell type", CellType.NUMERIC, cell.getCellType());
Date date = LocaleUtil.getLocaleCalendar(2000, Calendar.JANUARY, 1).getTime();
assertEquals("[Date] E10 cell value", date, cell.getDateCellValue());
cell = CellUtil.getCell(destRow2, col);
- assertEquals("[Date] E11 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
+ assertEquals("[Date] E11 cell type", CellType.NUMERIC, cell.getCellType());
date = LocaleUtil.getLocaleCalendar(2000, Calendar.JANUARY, 2).getTime();
assertEquals("[Date] E11 cell value", date, cell.getDateCellValue());
// Boolean
col++;
cell = CellUtil.getCell(destRow1, col);
- assertEquals("[Boolean] F10 cell type", CellType.BOOLEAN, cell.getCellTypeEnum());
+ assertEquals("[Boolean] F10 cell type", CellType.BOOLEAN, cell.getCellType());
assertEquals("[Boolean] F10 cell value", true, cell.getBooleanCellValue());
cell = CellUtil.getCell(destRow2, col);
- assertEquals("[Boolean] F11 cell type", CellType.BOOLEAN, cell.getCellTypeEnum());
+ assertEquals("[Boolean] F11 cell type", CellType.BOOLEAN, cell.getCellType());
assertEquals("[Boolean] F11 cell value", false, cell.getBooleanCellValue());
// String
col++;
cell = CellUtil.getCell(destRow1, col);
- assertEquals("[String] G10 cell type", CellType.STRING, cell.getCellTypeEnum());
+ assertEquals("[String] G10 cell type", CellType.STRING, cell.getCellType());
assertEquals("[String] G10 cell value", "Hello", cell.getStringCellValue());
cell = CellUtil.getCell(destRow2, col);
- assertEquals("[String] G11 cell type", CellType.STRING, cell.getCellTypeEnum());
+ assertEquals("[String] G11 cell type", CellType.STRING, cell.getCellType());
assertEquals("[String] G11 cell value", "World", cell.getStringCellValue());
// Int
col++;
cell = CellUtil.getCell(destRow1, col);
- assertEquals("[Int] H10 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
+ assertEquals("[Int] H10 cell type", CellType.NUMERIC, cell.getCellType());
assertEquals("[Int] H10 cell value", 15, (int) cell.getNumericCellValue());
cell = CellUtil.getCell(destRow2, col);
- assertEquals("[Int] H11 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
+ assertEquals("[Int] H11 cell type", CellType.NUMERIC, cell.getCellType());
assertEquals("[Int] H11 cell value", 42, (int) cell.getNumericCellValue());
// Float
col++;
cell = CellUtil.getCell(destRow1, col);
- assertEquals("[Float] I10 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
+ assertEquals("[Float] I10 cell type", CellType.NUMERIC, cell.getCellType());
assertEquals("[Float] I10 cell value", 12.5, cell.getNumericCellValue(), FLOAT_PRECISION);
cell = CellUtil.getCell(destRow2, col);
- assertEquals("[Float] I11 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
+ assertEquals("[Float] I11 cell type", CellType.NUMERIC, cell.getCellType());
assertEquals("[Float] I11 cell value", 5.5, cell.getNumericCellValue(), FLOAT_PRECISION);
// Cell Formula
col++;
cell = CellUtil.getCell(destRow1, col);
- assertEquals("[Cell Formula] J10 cell type", CellType.FORMULA, cell.getCellTypeEnum());
+ assertEquals("[Cell Formula] J10 cell type", CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula] J10 cell formula", "5+2", cell.getCellFormula());
cell = CellUtil.getCell(destRow2, col);
- assertEquals("[Cell Formula] J11 cell type", CellType.FORMULA, cell.getCellTypeEnum());
+ assertEquals("[Cell Formula] J11 cell type", CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula] J11 cell formula", "6+18", cell.getCellFormula());
// Cell Formula with Reference
// Formula row references should be adjusted by destRowNum-srcRowNum
cell = CellUtil.getCell(destRow1, col);
assertEquals("[Cell Formula with Reference] K10 cell type",
- CellType.FORMULA, cell.getCellTypeEnum());
+ CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula with Reference] K10 cell formula",
"J10+H$2", cell.getCellFormula());
cell = CellUtil.getCell(destRow2, col);
- assertEquals("[Cell Formula with Reference] K11 cell type", CellType.FORMULA, cell.getCellTypeEnum());
+ assertEquals("[Cell Formula with Reference] K11 cell type", CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula with Reference] K11 cell formula", "J11+H$2", cell.getCellFormula());
// Cell Formula with Reference spanning multiple rows
col++;
cell = CellUtil.getCell(destRow1, col);
assertEquals("[Cell Formula with Reference spanning multiple rows] L10 cell type",
- CellType.FORMULA, cell.getCellTypeEnum());
+ CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula with Reference spanning multiple rows] L10 cell formula",
"G10&\" \"&G11", cell.getCellFormula());
cell = CellUtil.getCell(destRow2, col);
assertEquals("[Cell Formula with Reference spanning multiple rows] L11 cell type",
- CellType.FORMULA, cell.getCellTypeEnum());
+ CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula with Reference spanning multiple rows] L11 cell formula",
"G11&\" \"&G12", cell.getCellFormula());
col++;
cell = CellUtil.getCell(destRow1, col);
assertEquals("[Cell Formula with Area Reference] M10 cell type",
- CellType.FORMULA, cell.getCellTypeEnum());
+ CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula with Area Reference] M10 cell formula",
"SUM(H10:I11)", cell.getCellFormula());
cell = CellUtil.getCell(destRow2, col);
assertEquals("[Cell Formula with Area Reference] M11 cell type",
- CellType.FORMULA, cell.getCellTypeEnum());
+ CellType.FORMULA, cell.getCellType());
assertEquals("[Cell Formula with Area Reference] M11 cell formula",
"SUM($H$3:I10)", cell.getCellFormula()); //Also acceptable: SUM($H10:I$3), but this AreaReference isn't in ascending order
// System.out.println("Array formulas currently unsupported");
/*
// FIXME: Array Formula set with Sheet.setArrayFormula() instead of cell.setFormula()
- assertEquals("[Array Formula] N10 cell type", CellType.FORMULA, cell.getCellTypeEnum());
+ assertEquals("[Array Formula] N10 cell type", CellType.FORMULA, cell.getCellType());
assertEquals("[Array Formula] N10 cell formula", "{SUM(H10:J10*{1,2,3})}", cell.getCellFormula());
cell = CellUtil.getCell(destRow2, col);
// FIXME: Array Formula set with Sheet.setArrayFormula() instead of cell.setFormula()
- assertEquals("[Array Formula] N11 cell type", CellType.FORMULA, cell.getCellTypeEnum());
+ assertEquals("[Array Formula] N11 cell type", CellType.FORMULA, cell.getCellType());
assertEquals("[Array Formula] N11 cell formula", "{SUM(H11:J11*{1,2,3})}", cell.getCellFormula());
*/
// Data Format
col++;
cell = CellUtil.getCell(destRow2, col);
- assertEquals("[Data Format] O10 cell type", CellType.NUMERIC, cell.getCellTypeEnum());
+ assertEquals("[Data Format] O10 cell type", CellType.NUMERIC, cell.getCellType());
assertEquals("[Data Format] O10 cell value", 100.20, cell.getNumericCellValue(), FLOAT_PRECISION);
final String moneyFormat = "\"$\"#,##0.00_);[Red]\\(\"$\"#,##0.00\\)";
assertEquals("[Data Format] O10 cell data format", moneyFormat, cell.getCellStyle().getDataFormatString());