Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 31059 invoked from network); 26 Jun 2005 09:59:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jun 2005 09:59:46 -0000 Received: (qmail 29217 invoked by uid 500); 26 Jun 2005 09:59:34 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 29081 invoked by uid 500); 26 Jun 2005 09:59:33 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 29062 invoked by uid 500); 26 Jun 2005 09:59:33 -0000 Received: (qmail 29050 invoked by uid 99); 26 Jun 2005 09:59:33 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 26 Jun 2005 02:59:33 -0700 Received: (qmail 28484 invoked by uid 1569); 26 Jun 2005 09:59:26 -0000 Message-ID: <20050626095926.28473.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r201820 - /jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/MathExceptionTest.java Date: Sun, 26 Jun 2005 09:59:26 -0000 To: commons-cvs@jakarta.apache.org From: psteitz@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: psteitz Date: Sat Jun 25 20:26:42 2005 New Revision: 201820 URL: http://svn.apache.org/viewcvs?rev=201820&view=rev Log: Emasculated MathException secalization test to work under jdk 1.3. Modified: jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/MathExceptionTest.java Modified: jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/MathExceptionTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/MathExceptionTest.java?rev=201820&r1=201819&r2=201820&view=diff ============================================================================== --- jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/MathExceptionTest.java (original) +++ jakarta/commons/proper/math/trunk/src/test/org/apache/commons/math/MathExceptionTest.java Sat Jun 25 20:26:42 2005 @@ -113,6 +113,22 @@ PrintWriter pw2 = new PrintWriter(ps2, true); image.printStackTrace(ps2); String stack2 = baos2.toString(); - assertEquals(stack, stack2); + + // See if JDK supports nested exceptions. If not, stack trace of + // inner exception will not be serialized + boolean jdkSupportsNesting = false; + try { + Throwable.class.getDeclaredMethod("getCause", new Class[0]); + jdkSupportsNesting = true; + } catch (NoSuchMethodException e) { + jdkSupportsNesting = false; + } + + if (jdkSupportsNesting) { + assertEquals(stack, stack2); + } else { + assertTrue(stack2.indexOf(inMsg) != -1); + assertTrue(stack2.indexOf("MathConfigurationException") != -1); + } } } --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org