aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java
diff options
context:
space:
mode:
authorJosh Micich <josh@apache.org>2008-08-25 22:41:08 +0000
committerJosh Micich <josh@apache.org>2008-08-25 22:41:08 +0000
commit04dfa8d39f2592299829fff743621b93ff64c965 (patch)
tree881398768360c038ef30c0ab76419702ce091282 /src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java
parentd4b6c06f2b15a1aa1e9f991192e6869ca35d4f3a (diff)
downloadpoi-04dfa8d39f2592299829fff743621b93ff64c965.tar.gz
poi-04dfa8d39f2592299829fff743621b93ff64c965.zip
Replaced calls to deprecated versions of createCell(), getCell(), createRow(), and getRow(). (Changing short to int)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@688910 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java')
-rwxr-xr-xsrc/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java b/src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java
index 03d67cc21c..101bd325df 100755
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java
@@ -99,8 +99,8 @@ public final class TestSheetShiftRows extends TestCase {
public void testShiftRow(){
HSSFWorkbook b = new HSSFWorkbook();
HSSFSheet s = b.createSheet();
- s.createRow(0).createCell((short)0).setCellValue("TEST1");
- s.createRow(3).createCell((short)0).setCellValue("TEST2");
+ s.createRow(0).createCell(0).setCellValue("TEST1");
+ s.createRow(3).createCell(0).setCellValue("TEST2");
s.shiftRows(0,4,1);
}
@@ -112,8 +112,8 @@ public final class TestSheetShiftRows extends TestCase {
public void testShiftRow0(){
HSSFWorkbook b = new HSSFWorkbook();
HSSFSheet s = b.createSheet();
- s.createRow(0).createCell((short)0).setCellValue("TEST1");
- s.createRow(3).createCell((short)0).setCellValue("TEST2");
+ s.createRow(0).createCell(0).setCellValue("TEST1");
+ s.createRow(3).createCell(0).setCellValue("TEST2");
s.shiftRows(0,4,1);
}
@@ -125,7 +125,7 @@ public final class TestSheetShiftRows extends TestCase {
HSSFWorkbook b = new HSSFWorkbook();
HSSFSheet s = b.createSheet();
HSSFRow row = s.createRow(4);
- row.createCell((short)0).setCellValue("test");
+ row.createCell(0).setCellValue("test");
s.setRowBreak(4);
s.shiftRows(4, 4, 2);
@@ -203,34 +203,34 @@ public final class TestSheetShiftRows extends TestCase {
HSSFSheet sheet = wb.getSheet("Sheet1");
assertEquals(19, sheet.getLastRowNum());
- assertEquals("cell B1 (ref)", sheet.getRow(0).getCell((short)3).getRichStringCellValue().toString());
- assertEquals("CONCATENATE(B1,\" (ref)\")", sheet.getRow(0).getCell((short)3).getCellFormula());
- assertEquals("cell B2 (ref)", sheet.getRow(1).getCell((short)3).getRichStringCellValue().toString());
- assertEquals("CONCATENATE(B2,\" (ref)\")", sheet.getRow(1).getCell((short)3).getCellFormula());
- assertEquals("cell B3 (ref)", sheet.getRow(2).getCell((short)3).getRichStringCellValue().toString());
- assertEquals("CONCATENATE(B3,\" (ref)\")", sheet.getRow(2).getCell((short)3).getCellFormula());
- assertEquals("cell B2 (ref)", sheet.getRow(6).getCell((short)1).getRichStringCellValue().toString());
- assertEquals("CONCATENATE(B2,\" (ref)\")", sheet.getRow(6).getCell((short)1).getCellFormula());
+ assertEquals("cell B1 (ref)", sheet.getRow(0).getCell(3).getRichStringCellValue().toString());
+ assertEquals("CONCATENATE(B1,\" (ref)\")", sheet.getRow(0).getCell(3).getCellFormula());
+ assertEquals("cell B2 (ref)", sheet.getRow(1).getCell(3).getRichStringCellValue().toString());
+ assertEquals("CONCATENATE(B2,\" (ref)\")", sheet.getRow(1).getCell(3).getCellFormula());
+ assertEquals("cell B3 (ref)", sheet.getRow(2).getCell(3).getRichStringCellValue().toString());
+ assertEquals("CONCATENATE(B3,\" (ref)\")", sheet.getRow(2).getCell(3).getCellFormula());
+ assertEquals("cell B2 (ref)", sheet.getRow(6).getCell(1).getRichStringCellValue().toString());
+ assertEquals("CONCATENATE(B2,\" (ref)\")", sheet.getRow(6).getCell(1).getCellFormula());
sheet.shiftRows(1, 1, 10);
// Row 1 => Row 11
// So strings on row 11 unchanged, but reference in formula is
- assertEquals("cell B1 (ref)", sheet.getRow(0).getCell((short)3).getRichStringCellValue().toString());
- assertEquals("CONCATENATE(B1,\" (ref)\")", sheet.getRow(0).getCell((short)3).getCellFormula());
+ assertEquals("cell B1 (ref)", sheet.getRow(0).getCell(3).getRichStringCellValue().toString());
+ assertEquals("CONCATENATE(B1,\" (ref)\")", sheet.getRow(0).getCell(3).getCellFormula());
assertEquals(0, sheet.getRow(1).getPhysicalNumberOfCells());
// still save b2
- assertEquals("cell B2 (ref)", sheet.getRow(11).getCell((short)3).getRichStringCellValue().toString());
+ assertEquals("cell B2 (ref)", sheet.getRow(11).getCell(3).getRichStringCellValue().toString());
// but points to b12
- assertEquals("CONCATENATE(B12,\" (ref)\")", sheet.getRow(11).getCell((short)3).getCellFormula());
+ assertEquals("CONCATENATE(B12,\" (ref)\")", sheet.getRow(11).getCell(3).getCellFormula());
- assertEquals("cell B3 (ref)", sheet.getRow(2).getCell((short)3).getRichStringCellValue().toString());
- assertEquals("CONCATENATE(B3,\" (ref)\")", sheet.getRow(2).getCell((short)3).getCellFormula());
+ assertEquals("cell B3 (ref)", sheet.getRow(2).getCell(3).getRichStringCellValue().toString());
+ assertEquals("CONCATENATE(B3,\" (ref)\")", sheet.getRow(2).getCell(3).getCellFormula());
// one on a non-shifted row also updated
- assertEquals("cell B2 (ref)", sheet.getRow(6).getCell((short)1).getRichStringCellValue().toString());
- assertEquals("CONCATENATE(B12,\" (ref)\")", sheet.getRow(6).getCell((short)1).getCellFormula());
+ assertEquals("cell B2 (ref)", sheet.getRow(6).getCell(1).getRichStringCellValue().toString());
+ assertEquals("CONCATENATE(B12,\" (ref)\")", sheet.getRow(6).getCell(1).getCellFormula());
}
}