ASF Bugzilla – Attachment 26399 Details for
Bug 50416
shiftRows compute wrong the last row number
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test case which describe the bug
Bug50416.java (text/plain), 1.37 KB, created by
French.Koala
on 2010-12-13 07:59:41 UTC
(
hide
)
Description:
Test case which describe the bug
Filename:
MIME Type:
Creator:
French.Koala
Created:
2010-12-13 07:59:41 UTC
Size:
1.37 KB
patch
obsolete
>import junit.framework.Assert; > >import org.apache.poi.hssf.usermodel.HSSFWorkbook; >import org.apache.poi.ss.usermodel.Cell; >import org.apache.poi.ss.usermodel.Row; >import org.apache.poi.ss.usermodel.Sheet; >import org.apache.poi.ss.usermodel.Workbook; >import org.junit.Test; > > >public class Bug50416 { > > @Test > public void lastRowNumberTest () { > // Create the workbook with 1 sheet which contains 3 rows > Workbook workbook = new HSSFWorkbook(); > Sheet sheet = workbook.createSheet("Bug50416"); > Row row1 = sheet.createRow(0); > Cell cellA_1 = row1.createCell(0,Cell.CELL_TYPE_STRING); > cellA_1.setCellValue("Cell A,1"); > Row row2 = sheet.createRow(1); > Cell cellA_2 = row2.createCell(0,Cell.CELL_TYPE_STRING); > cellA_2.setCellValue("Cell A,2"); > Row row3 = sheet.createRow(2); > Cell cellA_3 = row3.createCell(0,Cell.CELL_TYPE_STRING); > cellA_3.setCellValue("Cell A,3"); > // Test the last Row number > Assert.assertEquals(2, sheet.getLastRowNum()); > // switch the two first rows > sheet.shiftRows(0, 0, 3); > sheet.shiftRows(1, 1, -1); > sheet.shiftRows(3, 3, -2); > sheet.removeRow(sheet.getRow(3)); > // Test again the last row number which should be 2 > Assert.assertEquals(2, sheet.getLastRowNum()); > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 50416
: 26399