View | Details | Raw Unified | Return to bug 58333
Collapse All | Expand All

(-)src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java (+6 lines)
Lines 33-38 Link Here
33
import org.apache.poi.hssf.HSSFTestDataSamples;
33
import org.apache.poi.hssf.HSSFTestDataSamples;
34
import org.apache.poi.poifs.crypt.CryptoFunctions;
34
import org.apache.poi.poifs.crypt.CryptoFunctions;
35
import org.apache.poi.poifs.crypt.HashAlgorithm;
35
import org.apache.poi.poifs.crypt.HashAlgorithm;
36
import org.apache.poi.ss.SpreadsheetVersion;
36
import org.apache.poi.ss.usermodel.AutoFilter;
37
import org.apache.poi.ss.usermodel.AutoFilter;
37
import org.apache.poi.ss.usermodel.BaseTestSheet;
38
import org.apache.poi.ss.usermodel.BaseTestSheet;
38
import org.apache.poi.ss.usermodel.Cell;
39
import org.apache.poi.ss.usermodel.Cell;
Lines 994-999 Link Here
994
        assertEquals(3, xrow[2].getR());
995
        assertEquals(3, xrow[2].getR());
995
996
996
    }
997
    }
998
    
999
    @Test
1000
    public void createRowAfterLastRow() {
1001
        createRowAfterLastRow(SpreadsheetVersion.EXCEL2007);
1002
    }
997
1003
998
    @Test
1004
    @Test
999
    public void setAutoFilter() {
1005
    public void setAutoFilter() {
(-)src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java (-1 / +6 lines)
Lines 57-62 Link Here
57
import org.apache.poi.hssf.record.WindowTwoRecord;
57
import org.apache.poi.hssf.record.WindowTwoRecord;
58
import org.apache.poi.hssf.record.aggregates.WorksheetProtectionBlock;
58
import org.apache.poi.hssf.record.aggregates.WorksheetProtectionBlock;
59
import org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector;
59
import org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector;
60
import org.apache.poi.ss.SpreadsheetVersion;
60
import org.apache.poi.ss.formula.ptg.Area3DPtg;
61
import org.apache.poi.ss.formula.ptg.Area3DPtg;
61
import org.apache.poi.ss.formula.ptg.Ptg;
62
import org.apache.poi.ss.formula.ptg.Ptg;
62
import org.apache.poi.ss.usermodel.AutoFilter;
63
import org.apache.poi.ss.usermodel.AutoFilter;
Lines 84-91 Link Here
84
    public TestHSSFSheet() {
85
    public TestHSSFSheet() {
85
        super(HSSFITestDataProvider.instance);
86
        super(HSSFITestDataProvider.instance);
86
    }
87
    }
88
    
89
    @Test
90
    public void createRowAfterLastRow() {
91
        createRowAfterLastRow(SpreadsheetVersion.EXCEL97);
92
    }
87
93
88
89
    /**
94
    /**
90
     * Test for Bugzilla #29747.
95
     * Test for Bugzilla #29747.
91
     * Moved from TestHSSFWorkbook#testSetRepeatingRowsAndColumns().
96
     * Moved from TestHSSFWorkbook#testSetRepeatingRowsAndColumns().
(-)src/testcases/org/apache/poi/ss/usermodel/BaseTestSheet.java (+25 lines)
Lines 87-92 Link Here
87
        assertSame(row2_ovrewritten, row2_ovrewritten_ref);
87
        assertSame(row2_ovrewritten, row2_ovrewritten_ref);
88
        assertEquals(100.0, row2_ovrewritten_ref.getCell(0).getNumericCellValue(), 0.0);
88
        assertEquals(100.0, row2_ovrewritten_ref.getCell(0).getNumericCellValue(), 0.0);
89
    }
89
    }
90
    
91
    @Test
92
    public void createRowBeforeFirstRow() {
93
        final Workbook workbook = _testDataProvider.createWorkbook();
94
        final Sheet sh = workbook.createSheet();
95
        sh.createRow(0);
96
        try {
97
            sh.createRow(-1);
98
            fail("Negative rows not allowed");
99
        } catch (final IllegalArgumentException e) {
100
            // expected
101
        }
102
    }
103
    
104
    protected void createRowAfterLastRow(SpreadsheetVersion version) {
105
        final Workbook workbook = _testDataProvider.createWorkbook();
106
        final Sheet sh = workbook.createSheet();
107
        sh.createRow(version.getLastRowIndex());
108
        try {
109
            sh.createRow(version.getLastRowIndex() + 1);
110
            fail("Row number must be between 0 and " + version.getLastColumnIndex());
111
        } catch (final IllegalArgumentException e) {
112
            // expected
113
        }
114
    }
90
115
91
116
92
    @Test
117
    @Test

Return to bug 58333