poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r960117 - in /poi/trunk/src/ooxml/testcases/org/apache/poi: xslf/ xssf/model/ xssf/usermodel/ xssf/usermodel/helpers/ xwpf/usermodel/
Date Fri, 02 Jul 2010 21:45:40 GMT
Author: nick
Date: Fri Jul  2 21:45:40 2010
New Revision: 960117

URL: http://svn.apache.org/viewvc?rev=960117&view=rev
Log:
Fix deprecated warnings

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java?rev=960117&r1=960116&r2=960117&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java Fri Jul  2 21:45:40
2010
@@ -66,14 +66,17 @@ public class TestXSLFSlideShow extends T
 		
 		// Should have 1 master
 		assertEquals(1, xml.getSlideMasterReferences().sizeOfSldMasterIdArray());
-		assertEquals(1, xml.getSlideMasterReferences().getSldMasterIdArray().length);
+		assertEquals(1, xml.getSlideMasterReferences().getSldMasterIdList().size());
 		
 		// Should have three sheets
 		assertEquals(2, xml.getSlideReferences().sizeOfSldIdArray());
-		assertEquals(2, xml.getSlideReferences().getSldIdArray().length);
+		assertEquals(2, xml.getSlideReferences().getSldIdList().size());
 		
 		// Check they're as expected
-		CTSlideIdListEntry[] slides = xml.getSlideReferences().getSldIdArray();
+		CTSlideIdListEntry[] slides = new CTSlideIdListEntry[
+		    xml.getSlideReferences().getSldIdList().size()];
+		xml.getSlideReferences().getSldIdList().toArray(slides);
+		
 		assertEquals(256, slides[0].getId());
 		assertEquals(257, slides[1].getId());
 		assertEquals("rId2", slides[0].getId2());
@@ -88,8 +91,10 @@ public class TestXSLFSlideShow extends T
 		assertNotNull(xml.getNotes(slides[1]));
 		
 		// And again for the master
-		CTSlideMasterIdListEntry[] masters =
-			xml.getSlideMasterReferences().getSldMasterIdArray();
+		CTSlideMasterIdListEntry[] masters = new CTSlideMasterIdListEntry[
+			xml.getSlideMasterReferences().getSldMasterIdList().size()];
+		xml.getSlideMasterReferences().getSldMasterIdList().toArray(masters);
+		
 		assertEquals(2147483648l, masters[0].getId());
 		assertEquals("rId1", masters[0].getId2());
 		assertNotNull(xml.getSlideMaster(masters[0]));

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java?rev=960117&r1=960116&r2=960117&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestCalculationChain.java Fri
Jul  2 21:45:40 2010
@@ -32,7 +32,7 @@ public final class TestCalculationChain 
         CalculationChain chain = wb.getCalculationChain();
         //the bean holding the reference to the formula to be deleted
         CTCalcCell c = chain.getCTCalcChain().getCArray(0);
-        int cnt = chain.getCTCalcChain().getCArray().length;
+        int cnt = chain.getCTCalcChain().getCList().size();
         assertEquals(10, c.getI());
         assertEquals("E1", c.getR());
 
@@ -44,7 +44,7 @@ public final class TestCalculationChain 
 
         //the count of items is less by one
         c = chain.getCTCalcChain().getCArray(0);
-        int cnt2 =  chain.getCTCalcChain().getCArray().length;
+        int cnt2 =  chain.getCTCalcChain().getCList().size();
         assertEquals(cnt - 1, cnt2);
         //the first item in the calculation chain is the former second one
         assertEquals(10, c.getI());

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java?rev=960117&r1=960116&r2=960117&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java Fri Jul  2 21:45:40
2010
@@ -16,17 +16,16 @@
 ==================================================================== */
 package org.apache.poi.xssf.model;
 
+import junit.framework.TestCase;
+
 import org.apache.poi.POIXMLDocumentPart;
 import org.apache.poi.xssf.XSSFTestDataSamples;
 import org.apache.poi.xssf.usermodel.XSSFMap;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSchema;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTMapInfo;
 import org.w3c.dom.Node;
 
-import junit.framework.TestCase;
-
 /**
  * @author Roberto Manicardi
  */
@@ -51,9 +50,7 @@ public final class TestMapInfo extends T
 
                 assertNotNull(ctMapInfo);
 
-                CTSchema[] schemas = ctMapInfo.getSchemaArray();
-                assertEquals(1, schemas.length);
-
+                assertEquals(1, ctMapInfo.getSchemaList().size());
 
                 for (XSSFMap map : mapInfo.getAllXSSFMaps()) {
                     Node xmlSchema = map.getSchema();

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java?rev=960117&r1=960116&r2=960117&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java Fri Jul
 2 21:45:40 2010
@@ -142,10 +142,10 @@ public final class TestXSSFComment exten
         assertSame(comment.getString(), richText);
         //check that the rich text is set in the comment
         CTRPrElt rPr = richText.getCTRst().getRArray(0).getRPr();
-        assertEquals(true, rPr.getIArray()[0].getVal());
-        assertEquals(8.5, rPr.getSzArray()[0].getVal());
-        assertEquals(IndexedColors.BLUE_GREY.getIndex(), rPr.getColorArray()[0].getIndexed());
-        assertEquals("Tahoma", rPr.getRFontArray()[0].getVal());
+        assertEquals(true, rPr.getIArray(0).getVal());
+        assertEquals(8.5, rPr.getSzArray(0).getVal());
+        assertEquals(IndexedColors.BLUE_GREY.getIndex(), rPr.getColorArray(0).getIndexed());
+        assertEquals("Tahoma", rPr.getRFontArray(0).getVal());
     }
 
     public void testAuthor() {

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java?rev=960117&r1=960116&r2=960117&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java Fri Jul
 2 21:45:40 2010
@@ -58,7 +58,7 @@ public final class TestXSSFFont extends 
 
 
 		xssfFont.setBold(true);
-		assertEquals(ctFont.getBArray().length,1);
+		assertEquals(ctFont.getBList().size(),1);
 		assertEquals(true, ctFont.getBArray(0).getVal());
 	}
 
@@ -113,7 +113,7 @@ public final class TestXSSFFont extends 
 		assertEquals(false, xssfFont.getItalic());
 
 		xssfFont.setItalic(true);
-		assertEquals(ctFont.getIArray().length,1);
+		assertEquals(ctFont.getIList().size(),1);
 		assertEquals(true, ctFont.getIArray(0).getVal());
 		assertEquals(true,ctFont.getIArray(0).getVal());
 	}
@@ -128,7 +128,7 @@ public final class TestXSSFFont extends 
 		assertEquals(false, xssfFont.getStrikeout());
 
 		xssfFont.setStrikeout(true);
-		assertEquals(ctFont.getStrikeArray().length,1);
+		assertEquals(ctFont.getStrikeList().size(),1);
 		assertEquals(true, ctFont.getStrikeArray(0).getVal());
 		assertEquals(true,ctFont.getStrikeArray(0).getVal());
 	}
@@ -169,11 +169,11 @@ public final class TestXSSFFont extends 
 		assertEquals(Font.U_SINGLE, xssfFont.getUnderline());
 
 		xssfFont.setUnderline(Font.U_DOUBLE);
-		assertEquals(ctFont.getUArray().length,1);
+		assertEquals(ctFont.getUList().size(),1);
 		assertEquals(STUnderlineValues.DOUBLE,ctFont.getUArray(0).getVal());
 
 		xssfFont.setUnderline(FontUnderline.DOUBLE_ACCOUNTING);
-		assertEquals(ctFont.getUArray().length,1);
+		assertEquals(ctFont.getUList().size(),1);
 		assertEquals(STUnderlineValues.DOUBLE_ACCOUNTING,ctFont.getUArray(0).getVal());
 	}
 

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java?rev=960117&r1=960116&r2=960117&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java Fri Jul
 2 21:45:40 2010
@@ -287,7 +287,7 @@ public final class TestXSSFSheet extends
         sheet.groupColumn(10, 11);
         CTCols cols = sheet.getCTWorksheet().getColsArray(0);
         assertEquals(2, cols.sizeOfColArray());
-        CTCol[] colArray = cols.getColArray();
+        CTCol[] colArray = cols.getColList().toArray(new CTCol[2]);
         assertNotNull(colArray);
         assertEquals(2 + 1, colArray[0].getMin()); // 1 based
         assertEquals(7 + 1, colArray[0].getMax()); // 1 based
@@ -297,7 +297,7 @@ public final class TestXSSFSheet extends
         sheet.groupColumn(1, 2);
         cols = sheet.getCTWorksheet().getColsArray(0);
         assertEquals(4, cols.sizeOfColArray());
-        colArray = cols.getColArray();
+        colArray = cols.getColList().toArray(new CTCol[0]);
         assertEquals(2, colArray[1].getOutlineLevel());
 
         //three level
@@ -305,17 +305,17 @@ public final class TestXSSFSheet extends
         sheet.groupColumn(2, 3);
         cols = sheet.getCTWorksheet().getColsArray(0);
         assertEquals(7, cols.sizeOfColArray());
-        colArray = cols.getColArray();
+        colArray = cols.getColList().toArray(new CTCol[0]);
         assertEquals(3, colArray[1].getOutlineLevel());
         assertEquals(3, sheet.getCTWorksheet().getSheetFormatPr().getOutlineLevelCol());
 
         sheet.ungroupColumn(8, 10);
-        colArray = cols.getColArray();
+        colArray = cols.getColList().toArray(new CTCol[0]);
         //assertEquals(3, colArray[1].getOutlineLevel());
 
         sheet.ungroupColumn(4, 6);
         sheet.ungroupColumn(2, 2);
-        colArray = cols.getColArray();
+        colArray = cols.getColList().toArray(new CTCol[0]);
         assertEquals(4, colArray.length);
         assertEquals(2, sheet.getCTWorksheet().getSheetFormatPr().getOutlineLevelCol());
     }
@@ -697,7 +697,7 @@ public final class TestXSSFSheet extends
         XSSFSheet xs = sheet;
         CTWorksheet cts = xs.getCTWorksheet();
 
-        CTCols[] cols_s = cts.getColsArray();
+        CTCols[] cols_s = cts.getColsList().toArray(new CTCols[1]);
         assertEquals(1, cols_s.length);
         CTCols cols = cols_s[0];
         assertEquals(1, cols.sizeOfColArray());
@@ -712,7 +712,7 @@ public final class TestXSSFSheet extends
         // Now set another
         sheet.setColumnWidth(3, 33 * 256);
 
-        cols_s = cts.getColsArray();
+        cols_s = cts.getColsList().toArray(new CTCols[1]);
         assertEquals(1, cols_s.length);
         cols = cols_s[0];
         assertEquals(2, cols.sizeOfColArray());
@@ -918,7 +918,7 @@ public final class TestXSSFSheet extends
         row3.createCell(5);
 
 
-        CTRow[] xrow = sheetData.getRowArray();
+        CTRow[] xrow = sheetData.getRowList().toArray(new CTRow[3]);
         assertEquals(3, xrow.length);
 
         //rows are unsorted: {2, 1, 0}
@@ -934,7 +934,7 @@ public final class TestXSSFSheet extends
         assertEquals(1, xrow[2].getR());
         assertTrue(xrow[2].equals(row3.getCTRow()));
 
-        CTCell[] xcell = xrow[2].getCArray();
+        CTCell[] xcell = xrow[2].getCList().toArray(new CTCell[4]);
         assertEquals("D1", xcell[0].getR());
         assertEquals("A1", xcell[1].getR());
         assertEquals("C1", xcell[2].getR());
@@ -950,14 +950,14 @@ public final class TestXSSFSheet extends
         workbook = XSSFTestDataSamples.writeOutAndReadBack(workbook);
         sheet = workbook.getSheetAt(0);
         wsh = sheet.getCTWorksheet();
-        xrow = sheetData.getRowArray();
+        xrow = sheetData.getRowList().toArray(new CTRow[3]);
         assertEquals(3, xrow.length);
 
         //rows are sorted: {0, 1, 2}
         assertEquals(4, xrow[0].sizeOfCArray());
         assertEquals(1, xrow[0].getR());
         //cells are now sorted
-        xcell = xrow[0].getCArray();
+        xcell = xrow[0].getCList().toArray(new CTCell[4]);
         assertEquals("A1", xcell[0].getR());
         assertEquals("C1", xcell[1].getR());
         assertEquals("D1", xcell[2].getR());

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java?rev=960117&r1=960116&r2=960117&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java
(original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java
Fri Jul  2 21:45:40 2010
@@ -186,10 +186,9 @@ public final class TestColumnHelper exte
         helper.addCleanColIntoCols(cols1, col9);
 
         // TODO - assert something interesting
-        CTCol[] colArray = cols1.getColArray();
-        assertEquals(12, colArray.length);
-        assertEquals(1, colArray[0].getMin());
-        assertEquals(16750, colArray[11].getMax());
+        assertEquals(12, cols1.getColList().size());
+        assertEquals(1, cols1.getColArray(0).getMin());
+        assertEquals(16750, cols1.getColArray(11).getMax());
     }
 
     public void testGetColumn() {

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java?rev=960117&r1=960116&r2=960117&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java Fri
Jul  2 21:45:40 2010
@@ -57,7 +57,7 @@ public final class TestXWPFParagraph ext
         assertEquals(1, ps.size());
         XWPFParagraph p = ps.get(0);
 
-        assertEquals(5, p.getCTP().getRArray().length);
+        assertEquals(5, p.getCTP().getRList().size());
         assertEquals("First header column!\tMid header\tRight header!", p
                 .getText());
     }

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java?rev=960117&r1=960116&r2=960117&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java Fri Jul 
2 21:45:40 2010
@@ -170,7 +170,7 @@ public class TestXWPFRun extends TestCas
         run.addCarriageReturn();
         run.setText("T2");
         run.addCarriageReturn();
-        assertEquals(3, run.getCTR().getCrArray().length);
+        assertEquals(3, run.getCTR().getCrList().size());
         
     }
 



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


Mime
View raw message