]> source.dussan.org Git - poi.git/commitdiff
ooxml o.a.p.ss.formula.TestFormulaParser junit3 -> junit4
authorJaven O'Neal <onealj@apache.org>
Fri, 10 Jun 2016 04:57:04 +0000 (04:57 +0000)
committerJaven O'Neal <onealj@apache.org>
Fri, 10 Jun 2016 04:57:04 +0000 (04:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/xssf_structured_references@1747633 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/ss/formula/TestFormulaParser.java
src/testcases/org/apache/poi/hssf/model/AllModelTests.java

index 9987dcf42ad570476213b7f704b22877384ad8d3..9f40ca363a4852b77280f1536189c3385633d023 100644 (file)
  */
 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 {
index 0d140ab7d320faac9bda68d25215021714b2ffc4..bca29c74f9dbc6af5221ac66520a3052dfd82f4f 100644 (file)
@@ -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,