aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
authorVladislav Galas <gallon@apache.org>2019-01-26 19:41:10 +0000
committerVladislav Galas <gallon@apache.org>2019-01-26 19:41:10 +0000
commit19bf8b23d5dacee226c70cece3a315e5f1e47616 (patch)
treeb0cf586e8bb6cd341391518c7640d1912e826b43 /src/testcases
parentd60cb3a18c18b958998f066dc3591bc81dd85b3d (diff)
downloadpoi-19bf8b23d5dacee226c70cece3a315e5f1e47616.tar.gz
poi-19bf8b23d5dacee226c70cece3a315e5f1e47616.zip
purged calls to cell.setCellType(CellType.BLANK) from the project, replaced with setBlank()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1852245 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r--src/testcases/org/apache/poi/hssf/record/TestSharedFormulaRecord.java2
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java2
-rw-r--r--src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java6
-rw-r--r--src/testcases/org/apache/poi/ss/formula/atp/TestRandBetween.java4
-rw-r--r--src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java12
5 files changed, 13 insertions, 13 deletions
diff --git a/src/testcases/org/apache/poi/hssf/record/TestSharedFormulaRecord.java b/src/testcases/org/apache/poi/hssf/record/TestSharedFormulaRecord.java
index fd8a9c03a7..b061221fb4 100644
--- a/src/testcases/org/apache/poi/hssf/record/TestSharedFormulaRecord.java
+++ b/src/testcases/org/apache/poi/hssf/record/TestSharedFormulaRecord.java
@@ -204,7 +204,7 @@ public final class TestSharedFormulaRecord extends TestCase {
assertEquals("A$1*2", sheet.getRow(ROW_IX).getCell(1).getCellFormula());
cell = sheet.getRow(ROW_IX).getCell(1);
- cell.setCellType(CellType.BLANK);
+ cell.setBlank();
assertEquals(3, countSharedFormulas(sheet));
wb = HSSFTestDataSamples.writeOutAndReadBack(wb);
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java
index b4200df087..5f37ad44fd 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java
@@ -436,7 +436,7 @@ public final class TestHSSFCell extends BaseTestCell {
Row row = sheet.createRow(0);
Cell cell = row.createCell(0);
- cell.setCellType(CellType.BLANK);
+ cell.setBlank();
assertNull(null, cell.getDateCellValue());
assertFalse(cell.getBooleanCellValue());
assertEquals("", cell.toString());
diff --git a/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java b/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java
index db6d96c77f..c2abe42e24 100644
--- a/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java
+++ b/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java
@@ -232,14 +232,14 @@ public class TestEvaluationCache extends TestCase {
public void setCellValue(String cellRefText, double value) {
HSSFCell cell = getOrCreateCell(cellRefText);
// be sure to blank cell, in case it is currently a formula
- cell.setCellType(CellType.BLANK);
+ cell.setBlank();
// otherwise this line will only set the formula cached result;
cell.setCellValue(value);
_evaluator.notifyUpdateCell(wrapCell(cell));
}
public void clearCell(String cellRefText) {
HSSFCell cell = getOrCreateCell(cellRefText);
- cell.setCellType(CellType.BLANK);
+ cell.setBlank();
_evaluator.notifyUpdateCell(wrapCell(cell));
}
@@ -606,7 +606,7 @@ public class TestEvaluationCache extends TestCase {
cv = fe.evaluate(cellA1);
assertEquals(3.7, cv.getNumberValue(), 0.0);
- cellB1.setCellType(CellType.BLANK);
+ cellB1.setBlank();
fe.notifyUpdateCell(cellB1);
cv = fe.evaluate(cellA1); // B1 was used to evaluate A1
assertEquals(2.2, cv.getNumberValue(), 0.0);
diff --git a/src/testcases/org/apache/poi/ss/formula/atp/TestRandBetween.java b/src/testcases/org/apache/poi/ss/formula/atp/TestRandBetween.java
index 206d17016d..5a922080c0 100644
--- a/src/testcases/org/apache/poi/ss/formula/atp/TestRandBetween.java
+++ b/src/testcases/org/apache/poi/ss/formula/atp/TestRandBetween.java
@@ -119,7 +119,7 @@ public class TestRandBetween extends TestCase {
public void testRandBetweenTopBlank() {
bottomValueCell.setCellValue(-1);
- topValueCell.setCellType(CellType.BLANK);
+ topValueCell.setBlank();
formulaCell.setCellFormula("RANDBETWEEN($A$1,$B$1)");
evaluator.clearAllCachedResultValues();
evaluator.evaluateFormulaCell(formulaCell);
@@ -174,7 +174,7 @@ public class TestRandBetween extends TestCase {
assertEquals(CellType.ERROR, formulaCell.getCachedFormulaResultType());
assertEquals(ErrorEval.NUM_ERROR.getErrorCode(), formulaCell.getErrorCellValue());
bottomValueCell.setCellValue(1);
- topValueCell.setCellType(CellType.BLANK);
+ topValueCell.setBlank();
formulaCell.setCellFormula("RANDBETWEEN($A$1,$B$1)");
evaluator.clearAllCachedResultValues();
evaluator.evaluateFormulaCell(formulaCell);
diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
index 94a003dcb1..3190c62f03 100644
--- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
+++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java
@@ -642,7 +642,7 @@ public abstract class BaseTestCell {
}
/**
- * Make sure that cell.setCellType(CellType.BLANK) preserves the cell style
+ * Make sure that cell.setBlank() preserves the cell style
*/
@Test
public void testSetBlank_bug47028() throws Exception {
@@ -651,7 +651,7 @@ public abstract class BaseTestCell {
Cell cell = wb.createSheet("Sheet1").createRow(0).createCell(0);
cell.setCellStyle(style);
int i1 = cell.getCellStyle().getIndex();
- cell.setCellType(CellType.BLANK);
+ cell.setBlank();
int i2 = cell.getCellStyle().getIndex();
assertEquals(i1, i2);
wb.close();
@@ -1219,7 +1219,7 @@ public abstract class BaseTestCell {
@Test
- public void setCellType_BLANK_removesArrayFormula_ifCellIsPartOfAnArrayFormulaGroupContainingOnlyThisCell() {
+ public void setBlank_removesArrayFormula_ifCellIsPartOfAnArrayFormulaGroupContainingOnlyThisCell() {
Cell cell = getInstance();
cell.getSheet().setArrayFormula("1", CellRangeAddress.valueOf("A1"));
@@ -1227,18 +1227,18 @@ public abstract class BaseTestCell {
assertTrue(cell.isPartOfArrayFormulaGroup());
assertEquals("1", cell.getCellFormula());
- cell.setCellType(CellType.BLANK);
+ cell.setBlank();
assertEquals(CellType.BLANK, cell.getCellType());
assertFalse(cell.isPartOfArrayFormulaGroup());
}
@Test(expected = IllegalStateException.class)
- public void setCellType_BLANK_throwsISE_ifCellIsPartOfAnArrayFormulaGroupContainingOtherCells() {
+ public void setBlank_throwsISE_ifCellIsPartOfAnArrayFormulaGroupContainingOtherCells() {
Cell cell = getInstance();
cell.getSheet().setArrayFormula("1", CellRangeAddress.valueOf("A1:B1"));
cell.setCellValue("foo");
- cell.setCellType(CellType.BLANK);
+ cell.setBlank();
}
@Test(expected = IllegalStateException.class)