harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r1002988 - /harmony/enhanced/java/trunk/classlib/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java
Date Thu, 30 Sep 2010 10:13:03 GMT
Author: odeakin
Date: Thu Sep 30 10:13:02 2010
New Revision: 1002988

URL: http://svn.apache.org/viewvc?rev=1002988&view=rev
Log:
Add some simple exception case tests.

Modified:
    harmony/enhanced/java/trunk/classlib/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java

Modified: harmony/enhanced/java/trunk/classlib/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java?rev=1002988&r1=1002987&r2=1002988&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java
Thu Sep 30 10:13:02 2010
@@ -84,6 +84,33 @@ public class NumberFormatTest extends ju
                 pos);
         assertEquals("Wrong result BD2: " + out, "51", out.toString());
 
+        try {
+            format.format(this, new StringBuffer(), pos);
+            fail("Should throw IllegalArgumentException");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
+
+        try {
+            format.format(null, new StringBuffer(), pos);
+            fail("Should throw IllegalArgumentException");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
+
+        try {
+            format.format(new Long(0), null, pos);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
+
+        try {
+            format.format(new Long(0), new StringBuffer(), null);
+            fail("Should throw NullPointerException");
+        } catch (NullPointerException e) {
+            // Expected
+        }
     }
 
     /**



Mime
View raw message