harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
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 GMT
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); 



Mime
View raw message