You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by on...@apache.org on 2016/07/04 10:15:19 UTC
svn commit: r1751240 [3/3] - in /poi/trunk/src:
examples/src/org/apache/poi/hssf/usermodel/examples/
examples/src/org/apache/poi/hssf/view/
examples/src/org/apache/poi/ss/examples/ java/org/apache/poi/hssf/record/
java/org/apache/poi/hssf/usermodel/ ja...
Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestNper.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestNper.java?rev=1751240&r1=1751239&r2=1751240&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestNper.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestNper.java Mon Jul 4 10:15:18 2016
@@ -27,6 +27,7 @@ import org.apache.poi.hssf.usermodel.HSS
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval;
+import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.FormulaError;
import org.junit.Test;
@@ -57,12 +58,12 @@ public final class TestNper {
cell.setCellFormula("NPER(12,4500,100000,100000)");
cell.setCellValue(15.0);
assertEquals("NPER(12,4500,100000,100000)", cell.getCellFormula());
- assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cell.getCachedFormulaResultType());
+ assertEquals(CellType.NUMERIC, cell.getCachedFormulaResultType());
assertEquals(15.0, cell.getNumericCellValue(), 0.0);
HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
fe.evaluateFormulaCell(cell);
- assertEquals(HSSFCell.CELL_TYPE_ERROR, cell.getCachedFormulaResultType());
+ assertEquals(CellType.ERROR, cell.getCachedFormulaResultType());
assertEquals(FormulaError.NUM.getCode(), cell.getErrorCellValue());
wb.close();
}
Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/udf/TestAggregatingUDFFinder.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/udf/TestAggregatingUDFFinder.java?rev=1751240&r1=1751239&r2=1751240&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/udf/TestAggregatingUDFFinder.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/udf/TestAggregatingUDFFinder.java Mon Jul 4 10:15:18 2016
@@ -16,11 +16,7 @@
==================================================================== */
package org.apache.poi.ss.formula.udf;
-import static org.junit.Assert.assertNotNull;
-
import org.apache.poi.ss.formula.atp.AnalysisToolPak;
-import org.apache.poi.ss.formula.functions.FreeRefFunction;
-
import org.junit.Test;
public class TestAggregatingUDFFinder extends BaseTestUDFFinder {
Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/udf/TestDefaultUDFFinder.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/udf/TestDefaultUDFFinder.java?rev=1751240&r1=1751239&r2=1751240&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/udf/TestDefaultUDFFinder.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/udf/TestDefaultUDFFinder.java Mon Jul 4 10:15:18 2016
@@ -16,10 +16,7 @@
==================================================================== */
package org.apache.poi.ss.formula.udf;
-import static org.junit.Assert.assertNotNull;
-
import org.apache.poi.ss.formula.functions.FreeRefFunction;
-
import org.junit.Test;
public class TestDefaultUDFFinder extends BaseTestUDFFinder {
Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java?rev=1751240&r1=1751239&r2=1751240&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java Mon Jul 4 10:15:18 2016
@@ -672,17 +672,17 @@ public abstract class BaseTestCell {
Cell cell0 = row.createCell(0);
cell0.setCellValue(Double.NaN);
- assertEquals("Double.NaN should change cell type to CELL_TYPE_ERROR", CellType.ERROR, cell0.getCellType());
+ assertEquals("Double.NaN should change cell type to CellType#ERROR", CellType.ERROR, cell0.getCellType());
assertEquals("Double.NaN should change cell value to #NUM!", FormulaError.NUM, forInt(cell0.getErrorCellValue()));
Cell cell1 = row.createCell(1);
cell1.setCellValue(Double.POSITIVE_INFINITY);
- assertEquals("Double.POSITIVE_INFINITY should change cell type to CELL_TYPE_ERROR", CellType.ERROR, cell1.getCellType());
+ assertEquals("Double.POSITIVE_INFINITY should change cell type to CellType#ERROR", CellType.ERROR, cell1.getCellType());
assertEquals("Double.POSITIVE_INFINITY should change cell value to #DIV/0!", FormulaError.DIV0, forInt(cell1.getErrorCellValue()));
Cell cell2 = row.createCell(2);
cell2.setCellValue(Double.NEGATIVE_INFINITY);
- assertEquals("Double.NEGATIVE_INFINITY should change cell type to CELL_TYPE_ERROR", CellType.ERROR, cell2.getCellType());
+ assertEquals("Double.NEGATIVE_INFINITY should change cell type to CellType#ERROR", CellType.ERROR, cell2.getCellType());
assertEquals("Double.NEGATIVE_INFINITY should change cell value to #DIV/0!", FormulaError.DIV0, forInt(cell2.getErrorCellValue()));
Workbook wb2 = _testDataProvider.writeOutAndReadBack(wb1);
Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java?rev=1751240&r1=1751239&r2=1751240&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java Mon Jul 4 10:15:18 2016
@@ -252,40 +252,40 @@ public abstract class BaseTestRow {
// 5 -> num
row.createCell(0).setCellValue("test");
row.createCell(1).setCellValue(3.2);
- row.createCell(4, Cell.CELL_TYPE_BLANK);
+ row.createCell(4, CellType.BLANK);
row.createCell(5).setCellValue(4);
// First up, no policy given, uses default
- assertEquals(Cell.CELL_TYPE_STRING, row.getCell(0).getCellType());
- assertEquals(Cell.CELL_TYPE_NUMERIC, row.getCell(1).getCellType());
+ assertEquals(CellType.STRING, row.getCell(0).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(1).getCellType());
assertEquals(null, row.getCell(2));
assertEquals(null, row.getCell(3));
- assertEquals(Cell.CELL_TYPE_BLANK, row.getCell(4).getCellType());
- assertEquals(Cell.CELL_TYPE_NUMERIC, row.getCell(5).getCellType());
+ assertEquals(CellType.BLANK, row.getCell(4).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(5).getCellType());
// RETURN_NULL_AND_BLANK - same as default
- assertEquals(Cell.CELL_TYPE_STRING, row.getCell(0, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
- assertEquals(Cell.CELL_TYPE_NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
+ assertEquals(CellType.STRING, row.getCell(0, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
assertEquals(null, row.getCell(2, MissingCellPolicy.RETURN_NULL_AND_BLANK));
assertEquals(null, row.getCell(3, MissingCellPolicy.RETURN_NULL_AND_BLANK));
- assertEquals(Cell.CELL_TYPE_BLANK, row.getCell(4, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
- assertEquals(Cell.CELL_TYPE_NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
+ assertEquals(CellType.BLANK, row.getCell(4, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_NULL_AND_BLANK).getCellType());
// RETURN_BLANK_AS_NULL - nearly the same
- assertEquals(Cell.CELL_TYPE_STRING, row.getCell(0, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
- assertEquals(Cell.CELL_TYPE_NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
+ assertEquals(CellType.STRING, row.getCell(0, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
assertEquals(null, row.getCell(2, MissingCellPolicy.RETURN_BLANK_AS_NULL));
assertEquals(null, row.getCell(3, MissingCellPolicy.RETURN_BLANK_AS_NULL));
assertEquals(null, row.getCell(4, MissingCellPolicy.RETURN_BLANK_AS_NULL));
- assertEquals(Cell.CELL_TYPE_NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.RETURN_BLANK_AS_NULL).getCellType());
// CREATE_NULL_AS_BLANK - creates as needed
- assertEquals(Cell.CELL_TYPE_STRING, row.getCell(0, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
- assertEquals(Cell.CELL_TYPE_NUMERIC, row.getCell(1, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
- assertEquals(Cell.CELL_TYPE_BLANK, row.getCell(2, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
- assertEquals(Cell.CELL_TYPE_BLANK, row.getCell(3, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
- assertEquals(Cell.CELL_TYPE_BLANK, row.getCell(4, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
- assertEquals(Cell.CELL_TYPE_NUMERIC, row.getCell(5, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+ assertEquals(CellType.STRING, row.getCell(0, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(1, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+ assertEquals(CellType.BLANK, row.getCell(2, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+ assertEquals(CellType.BLANK, row.getCell(3, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+ assertEquals(CellType.BLANK, row.getCell(4, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(5, MissingCellPolicy.CREATE_NULL_AS_BLANK).getCellType());
// Check created ones get the right column
assertEquals(0, row.getCell(0, MissingCellPolicy.CREATE_NULL_AS_BLANK).getColumnIndex());
@@ -300,12 +300,12 @@ public abstract class BaseTestRow {
// that that is now used if no policy given
workbook.setMissingCellPolicy(MissingCellPolicy.RETURN_BLANK_AS_NULL);
- assertEquals(Cell.CELL_TYPE_STRING, row.getCell(0).getCellType());
- assertEquals(Cell.CELL_TYPE_NUMERIC, row.getCell(1).getCellType());
+ assertEquals(CellType.STRING, row.getCell(0).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(1).getCellType());
assertEquals(null, row.getCell(2));
assertEquals(null, row.getCell(3));
assertEquals(null, row.getCell(4));
- assertEquals(Cell.CELL_TYPE_NUMERIC, row.getCell(5).getCellType());
+ assertEquals(CellType.NUMERIC, row.getCell(5).getCellType());
workbook.close();
}
@@ -409,7 +409,7 @@ public abstract class BaseTestRow {
assertFalse(it.hasNext());
// Add another cell, specifying the cellType
- Cell cell5 = row.createCell(2, Cell.CELL_TYPE_STRING);
+ Cell cell5 = row.createCell(2, CellType.STRING);
it = row.cellIterator();
assertNotNull(cell5);
assertTrue(it.hasNext());
@@ -420,7 +420,7 @@ public abstract class BaseTestRow {
assertTrue(cell5 == it.next());
assertTrue(it.hasNext());
assertTrue(cell2 == it.next());
- assertEquals(Cell.CELL_TYPE_STRING, cell5.getCellType());
+ assertEquals(CellType.STRING, cell5.getCellType());
wb.close();
}
Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java?rev=1751240&r1=1751239&r2=1751240&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java Mon Jul 4 10:15:18 2016
@@ -344,7 +344,7 @@ public abstract class BaseTestSheetAutos
Sheet sheet = workbook.getSheetAt(i);
for (Row r : sheet) {
for (Cell c : r) {
- if (c.getCellType() == Cell.CELL_TYPE_FORMULA){
+ if (c.getCellType() == CellType.FORMULA){
eval.evaluateFormulaCell(c);
}
}
Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java?rev=1751240&r1=1751239&r2=1751240&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java Mon Jul 4 10:15:18 2016
@@ -318,7 +318,7 @@ public abstract class BaseTestSheetShift
Row row = sheet.createRow(i);
for (int j = 0; j < 10; j++) {
- Cell cell = row.createCell(j, Cell.CELL_TYPE_STRING);
+ Cell cell = row.createCell(j, CellType.STRING);
cell.setCellValue(i + "x" + j);
}
}
Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java?rev=1751240&r1=1751239&r2=1751240&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java Mon Jul 4 10:15:18 2016
@@ -133,7 +133,7 @@ public abstract class BaseTestSheetUpdat
for(Cell acell : cells){
assertTrue(acell.isPartOfArrayFormulaGroup());
- assertEquals(Cell.CELL_TYPE_FORMULA, acell.getCellType());
+ assertEquals(CellType.FORMULA, acell.getCellType());
assertEquals("SUM(A1:A3*B1:B3)", acell.getCellFormula());
//retrieve the range and check it is the same
assertEquals(range.formatAsString(), acell.getArrayFormulaRange().formatAsString());
@@ -210,7 +210,7 @@ public abstract class BaseTestSheetUpdat
for(Cell acell : cr){
assertFalse(acell.isPartOfArrayFormulaGroup());
- assertEquals(Cell.CELL_TYPE_BLANK, acell.getCellType());
+ assertEquals(CellType.BLANK, acell.getCellType());
}
// cells C4:C6 are not included in array formula,
@@ -279,7 +279,7 @@ public abstract class BaseTestSheetUpdat
CellRange<? extends Cell> srange =
sheet.setArrayFormula("SUM(A4:A6,B4:B6)", CellRangeAddress.valueOf("B5"));
Cell scell = srange.getTopLeftCell();
- assertEquals(Cell.CELL_TYPE_FORMULA, scell.getCellType());
+ assertEquals(CellType.FORMULA, scell.getCellType());
assertEquals(0.0, scell.getNumericCellValue(), 0);
scell.setCellValue(1.1);
assertEquals(1.1, scell.getNumericCellValue(), 0);
@@ -288,7 +288,7 @@ public abstract class BaseTestSheetUpdat
CellRange<? extends Cell> mrange =
sheet.setArrayFormula("A1:A3*B1:B3", CellRangeAddress.valueOf("C1:C3"));
for(Cell mcell : mrange){
- assertEquals(Cell.CELL_TYPE_FORMULA, mcell.getCellType());
+ assertEquals(CellType.FORMULA, mcell.getCellType());
assertEquals(0.0, mcell.getNumericCellValue(), 0);
double fmlaResult = 1.2;
mcell.setCellValue(fmlaResult);
@@ -307,10 +307,10 @@ public abstract class BaseTestSheetUpdat
CellRange<? extends Cell> srange =
sheet.setArrayFormula("SUM(A4:A6,B4:B6)", CellRangeAddress.valueOf("B5"));
Cell scell = srange.getTopLeftCell();
- assertEquals(Cell.CELL_TYPE_FORMULA, scell.getCellType());
+ assertEquals(CellType.FORMULA, scell.getCellType());
assertEquals(0.0, scell.getNumericCellValue(), 0);
- scell.setCellType(Cell.CELL_TYPE_STRING);
- assertEquals(Cell.CELL_TYPE_STRING, scell.getCellType());
+ scell.setCellType(CellType.STRING);
+ assertEquals(CellType.STRING, scell.getCellType());
scell.setCellValue("string cell");
assertEquals("string cell", scell.getStringCellValue());
@@ -319,8 +319,8 @@ public abstract class BaseTestSheetUpdat
sheet.setArrayFormula("A1:A3*B1:B3", CellRangeAddress.valueOf("C1:C3"));
for(Cell mcell : mrange){
try {
- assertEquals(Cell.CELL_TYPE_FORMULA, mcell.getCellType());
- mcell.setCellType(Cell.CELL_TYPE_NUMERIC);
+ assertEquals(CellType.FORMULA, mcell.getCellType());
+ mcell.setCellType(CellType.NUMERIC);
fail("expected exception");
} catch (IllegalStateException e){
CellReference ref = new CellReference(mcell);
@@ -329,7 +329,7 @@ public abstract class BaseTestSheetUpdat
}
// a failed invocation of Cell.setCellType leaves the cell
// in the state that it was in prior to the invocation
- assertEquals(Cell.CELL_TYPE_FORMULA, mcell.getCellType());
+ assertEquals(CellType.FORMULA, mcell.getCellType());
assertTrue(mcell.isPartOfArrayFormulaGroup());
}
workbook.close();
@@ -344,13 +344,13 @@ public abstract class BaseTestSheetUpdat
sheet.setArrayFormula("SUM(A4:A6,B4:B6)", CellRangeAddress.valueOf("B5"));
Cell scell = srange.getTopLeftCell();
assertEquals("SUM(A4:A6,B4:B6)", scell.getCellFormula());
- assertEquals(Cell.CELL_TYPE_FORMULA, scell.getCellType());
+ assertEquals(CellType.FORMULA, scell.getCellType());
assertTrue(scell.isPartOfArrayFormulaGroup());
scell.setCellFormula("SUM(A4,A6)");
//we are now a normal formula cell
assertEquals("SUM(A4,A6)", scell.getCellFormula());
assertFalse(scell.isPartOfArrayFormulaGroup());
- assertEquals(Cell.CELL_TYPE_FORMULA, scell.getCellType());
+ assertEquals(CellType.FORMULA, scell.getCellType());
//check that setting formula result works
assertEquals(0.0, scell.getNumericCellValue(), 0);
scell.setCellValue(33.0);
@@ -396,7 +396,7 @@ public abstract class BaseTestSheetUpdat
//re-create the removed cell
scell = srow.createCell(cra.getFirstColumn());
- assertEquals(Cell.CELL_TYPE_BLANK, scell.getCellType());
+ assertEquals(CellType.BLANK, scell.getCellType());
assertFalse(scell.isPartOfArrayFormulaGroup());
//we cannot remove cells included in a multi-cell array formula
@@ -417,7 +417,7 @@ public abstract class BaseTestSheetUpdat
// in the state that it was in prior to the invocation
assertSame(mcell, mrow.getCell(columnIndex));
assertTrue(mcell.isPartOfArrayFormulaGroup());
- assertEquals(Cell.CELL_TYPE_FORMULA, mcell.getCellType());
+ assertEquals(CellType.FORMULA, mcell.getCellType());
}
workbook.close();
@@ -433,7 +433,7 @@ public abstract class BaseTestSheetUpdat
CellRange<? extends Cell> srange =
sheet.setArrayFormula("SUM(A4:A6,B4:B6)", cra);
Cell scell = srange.getTopLeftCell();
- assertEquals(Cell.CELL_TYPE_FORMULA, scell.getCellType());
+ assertEquals(CellType.FORMULA, scell.getCellType());
Row srow = scell.getRow();
assertSame(srow, sheet.getRow(cra.getFirstRow()));
@@ -442,7 +442,7 @@ public abstract class BaseTestSheetUpdat
//re-create the removed row and cell
scell = sheet.createRow(cra.getFirstRow()).createCell(cra.getFirstColumn());
- assertEquals(Cell.CELL_TYPE_BLANK, scell.getCellType());
+ assertEquals(CellType.BLANK, scell.getCellType());
assertFalse(scell.isPartOfArrayFormulaGroup());
//we cannot remove rows with cells included in a multi-cell array formula
@@ -463,7 +463,7 @@ public abstract class BaseTestSheetUpdat
assertSame(mrow, sheet.getRow(mrow.getRowNum()));
assertSame(mcell, mrow.getCell(columnIndex));
assertTrue(mcell.isPartOfArrayFormulaGroup());
- assertEquals(Cell.CELL_TYPE_FORMULA, mcell.getCellType());
+ assertEquals(CellType.FORMULA, mcell.getCellType());
}
workbook.close();
@@ -481,7 +481,7 @@ public abstract class BaseTestSheetUpdat
Cell scell = srange.getTopLeftCell();
sheet.addMergedRegion(CellRangeAddress.valueOf("B5:C6"));
//we are still an array formula
- assertEquals(Cell.CELL_TYPE_FORMULA, scell.getCellType());
+ assertEquals(CellType.FORMULA, scell.getCellType());
assertTrue(scell.isPartOfArrayFormulaGroup());
assertEquals(1, sheet.getNumMergedRegions());
@@ -570,7 +570,7 @@ public abstract class BaseTestSheetUpdat
assertEquals(cra.formatAsString(), mcell.getArrayFormulaRange().formatAsString());
assertEquals("A2:A4*B2:B4", mcell.getCellFormula());
assertTrue(mcell.isPartOfArrayFormulaGroup());
- assertEquals(Cell.CELL_TYPE_FORMULA, mcell.getCellType());
+ assertEquals(CellType.FORMULA, mcell.getCellType());
}
*/
Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java?rev=1751240&r1=1751239&r2=1751240&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java Mon Jul 4 10:15:18 2016
@@ -583,7 +583,7 @@ public class TestDataFormatter {
try {
Sheet s = wb.createSheet();
Row r = s.createRow(0);
- Cell c = r.createCell(0, Cell.CELL_TYPE_ERROR);
+ Cell c = r.createCell(0, CellType.ERROR);
c.setCellErrorValue(FormulaError.DIV0.getCode());
assertEquals(FormulaError.DIV0.getString(), dfUS.formatCellValue(c));
Modified: poi/trunk/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java?rev=1751240&r1=1751239&r2=1751240&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/util/TestSheetBuilder.java Mon Jul 4 10:15:18 2016
@@ -19,13 +19,14 @@ package org.apache.poi.ss.util;
import java.util.Date;
-import junit.framework.TestCase;
-
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+
+import junit.framework.TestCase;
/**
* Tests SheetBuilder.
@@ -49,7 +50,7 @@ public final class TestSheetBuilder exte
Row firstRow = sheet.getRow(0);
Cell firstCell = firstRow.getCell(0);
- assertEquals(firstCell.getCellType(), Cell.CELL_TYPE_NUMERIC);
+ assertEquals(firstCell.getCellType(), CellType.NUMERIC);
assertEquals(1.0, firstCell.getNumericCellValue(), 0.00001);
@@ -58,11 +59,11 @@ public final class TestSheetBuilder exte
assertNull(secondRow.getCell(2));
Row thirdRow = sheet.getRow(2);
- assertEquals(Cell.CELL_TYPE_STRING, thirdRow.getCell(0).getCellType());
+ assertEquals(CellType.STRING, thirdRow.getCell(0).getCellType());
String cellValue = thirdRow.getCell(0).getStringCellValue();
assertEquals(testData[2][0].toString(), cellValue);
- assertEquals(Cell.CELL_TYPE_FORMULA, thirdRow.getCell(2).getCellType());
+ assertEquals(CellType.FORMULA, thirdRow.getCell(2).getCellType());
assertEquals("A1+B2", thirdRow.getCell(2).getCellFormula());
}
@@ -72,7 +73,7 @@ public final class TestSheetBuilder exte
Cell emptyCell = sheet.getRow(1).getCell(1);
assertNotNull(emptyCell);
- assertEquals(Cell.CELL_TYPE_BLANK, emptyCell.getCellType());
+ assertEquals(CellType.BLANK, emptyCell.getCellType());
}
public void testSheetName() {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org