poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1738680 - in /poi/trunk/src/testcases/org/apache/poi/ss/formula: TestFormulaShifter.java ptg/AllFormulaTests.java
Date Tue, 12 Apr 2016 03:43:34 GMT
Author: onealj
Date: Tue Apr 12 03:43:33 2016
New Revision: 1738680

URL: http://svn.apache.org/viewvc?rev=1738680&view=rev
Log:
convert to junit4

Modified:
    poi/trunk/src/testcases/org/apache/poi/ss/formula/TestFormulaShifter.java
    poi/trunk/src/testcases/org/apache/poi/ss/formula/ptg/AllFormulaTests.java

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/TestFormulaShifter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/TestFormulaShifter.java?rev=1738680&r1=1738679&r2=1738680&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/TestFormulaShifter.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/TestFormulaShifter.java Tue Apr 12 03:43:33
2016
@@ -17,6 +17,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.ss.SpreadsheetVersion;
 import org.apache.poi.ss.formula.ptg.AreaErrPtg;
 import org.apache.poi.ss.formula.ptg.AreaPtg;
@@ -24,14 +29,14 @@ import org.apache.poi.ss.formula.ptg.Ptg
 import org.apache.poi.ss.formula.ptg.Ref3DPtg;
 import org.apache.poi.ss.util.CellReference;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
 /**
  * Tests for {@link FormulaShifter}.
  *
  * @author Josh Micich
  */
-public final class TestFormulaShifter extends TestCase {
+public final class TestFormulaShifter {
     // Note - the expected result row coordinates here were determined/verified
     // in Excel 2007 by manually testing.
 
@@ -39,6 +44,7 @@ public final class TestFormulaShifter ex
      * Tests what happens to area refs when a range of rows from inside, or overlapping are
      * moved
      */
+    @Test
     public void testShiftAreasSourceRows() {
 
         // all these operations are on an area ref spanning rows 10 to 20
@@ -78,6 +84,7 @@ public final class TestFormulaShifter ex
         confirmAreaShift(aptg, 18, 22,  5, 10, 25); // simple expansion at bottom
     }
     
+    @Test
     public void testCopyAreasSourceRowsRelRel() {
 
         // all these operations are on an area ref spanning rows 10 to 20
@@ -87,6 +94,7 @@ public final class TestFormulaShifter ex
         confirmAreaCopy(aptg,  15, 25, -15, -1, -1, true); //DeletedRef
     }
     
+    @Test
     public void testCopyAreasSourceRowsRelAbs() {
 
         // all these operations are on an area ref spanning rows 10 to 20
@@ -97,6 +105,7 @@ public final class TestFormulaShifter ex
         confirmAreaCopy(aptg,  15, 25, -15, -1, -1, true); //DeletedRef
     }
     
+    @Test
     public void testCopyAreasSourceRowsAbsRel() {
         // aptg is part of a formula in a cell that was just copied to another row
         // aptg row references should be updated by the difference in rows that the cell
was copied
@@ -112,6 +121,7 @@ public final class TestFormulaShifter ex
         confirmAreaCopy(aptg,  15, 25, -15, 5, 10, true); //sortTopLeftToBottomRight swapped
firstRow and lastRow because firstRow is absolute
     }
     
+    @Test
     public void testCopyAreasSourceRowsAbsAbs() {
         // aptg is part of a formula in a cell that was just copied to another row
         // aptg row references should be updated by the difference in rows that the cell
was copied
@@ -131,6 +141,7 @@ public final class TestFormulaShifter ex
      * Tests what happens to an area ref when some outside rows are moved to overlap
      * that area ref
      */
+    @Test
     public void testShiftAreasDestRows() {
         // all these operations are on an area ref spanning rows 20 to 25
         AreaPtg aptg  = createAreaPtg(20, 25);
@@ -199,6 +210,7 @@ public final class TestFormulaShifter ex
         return new AreaPtg(initialAreaFirstRow, initialAreaLastRow, 2, 5, firstRowRelative,
lastRowRelative, false, false);
     }
 
+    @Test
     public void testShiftSheet() {
         // 4 sheets, move a sheet from pos 2 to pos 0, i.e. current 0 becomes 1, current
1 becomes pos 2 
         FormulaShifter shifter = FormulaShifter.createForSheetShift(2, 0);
@@ -222,6 +234,7 @@ public final class TestFormulaShifter ex
                 3, ((Ref3DPtg)ptgs[3]).getExternSheetIndex());
     }
 
+    @Test
     public void testShiftSheet2() {
         // 4 sheets, move a sheet from pos 1 to pos 2, i.e. current 2 becomes 1, current
1 becomes pos 2 
         FormulaShifter shifter = FormulaShifter.createForSheetShift(1, 2);
@@ -245,6 +258,7 @@ public final class TestFormulaShifter ex
                 3, ((Ref3DPtg)ptgs[3]).getExternSheetIndex());
     }
     
+    @Test
     public void testInvalidArgument() {
         try {
             FormulaShifter.createForRowShift(1, "name", 1, 2, 0, SpreadsheetVersion.EXCEL97);
@@ -261,11 +275,13 @@ public final class TestFormulaShifter ex
         }
     }
     
+    @Test
     @SuppressWarnings("deprecation")
     public void testConstructor() {
         assertNotNull(FormulaShifter.createForRowShift(1, "name", 1, 2, 2));
     }
 
+    @Test
     public void testToString() {
         FormulaShifter shifter = FormulaShifter.createForRowShift(0, "sheet", 123, 456, 789,
                 SpreadsheetVersion.EXCEL2007);

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/ptg/AllFormulaTests.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/ptg/AllFormulaTests.java?rev=1738680&r1=1738679&r2=1738680&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/ptg/AllFormulaTests.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/ptg/AllFormulaTests.java Tue Apr 12
03:43:33 2016
@@ -17,7 +17,6 @@
 
 package org.apache.poi.ss.formula.ptg;
 
-import org.apache.poi.ss.formula.TestFormulaShifter;
 import org.apache.poi.ss.formula.TestSheetNameFormatter;
 import org.apache.poi.ss.formula.eval.AllFormulaEvalTests;
 import org.apache.poi.ss.formula.function.AllFormulaFunctionTests;
@@ -40,7 +39,7 @@ import org.junit.runners.Suite;
     TestAttrPtg.class,
     TestErrPtg.class,
     TestExternalFunctionFormulas.class,
-    TestFormulaShifter.class,
+    //TestFormulaShifter.class, //converted to junit4
     TestFuncPtg.class,
     TestFuncVarPtg.class,
     TestIntersectionPtg.class,



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message