You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by od...@apache.org on 2010/09/30 12:13:03 UTC
svn commit: r1002988 -
/harmony/enhanced/java/trunk/classlib/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/NumberFormatTest.java
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
+ }
}
/**