1000000000000L, 1000000000000L, 1000000000000L};
long[] divisors_err = new long[] {
0,0,0,
- 13, 13, 13,
- 1000000, 1000000, 1000000,
- 1000000000L, 1000000000L, 1000000000L,
+ 13, 13, 13,
+ 1000000, 1000000, 1000000,
+ 1000000000L, 1000000000L, 1000000000L,
1000000000000L, 1000000000000L, 1000000000000L};
checkCore(affixes, null, divisors, TestACoreCompactFormatList);
checkCore(affixes, currencyAffixes, divisors, TestACoreCompactFormatListCurrency);
assertEquals("BigDecimal format wrong: ", "31,000,000,000,000 trillion",
cdf.format(source_dec));
}
-
+
@Test
public void TestParsing() {
CompactDecimalFormat cdf = CompactDecimalFormat.getInstance(
public void TestReadObject() throws IOException, ClassNotFoundException {
FileInputStream fi_stream = new FileInputStream("tmp.ser");
ObjectInputStream objinstream = new ObjectInputStream(fi_stream);
- CompactDecimalFormat cdf = CompactDecimalFormat.getInstance(
- ULocale.ENGLISH, CompactStyle.LONG);
- try{
+ try {
+ @SuppressWarnings("unused")
CompactDecimalFormat cmpctDF = (CompactDecimalFormat) objinstream.readObject();
- } catch (NotSerializableException e) {
+ } catch (NotSerializableException e) {
// Exception expected, thus return.
objinstream.close();
return;
- }
- objinstream.close();
- fail("readObject currently unsupported, expected invokation to fail but passed");
+ }
+ objinstream.close();
+ fail("readObject currently unsupported, expected invokation to fail but passed");
}
-
+
@Test
public void TestBug12422() {
CompactDecimalFormat cdf;
// Deutschmark available from first millisecond on
assertEquals("Millisecond of DEM Big Bang", 1,
- metainfo.currencyInfo(filter.onDate(demFirstDate).withRegion("DE")).size());
+ metainfo.currencyInfo(CurrencyFilter.onDate(demFirstDate).withRegion("DE")).size());
assertEquals("From Deutschmark to Euro", 2,
- metainfo.currencyInfo(filter.onDateRange(demFirstDate, eurFirstDate).withRegion("DE")).size());
+ metainfo.currencyInfo(CurrencyFilter.onDateRange(demFirstDate, eurFirstDate).withRegion("DE")).size());
assertEquals("all Tender for Brazil", 7,
- metainfo.currencyInfo(filter_br.onTender().withRegion("BR")).size());
+ metainfo.currencyInfo(CurrencyFilter.onTender().withRegion("BR")).size());
- assertTrue("No legal tender", demInfo.isTender());
+ assertTrue("No legal tender", demInfo.isTender());
}
@Test
assertEquals("getDisplayName() for " + data[0] + " in locale " + root, data[0], cur.getDisplayName(root));
}
}
-
+
@Test
public void TestCurrencyInfoCtor() {
new CurrencyMetaInfo.CurrencyInfo("region", "code", 0, 0, 1);
public void TestCurrMetaInfoBaseClass() {
CurrencyFilter usFilter = CurrencyFilter.onRegion("US");
- List<CurrencyInfo> listCurrInfo = tcurrMetaInfo.currencyInfo(usFilter);
assertEquals("Empty list expected", 0, tcurrMetaInfo.currencyInfo(usFilter).size());
assertEquals("Empty list expected", 0, tcurrMetaInfo.currencies(usFilter).size());
assertEquals("Empty list expected", 0, tcurrMetaInfo.regions(usFilter).size());