From e43cbf5d46424942112e82f8573ae3c2a5823fee Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 27 Jun 2020 09:53:11 +0000 Subject: try to fix test compile git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879256 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/util/TestAreaReference.java | 4 +--- .../org/apache/poi/ss/usermodel/BaseTestWorkbook.java | 12 ++++++------ 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/testcases/org/apache/poi') diff --git a/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java b/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java index 0870a011cc..fddd1e7603 100644 --- a/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java +++ b/src/testcases/org/apache/poi/hssf/util/TestAreaReference.java @@ -248,9 +248,7 @@ public final class TestAreaReference { assertEquals(ref, HSSFFormulaParser.toFormulaString(wb, nr.getNameDefinition())); // Check the high level definition - int idx = wb.getNameIndex("test"); - assertEquals(0, idx); - HSSFName aNamedCell = wb.getNameAt(idx); + HSSFName aNamedCell = wb.getName("test"); // Should have 2 references String formulaRefs = aNamedCell.getRefersToFormula(); diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java index 6ad3e2e5dd..6ab7dd52d1 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java @@ -687,9 +687,9 @@ public abstract class BaseTestWorkbook { Sheet sh1 = wb1.getSheetAt(0); - Name sale_2 = wb1.getNameAt(1); - Name sale_3 = wb1.getNameAt(2); - Name sale_4 = wb1.getNameAt(3); + Name sale_2 = wb1.getName("sale_2"); + Name sale_3 = wb1.getName("sale_3"); + Name sale_4 = wb1.getName("sale_4"); assertEquals("sale_2", sale_2.getNameName()); assertEquals("'Testing 47100'!$A$1", sale_2.getRefersToFormula()); @@ -736,9 +736,9 @@ public abstract class BaseTestWorkbook { sh1 = wb2.getSheetAt(0); - sale_2 = wb2.getNameAt(1); - sale_3 = wb2.getNameAt(2); - sale_4 = wb2.getNameAt(3); + sale_2 = wb2.getName("sale_2"); + sale_3 = wb2.getName("sale_3"); + sale_4 = wb2.getName("sale_4"); cell0 = sh1.getRow(0).getCell(0); cell1 = sh1.getRow(1).getCell(0); -- cgit v1.2.3