Author: onealj
Date: Wed Sep 14 22:01:11 2016
New Revision: 1760806

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

Modified:
    
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/AllXSSFUsermodelTests.java
    
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPivotTable.java

Modified: 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/AllXSSFUsermodelTests.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/AllXSSFUsermodelTests.java?rev=1760806&r1=1760805&r2=1760806&view=diff
==============================================================================
--- 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/AllXSSFUsermodelTests.java
 (original)
+++ 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/AllXSSFUsermodelTests.java
 Wed Sep 14 22:01:11 2016
@@ -59,7 +59,7 @@ import org.junit.runners.Suite;
     TestXSSFSheetComments.class,
     TestColumnHelper.class,
     TestHeaderFooterHelper.class,
-    TestXSSFPivotTable.class,
+    //TestXSSFPivotTable.class, //converted to junit4
     TestForkedEvaluator.class
 })
 public final class AllXSSFUsermodelTests {

Modified: 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPivotTable.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPivotTable.java?rev=1760806&r1=1760805&r2=1760806&view=diff
==============================================================================
--- 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPivotTable.java
 (original)
+++ 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPivotTable.java
 Wed Sep 14 22:01:11 2016
@@ -16,6 +16,9 @@
 ==================================================================== */
 package org.apache.poi.xssf.usermodel;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.DataConsolidateFunction;
@@ -23,20 +26,20 @@ import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.util.AreaReference;
 import org.apache.poi.ss.util.CellReference;
+import org.junit.Before;
+import org.junit.Test;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageField;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageFields;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotFields;
 import 
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotTableDefinition;
 import 
org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataConsolidateFunction;
 
-import junit.framework.TestCase;
-
-public class TestXSSFPivotTable extends TestCase {
+public class TestXSSFPivotTable {
     private XSSFPivotTable pivotTable;
     private XSSFPivotTable offsetPivotTable;
     private Cell offsetOuterCell;
     
-    @Override
+    @Before
     public void setUp(){
         Workbook wb = new XSSFWorkbook();
         XSSFSheet sheet = (XSSFSheet) wb.createSheet();
@@ -119,6 +122,7 @@ public class TestXSSFPivotTable extends
      * Verify that when creating a row label it's  created on the correct row
      * and the count is increased by one.
      */
+    @Test
     public void testAddRowLabelToPivotTable() {
         int columnIndex = 0;
 
@@ -141,6 +145,7 @@ public class TestXSSFPivotTable extends
     /**
      * Verify that it's not possible to create a row label outside of the 
referenced area.
      */
+    @Test
     public void testAddRowLabelOutOfRangeThrowsException() {
         int columnIndex = 5;
 
@@ -155,6 +160,7 @@ public class TestXSSFPivotTable extends
     /**
      * Verify that when creating one column label, no col fields are being 
created.
      */
+    @Test
     public void testAddOneColumnLabelToPivotTableDoesNotCreateColField() {
         int columnIndex = 0;
 
@@ -167,6 +173,7 @@ public class TestXSSFPivotTable extends
     /**
      * Verify that it's possible to create three column labels with different 
DataConsolidateFunction
      */
+    @Test
     public void testAddThreeDifferentColumnLabelsToPivotTable() {
         int columnOne = 0;
         int columnTwo = 1;
@@ -184,6 +191,7 @@ public class TestXSSFPivotTable extends
     /**
      * Verify that it's possible to create three column labels with the same 
DataConsolidateFunction
      */
+    @Test
     public void testAddThreeSametColumnLabelsToPivotTable() {
         int columnOne = 0;
         int columnTwo = 1;
@@ -200,6 +208,7 @@ public class TestXSSFPivotTable extends
     /**
      * Verify that when creating two column labels, a col field is being 
created and X is set to -2.
      */
+    @Test
     public void testAddTwoColumnLabelsToPivotTable() {
         int columnOne = 0;
         int columnTwo = 1;
@@ -214,6 +223,7 @@ public class TestXSSFPivotTable extends
     /**
      * Verify that a data field is created when creating a data column
      */
+    @Test
     public void testColumnLabelCreatesDataField() {
         int columnIndex = 0;
 
@@ -229,6 +239,7 @@ public class TestXSSFPivotTable extends
     /**
      * Verify that it's possible to set a custom name when creating a data 
column
      */
+    @Test
     public void testColumnLabelSetCustomName() {
         int columnIndex = 0;
 
@@ -245,6 +256,7 @@ public class TestXSSFPivotTable extends
     /**
      * Verify that it's not possible to create a column label outside of the 
referenced area.
      */
+    @Test
     public void testAddColumnLabelOutOfRangeThrowsException() {
         int columnIndex = 5;
 
@@ -260,6 +272,7 @@ public class TestXSSFPivotTable extends
      * Verify when creating a data column set to a data field, the data field 
with the corresponding
      * column index will be set to true.
      */
+    @Test
     public void testAddDataColumn() {
         int columnIndex = 0;
         boolean isDataField = true;
@@ -272,6 +285,7 @@ public class TestXSSFPivotTable extends
     /**
      * Verify that it's not possible to create a data column outside of the 
referenced area.
      */
+    @Test
     public void testAddDataColumnOutOfRangeThrowsException() {
         int columnIndex = 5;
         boolean isDataField = true;
@@ -301,6 +315,7 @@ public class TestXSSFPivotTable extends
      /**
      * Verify that it's not possible to create a new filter outside of the 
referenced area.
      */
+    @Test
     public void testAddReportFilterOutOfRangeThrowsException() {
         int columnIndex = 5;
         try {
@@ -315,6 +330,7 @@ public class TestXSSFPivotTable extends
      * Verify that the Pivot Table operates only within the referenced area, 
even when the
      * first column of the referenced area is not index 0.
      */
+    @Test
     public void testAddDataColumnWithOffsetData() {
         offsetPivotTable.addColumnLabel(DataConsolidateFunction.SUM, 1);
         assertEquals(CellType.NUMERIC, offsetOuterCell.getCellTypeEnum());



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to