Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 45102 invoked from network); 4 Sep 2009 12:52:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Sep 2009 12:52:54 -0000 Received: (qmail 7863 invoked by uid 500); 4 Sep 2009 12:52:54 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 7824 invoked by uid 500); 4 Sep 2009 12:52:53 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 7814 invoked by uid 99); 4 Sep 2009 12:52:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2009 12:52: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; Fri, 04 Sep 2009 12:52:51 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CCA7C23888E6; Fri, 4 Sep 2009 12:52:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r811374 - /harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java Date: Fri, 04 Sep 2009 12:52:31 -0000 To: commits@harmony.apache.org From: tellison@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090904125231.CCA7C23888E6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tellison Date: Fri Sep 4 12:52:31 2009 New Revision: 811374 URL: http://svn.apache.org/viewvc?rev=811374&view=rev Log: Regression test for HARMONY-6334 ([classlib] [text] java.text.Format#parseObject(String) does not behave as expected) Modified: harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java Modified: harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java?rev=811374&r1=811373&r2=811374&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java (original) +++ harmony/enhanced/classlib/trunk/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java Fri Sep 4 12:52:31 2009 @@ -648,9 +648,6 @@ * java.text.ParsePosition) */ public void test_parseLjava_lang_StringLjava_text_ParsePosition() { - // Test for method java.lang.Object [] - // java.text.MessageFormat.parse(java.lang.String, - // java.text.ParsePosition) MessageFormat format = new MessageFormat("date is {0,date,MMM d, yyyy}"); ParsePosition pos = new ParsePosition(2); Object[] result = (Object[]) format @@ -669,6 +666,13 @@ String parse = "a; b; c"; result = mf.parse(parse, new ParsePosition(0)); assertEquals("Wrong variable result", "c", result[0]); + + mf = new MessageFormat("before {0}, after {1,number}"); + parse = "before you, after 42"; + pos.setIndex(0); + pos.setErrorIndex(8); + result = mf.parse(parse, pos); + assertEquals(2, result.length); } /** @@ -727,10 +731,6 @@ Locale.setDefault(defaultLocale); } - - - - /** * @tests java.text.MessageFormat(java.util.Locale) */ @@ -754,6 +754,7 @@ assertEquals("Assert 0: incorrect size of parsed data ", 1, res.length); assertEquals("Assert 1: parsed value incorrectly", new Long(10000), (Long)res[0]); } + public void test_format_Object() { // Regression for HARMONY-1875 Locale.setDefault(Locale.CANADA);