]> source.dussan.org Git - poi.git/commitdiff
Swapped deprecated code
authorJosh Micich <josh@apache.org>
Wed, 17 Sep 2008 00:03:07 +0000 (00:03 +0000)
committerJosh Micich <josh@apache.org>
Wed, 17 Sep 2008 00:03:07 +0000 (00:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@696111 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/record/formula/functions/TestNper.java

index e39777ad27f3f141cbce2b810140b5ed32a973d6..a2bb0f6adb0581dcf683fdefbf56532fcde779d4 100644 (file)
@@ -48,29 +48,19 @@ public final class TestNper extends TestCase {
        }
        
        public void testEvaluate_bug_45732() {
-// TODO - fix deprecated code etc
                HSSFWorkbook wb = new HSSFWorkbook();
                HSSFSheet sheet = wb.createSheet("Sheet1");
-               HSSFCell cell = sheet.createRow(0).createCell((short)0);
+               HSSFCell cell = sheet.createRow(0).createCell(0);
                
                cell.setCellFormula("NPER(12,4500,100000,100000)");
                cell.setCellValue(15.0);
                assertEquals("NPER(12,4500,100000.0,100000.0)", cell.getCellFormula());
-//             assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cell.getCachedFormulaResultType());
+               assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cell.getCachedFormulaResultType());
                assertEquals(15.0, cell.getNumericCellValue(), 0.0);
                
-               HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(sheet, wb);
-               fe.setCurrentRow(sheet.getRow(0));
+               HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
                fe.evaluateFormulaCell(cell);
-//             assertEquals(HSSFCell.CELL_TYPE_ERROR, cell.getCachedFormulaResultType());
-               try {
-                       if(cell.getNumericCellValue() == 15.0) {
-                               throw new AssertionFailedError("Identified bug 45732");
-                       }
-               } catch (RuntimeException e) {
-                       // expected during successful test
-                       assertEquals("Cannot get a numeric value from a error formula cell", e.getMessage());
-               }
+               assertEquals(HSSFCell.CELL_TYPE_ERROR, cell.getCachedFormulaResultType());
                assertEquals(HSSFErrorConstants.ERROR_NUM, cell.getErrorCellValue());
        }