harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r814478 [3/3] - in /harmony/enhanced/classlib/branches/java6: ./ depends/build/ make/ modules/beans/make/ modules/beans/src/main/java/java/beans/ modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/ modules/beans/src/test/...
Date Mon, 14 Sep 2009 05:45:04 GMT
Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/org/apache/harmony/text/internal/nls/messages.properties
Mon Sep 14 05:45:00 2009
@@ -43,5 +43,8 @@
 text.18=Not a valid {0}, subclass should override readResolve()
 text.19=Unparseable date: {0}
 text.1A=position is null
-text.1B=All rows in time zone array must have length at least 5
-
+text.1B=MessageFormat.parseObject(String) parse failure
+text.1C=Format.parseObject(String) parse failure
+text.1D=Unparseable number: {0}
+text.1E=Offset out of bounds \: {0}
+text.1F=All rows in time zone array must have length at least 5

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MessageFormatTest.java
Mon Sep 14 05:45:00 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); 

Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/ParseExceptionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/ParseExceptionTest.java?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/ParseExceptionTest.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/ParseExceptionTest.java
Mon Sep 14 05:45:00 2009
@@ -19,48 +19,31 @@
 import java.text.DateFormat;
 import java.text.ParseException;
 
+@SuppressWarnings("nls")
 public class ParseExceptionTest extends junit.framework.TestCase {
 
-	/**
-	 * @tests java.text.ParseException#ParseException(java.lang.String, int)
-	 */
-	public void test_ConstructorLjava_lang_StringI() {
-		// Test for method java.text.ParseException(java.lang.String, int)
-		// SM
-		try {
-			DateFormat df = DateFormat.getInstance();
-			df.parse("HelloWorld");
-		} catch (ParseException e) {
-			return;
-		}
-		fail("ParseException not created/thrown.");
-	}
+    /**
+     * @tests java.text.ParseException#ParseException(java.lang.String, int)
+     */
+    public void test_ConstructorLjava_lang_StringI() {
+        try {
+            DateFormat df = DateFormat.getInstance();
+            df.parse("HelloWorld");
+            fail("ParseException not created/thrown.");
+        } catch (ParseException e) {
+            // expected
+        }
+    }
 
-	/**
-	 * @tests java.text.ParseException#getErrorOffset()
-	 */
-	public void test_getErrorOffset() {
-		// Test for method int java.text.ParseException.getErrorOffset()
-		// SM
-		try {
-			DateFormat df = DateFormat.getInstance();
-			df.parse("1999HelloWorld");
-		} catch (ParseException e) {
-			assertEquals("getErrorOffsetFailed.", 4, e.getErrorOffset());
-		}
-	}
-
-	/**
-	 * Sets up the fixture, for example, open a network connection. This method
-	 * is called before a test is executed.
-	 */
-	protected void setUp() {
-	}
-
-	/**
-	 * Tears down the fixture, for example, close a network connection. This
-	 * method is called after a test is executed.
-	 */
-	protected void tearDown() {
-	}
+    /**
+     * @tests java.text.ParseException#getErrorOffset()
+     */
+    public void test_getErrorOffset() {
+        try {
+            DateFormat df = DateFormat.getInstance();
+            df.parse("1999HelloWorld");
+        } catch (ParseException e) {
+            assertEquals("getErrorOffsetFailed.", 4, e.getErrorOffset());
+        }
+    }
 }

Modified: harmony/enhanced/classlib/branches/java6/support/src/test/java/tests/resources/Created_by_1_4.jar
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/support/src/test/java/tests/resources/Created_by_1_4.jar?rev=814478&r1=814477&r2=814478&view=diff
==============================================================================
Binary files - no diff available.



Mime
View raw message