Return-Path: Delivered-To: apmail-poi-commits-archive@minotaur.apache.org Received: (qmail 1127 invoked from network); 17 Dec 2009 01:31:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Dec 2009 01:31:53 -0000 Received: (qmail 17409 invoked by uid 500); 17 Dec 2009 01:31:53 -0000 Delivered-To: apmail-poi-commits-archive@poi.apache.org Received: (qmail 17367 invoked by uid 500); 17 Dec 2009 01:31:53 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 17352 invoked by uid 99); 17 Dec 2009 01:31:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2009 01:31:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2009 01:31:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A8C0B23889B8; Thu, 17 Dec 2009 01:31:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r891512 - /poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/functions/TestIndexFunctionFromSpreadsheet.java Date: Thu, 17 Dec 2009 01:31:29 -0000 To: commits@poi.apache.org From: josh@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091217013129.A8C0B23889B8@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: josh Date: Thu Dec 17 01:31:29 2009 New Revision: 891512 URL: http://svn.apache.org/viewvc?rev=891512&view=rev Log: Minor improvements to error reporting in TestIndexFunctionFromSpreadsheet Modified: poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/functions/TestIndexFunctionFromSpreadsheet.java Modified: poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/functions/TestIndexFunctionFromSpreadsheet.java URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/functions/TestIndexFunctionFromSpreadsheet.java?rev=891512&r1=891511&r2=891512&view=diff ============================================================================== --- poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/functions/TestIndexFunctionFromSpreadsheet.java (original) +++ poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/functions/TestIndexFunctionFromSpreadsheet.java Thu Dec 17 01:31:29 2009 @@ -92,7 +92,7 @@ case HSSFCell.CELL_TYPE_FORMULA: // will never be used, since we will call method after formula evaluation throw new AssertionFailedError("Cannot expect formula as result of formula evaluation: " + msg); case HSSFCell.CELL_TYPE_NUMERIC: - assertEquals(expected.getNumericCellValue(), actual.getNumberValue(), 0.0); + assertEquals(msg, expected.getNumericCellValue(), actual.getNumberValue(), 0.0); break; case HSSFCell.CELL_TYPE_STRING: assertEquals(msg, expected.getRichStringCellValue().getString(), actual.getStringValue()); @@ -181,11 +181,11 @@ if (c == null || c.getCellType() != HSSFCell.CELL_TYPE_FORMULA) { continue; } - CellValue actualValue = evaluator.evaluate(c); HSSFCell expectedValueCell = r.getCell(SS.COLUMN_INDEX_EXPECTED_RESULT); String msgPrefix = formatTestCaseDetails(sheetName, r.getRowNum(), c); try { + CellValue actualValue = evaluator.evaluate(c); confirmExpectedResult(msgPrefix, expectedValueCell, actualValue); _evaluationSuccessCount ++; if(result != Result.SOME_EVALUATIONS_FAILED) { @@ -193,14 +193,13 @@ } } catch (RuntimeException e) { _evaluationFailureCount ++; - printShortStackTrace(System.err, e); + printShortStackTrace(System.err, e, msgPrefix); result = Result.SOME_EVALUATIONS_FAILED; } catch (AssertionFailedError e) { _evaluationFailureCount ++; - printShortStackTrace(System.err, e); + printShortStackTrace(System.err, e, msgPrefix); result = Result.SOME_EVALUATIONS_FAILED; } - } } @@ -210,14 +209,15 @@ StringBuffer sb = new StringBuffer(); CellReference cr = new CellReference(sheetName, rowIndex, c.getColumnIndex(), false, false); sb.append(cr.formatAsString()); - sb.append(" {=").append(c.getCellFormula()).append("}"); + sb.append(" [formula: ").append(c.getCellFormula()).append(" ]"); return sb.toString(); } /** * Useful to keep output concise when expecting many failures to be reported by this test case */ - private static void printShortStackTrace(PrintStream ps, Throwable e) { + private static void printShortStackTrace(PrintStream ps, Throwable e, String msgPrefix) { + System.err.println("Problem with " + msgPrefix); StackTraceElement[] stes = e.getStackTrace(); int startIx = 0; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org