aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hssf/usermodel
diff options
context:
space:
mode:
authorJaven O'Neal <onealj@apache.org>2015-10-31 09:29:32 +0000
committerJaven O'Neal <onealj@apache.org>2015-10-31 09:29:32 +0000
commitc158ddea1c1de791f4271d0f252c67eb0dd37954 (patch)
tree72ee4d9115d56f8d6ee1776a853237a6e8266951 /src/testcases/org/apache/poi/hssf/usermodel
parenta9aad913bf20cad7d120b3ee64e661def0f02289 (diff)
downloadpoi-c158ddea1c1de791f4271d0f252c67eb0dd37954.tar.gz
poi-c158ddea1c1de791f4271d0f252c67eb0dd37954.zip
replace deprecated usage of o.a.p.ss.util.Region with o.a.p.ss.util.CellRangeAddress; add documentation to tests that exist strictly to test deprecated methods, and move SuppressWarnings-deprecation down to just those functions
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1711581 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/usermodel')
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java b/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java
index e29b35b7ec..efc7625e7f 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java
@@ -34,7 +34,6 @@ import org.apache.poi.ss.usermodel.Name;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
-import org.apache.poi.ss.util.Region;
import org.apache.poi.util.TempFile;
import junit.framework.TestCase;
@@ -46,7 +45,6 @@ import junit.framework.TestCase;
* @author Greg Merrill
* @author Siggi Cherem
*/
-@SuppressWarnings("deprecation")
public final class TestWorkbook extends TestCase {
private static final String LAST_NAME_KEY = "lastName";
private static final String FIRST_NAME_KEY = "firstName";
@@ -538,7 +536,13 @@ public final class TestWorkbook extends TestCase {
/**
* Generate a file to visually/programmatically verify repeating rows and cols made it
+ *
+ * Test setRepeatingRowsAndColumns with alternating columns -0 and 1.
+ *
+ * This test intentionally tests the deprecated
+ * {@link HSSFWorkbook#setRepeatingRowsAndColumns(int, int, int, int, int)} function
*/
+ @SuppressWarnings("deprecation")
public void testRepeatingColsRows() throws IOException
{
HSSFWorkbook workbook = new HSSFWorkbook();
@@ -563,6 +567,13 @@ public final class TestWorkbook extends TestCase {
workbook.close();
}
+ /**
+ * Test setRepeatingRowsAndColumns when startRow and startColumn are -1.
+ *
+ * This test intentionally tests the deprecated
+ * {@link HSSFWorkbook#setRepeatingRowsAndColumns(int, int, int, int, int)} function
+ */
+ @SuppressWarnings("deprecation")
public void testRepeatingColsRowsMinusOne() throws IOException
{
HSSFWorkbook workbook = new HSSFWorkbook();
@@ -603,8 +614,8 @@ public final class TestWorkbook extends TestCase {
c.setCellValue(new HSSFRichTextString("TEST"));
}
}
- s.addMergedRegion(new Region(0, (short)0, 10, (short)10));
- s.addMergedRegion(new Region(30, (short)5, 40, (short)15));
+ s.addMergedRegion(new CellRangeAddress(0, 10, 0, 10));
+ s.addMergedRegion(new CellRangeAddress(30, 40, 5, 15));
sanityChecker.checkHSSFWorkbook(wb);
wb = HSSFTestDataSamples.writeOutAndReadBack(wb);