< prev index next >

test/jdk/java/text/Format/CompactNumberFormat/TestCompactNumber.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -20,11 +20,11 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 /*
  * @test
- * @bug 8177552
+ * @bug 8177552 8217721
  * @summary Checks the functioning of compact number format
  * @modules jdk.localedata
  * @run testng/othervm TestCompactNumber
  */
 import java.math.BigDecimal;

@@ -526,10 +526,15 @@
                 .getCompactNumberInstance(l, NumberFormat.Style.SHORT).format(10000));
         Stream.of(NumberFormat.getAvailableLocales()).forEach(l -> NumberFormat
                 .getCompactNumberInstance(l, NumberFormat.Style.LONG).format(10000));
     }
 
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testFormatWithNullParam() {
+        FORMAT_EN_US_SHORT.format(null);
+    }
+
     @Test(dataProvider = "format")
     public void testFormat(NumberFormat cnf, Object number,
             String expected) {
         CompactFormatAndParseHelper.testFormat(cnf, number, expected);
     }
< prev index next >