Author: abearez
Date: Sun Jan 24 20:01:36 2021
New Revision: 1885886

URL: http://svn.apache.org/viewvc?rev=1885886&view=rev
Log:
Replace deprecated methods used  in tests

Modified:
    
poi/trunk/src/examples/src/org/apache/poi/examples/xssf/usermodel/ExcelChartWithTargetLine.java
    
poi/trunk/src/examples/src/org/apache/poi/examples/xwpf/usermodel/BarChartExample.java
    
poi/trunk/src/examples/src/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java
    
poi/trunk/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChartRemoveSeries.java
    
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java
    
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java
    
poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFChart.java

Modified: 
poi/trunk/src/examples/src/org/apache/poi/examples/xssf/usermodel/ExcelChartWithTargetLine.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/examples/xssf/usermodel/ExcelChartWithTargetLine.java?rev=1885886&r1=1885885&r2=1885886&view=diff
==============================================================================
--- 
poi/trunk/src/examples/src/org/apache/poi/examples/xssf/usermodel/ExcelChartWithTargetLine.java
 (original)
+++ 
poi/trunk/src/examples/src/org/apache/poi/examples/xssf/usermodel/ExcelChartWithTargetLine.java
 Sun Jan 24 20:01:36 2021
@@ -137,7 +137,7 @@ public final class ExcelChartWithTargetL
         }
 
         XDDFScatterChartData scatter = (XDDFScatterChartData) 
chart.createData(ChartTypes.SCATTER, scatterX, scatterY);
-        scatter.setVaryColors(true);
+        scatter.setVaryColors(false);
 
         //  This only works for Excel since OpenOffice or LibreOffice Calc 
does not support literal numeric data series.
         XDDFNumericalDataSource<Double> targetDS = 
XDDFDataSourcesFactory.fromArray(new Double[] { target, target });

Modified: 
poi/trunk/src/examples/src/org/apache/poi/examples/xwpf/usermodel/BarChartExample.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/examples/xwpf/usermodel/BarChartExample.java?rev=1885886&r1=1885885&r2=1885886&view=diff
==============================================================================
--- 
poi/trunk/src/examples/src/org/apache/poi/examples/xwpf/usermodel/BarChartExample.java
 (original)
+++ 
poi/trunk/src/examples/src/org/apache/poi/examples/xwpf/usermodel/BarChartExample.java
 Sun Jan 24 20:01:36 2021
@@ -63,7 +63,7 @@ public final class BarChartExample {
         }
 
         try (FileInputStream argIS = new FileInputStream(args[0]);
-            BufferedReader modelReader = 
Files.newBufferedReader(Paths.get(args[1]), StandardCharsets.ISO_8859_1)) {
+            BufferedReader modelReader = 
Files.newBufferedReader(Paths.get(args[1]), StandardCharsets.UTF_8)) {
 
             String chartTitle = modelReader.readLine();  // first line is 
chart title
             String[] series = modelReader.readLine().split(",");

Modified: 
poi/trunk/src/examples/src/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java?rev=1885886&r1=1885885&r2=1885886&view=diff
==============================================================================
--- 
poi/trunk/src/examples/src/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java
 (original)
+++ 
poi/trunk/src/examples/src/org/apache/poi/examples/xwpf/usermodel/ChartFromScratch.java
 Sun Jan 24 20:01:36 2021
@@ -67,7 +67,7 @@ public final class ChartFromScratch {
             return;
         }
 
-        try (BufferedReader modelReader = 
Files.newBufferedReader(Paths.get(args[0]), StandardCharsets.ISO_8859_1)) {
+        try (BufferedReader modelReader = 
Files.newBufferedReader(Paths.get(args[0]), StandardCharsets.UTF_8)) {
 
             String chartTitle = modelReader.readLine();  // first line is 
chart title
             String[] series = modelReader.readLine().split(",");

Modified: 
poi/trunk/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChartRemoveSeries.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChartRemoveSeries.java?rev=1885886&r1=1885885&r2=1885886&view=diff
==============================================================================
--- 
poi/trunk/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChartRemoveSeries.java
 (original)
+++ 
poi/trunk/src/ooxml/testcases/org/apache/poi/xddf/usermodel/chart/TestXDDFChartRemoveSeries.java
 Sun Jan 24 20:01:36 2021
@@ -117,7 +117,7 @@ class TestXDDFChartRemoveSeries {
     }
 
     /**
-     * Remove the first series by calling chartData.getSeries().remove(0).
+     * Attempt to remove the first series by calling 
chartData.getSeries().remove(0).
      * <p>
      * This used to corrupt the workbook but the returned <code>List</code> is 
unmodifiable.
      */
@@ -171,4 +171,4 @@ class TestXDDFChartRemoveSeries {
         assertEquals(2, chartData.getSeriesCount());
     }
 
-}
\ No newline at end of file
+}

Modified: 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java?rev=1885886&r1=1885885&r2=1885886&view=diff
==============================================================================
--- 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java
 (original)
+++ 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFLineChartData.java
 Sun Jan 24 20:01:36 2021
@@ -67,8 +67,8 @@ class TestXSSFLineChartData {
         XDDFChartData.Series series = lineChartData.addSeries(xs, ys);
 
         assertNotNull(series);
-        assertEquals(1, lineChartData.getSeries().size());
-        assertTrue(lineChartData.getSeries().contains(series));
+        assertEquals(1, lineChartData.getSeriesCount());
+        assertTrue(lineChartData.getSeries(0) == series);
 
         chart.plot(lineChartData);
         wb.close();

Modified: 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java?rev=1885886&r1=1885885&r2=1885886&view=diff
==============================================================================
--- 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java
 (original)
+++ 
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFScatterChartData.java
 Sun Jan 24 20:01:36 2021
@@ -70,8 +70,8 @@ public final class TestXSSFScatterChartD
 
         assertEquals(ScatterStyle.LINE_MARKER, scatterChartData.getStyle());
         assertNotNull(series);
-        assertEquals(1, scatterChartData.getSeries().size());
-        assertTrue(scatterChartData.getSeries().contains(series));
+        assertEquals(1, scatterChartData.getSeriesCount());
+        assertTrue(scatterChartData.getSeries(0) == series);
 
         chart.plot(scatterChartData);
         wb.close();

Modified: 
poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFChart.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFChart.java?rev=1885886&r1=1885885&r2=1885886&view=diff
==============================================================================
--- 
poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFChart.java 
(original)
+++ 
poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFChart.java 
Sun Jan 24 20:01:36 2021
@@ -56,7 +56,7 @@ class TestXWPFChart {
         assertEquals(1, chart.getChartSeries().size());
         XDDFChartData data = chart.getChartSeries().get(0);
         assertEquals(XDDFBarChartData.class, data.getClass());
-        assertEquals(3, data.getSeries().size());
+        assertEquals(3, data.getSeriesCount());
     }
 
     /**



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

Reply via email to