From 1092f2434ea4ec029e81ba7d4df55718aa0b35d5 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Fri, 10 Jun 2016 04:57:04 +0000 Subject: [PATCH] ooxml o.a.p.ss.formula.TestFormulaParser junit3 -> junit4 git-svn-id: https://svn.apache.org/repos/asf/poi/branches/xssf_structured_references@1747633 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/ss/formula/TestFormulaParser.java | 15 +++++++++++++-- .../org/apache/poi/hssf/model/AllModelTests.java | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/ooxml/testcases/org/apache/poi/ss/formula/TestFormulaParser.java b/src/ooxml/testcases/org/apache/poi/ss/formula/TestFormulaParser.java index 9987dcf42a..9f40ca363a 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/formula/TestFormulaParser.java +++ b/src/ooxml/testcases/org/apache/poi/ss/formula/TestFormulaParser.java @@ -18,6 +18,11 @@ */ package org.apache.poi.ss.formula; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import org.apache.poi.hssf.usermodel.HSSFEvaluationWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.formula.ptg.AbstractFunctionPtg; @@ -28,7 +33,7 @@ import org.apache.poi.xssf.XSSFTestDataSamples; import org.apache.poi.xssf.usermodel.XSSFEvaluationWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import junit.framework.TestCase; +import org.junit.Test; /** * Test {@link FormulaParser}'s handling of row numbers at the edge of the @@ -36,8 +41,9 @@ import junit.framework.TestCase; * * @author David North */ -public class TestFormulaParser extends TestCase { +public class TestFormulaParser { + @Test public void testHSSFFailsForOver65536() { FormulaParsingWorkbook workbook = HSSFEvaluationWorkbook.create(new HSSFWorkbook()); try { @@ -49,16 +55,19 @@ public class TestFormulaParser extends TestCase { } } + @Test public void testHSSFPassCase() { FormulaParsingWorkbook workbook = HSSFEvaluationWorkbook.create(new HSSFWorkbook()); FormulaParser.parse("Sheet1!1:65536", workbook, FormulaType.CELL, 0); } + @Test public void testXSSFWorksForOver65536() { FormulaParsingWorkbook workbook = XSSFEvaluationWorkbook.create(new XSSFWorkbook()); FormulaParser.parse("Sheet1!1:65537", workbook, FormulaType.CELL, 0); } + @Test public void testXSSFFailCase() { FormulaParsingWorkbook workbook = XSSFEvaluationWorkbook.create(new XSSFWorkbook()); try { @@ -71,6 +80,7 @@ public class TestFormulaParser extends TestCase { } // copied from org.apache.poi.hssf.model.TestFormulaParser + @Test public void testMacroFunction() throws Exception { // testNames.xlsm contains a VB function called 'myFunc' final String testFile = "testNames.xlsm"; @@ -126,6 +136,7 @@ public class TestFormulaParser extends TestCase { } } + @Test public void testParserErrors() throws Exception { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("testNames.xlsm"); try { diff --git a/src/testcases/org/apache/poi/hssf/model/AllModelTests.java b/src/testcases/org/apache/poi/hssf/model/AllModelTests.java index 0d140ab7d3..bca29c74f9 100644 --- a/src/testcases/org/apache/poi/hssf/model/AllModelTests.java +++ b/src/testcases/org/apache/poi/hssf/model/AllModelTests.java @@ -27,7 +27,7 @@ import org.junit.runners.Suite; @Suite.SuiteClasses({ TestDrawingManager.class, TestDrawingManager2.class, - TestFormulaParser.class, + //TestFormulaParser.class, //converted to junit4 TestFormulaParserEval.class, TestFormulaParserIf.class, TestLinkTable.class, -- 2.39.5