/** @tests java.text.DecimalFormatSymbols#setCurrency(java.util.Currency) */ @TestTargetNew( level = TestLevel.COMPLETE, notes = "", method = "setCurrency", args = {java.util.Currency.class}) public void test_setCurrencyLjava_util_Currency() { Locale locale = Locale.CANADA; DecimalFormatSymbols dfs = ((DecimalFormat) NumberFormat.getCurrencyInstance(locale)).getDecimalFormatSymbols(); try { dfs.setCurrency(null); fail("Expected NullPointerException"); } catch (NullPointerException e) { } Currency currency = Currency.getInstance("JPY"); dfs.setCurrency(currency); assertTrue("Returned incorrect currency", currency == dfs.getCurrency()); assertEquals( "Returned incorrect currency symbol", currency.getSymbol(locale), dfs.getCurrencySymbol()); assertTrue( "Returned incorrect international currency symbol", currency.getCurrencyCode().equals(dfs.getInternationalCurrencySymbol())); }