< prev index next >
test/java/text/Format/DateFormat/Bug4823811.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2008, 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.
--- 1,7 ----
/*
! * Copyright (c) 2008, 2016, 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.
*** 682,702 ****
System.out.println("*** DecimalFormat.format test in ar_EG");
testNumberFormatFormatting(nfEG, -123456789, "123,456,789-", "ar_EG");
testNumberFormatFormatting(nfEG, -456, "456-", "ar_EG");
System.out.println("*** DecimalFormat.parse test in ar_EG");
! testNumberFormatParsing(nfEG, "123-", new Long(-123), "ar_EG");
! testNumberFormatParsing(nfEG, "123--", new Long(-123), "ar_EG");
testNumberFormatParsingCheckException(nfEG, "-123", 0, "ar_EG");
System.out.println("*** DecimalFormat.format test in en_US");
testNumberFormatFormatting(nfUS, -123456789, "-123,456,789", "en_US");
testNumberFormatFormatting(nfUS, -456, "-456", "en_US");
System.out.println("*** DecimalFormat.parse test in en_US");
! testNumberFormatParsing(nfUS, "123-", new Long(123), "en_US");
! testNumberFormatParsing(nfUS, "-123", new Long(-123), "en_US");
testNumberFormatParsingCheckException(nfUS, "--123", 0, "en_US");
}
private static void testNumberFormatFormatting(NumberFormat nf,
int given,
--- 682,702 ----
System.out.println("*** DecimalFormat.format test in ar_EG");
testNumberFormatFormatting(nfEG, -123456789, "123,456,789-", "ar_EG");
testNumberFormatFormatting(nfEG, -456, "456-", "ar_EG");
System.out.println("*** DecimalFormat.parse test in ar_EG");
! testNumberFormatParsing(nfEG, "123-", -123L, "ar_EG");
! testNumberFormatParsing(nfEG, "123--",-123L, "ar_EG");
testNumberFormatParsingCheckException(nfEG, "-123", 0, "ar_EG");
System.out.println("*** DecimalFormat.format test in en_US");
testNumberFormatFormatting(nfUS, -123456789, "-123,456,789", "en_US");
testNumberFormatFormatting(nfUS, -456, "-456", "en_US");
System.out.println("*** DecimalFormat.parse test in en_US");
! testNumberFormatParsing(nfUS, "123-", 123L, "en_US");
! testNumberFormatParsing(nfUS, "-123",-123L, "en_US");
testNumberFormatParsingCheckException(nfUS, "--123", 0, "en_US");
}
private static void testNumberFormatFormatting(NumberFormat nf,
int given,
< prev index next >