Package org.odftoolkit.odfdom.dom.element.number

Examples of org.odftoolkit.odfdom.dom.element.number.NumberCurrencySymbolElement


  public void testSetCurrencyLocale_String() {
    LOG.info("setCurrencyLocale");
    String locale = "ko-KR";
    String language = "ko";
    String country = "KR";
    NumberCurrencySymbolElement cSymbol;
    NodeList list;

    // first, test setting with a combined language/country
    OdfNumberCurrencyStyle instance = new OdfNumberCurrencyStyle(dom,
      "\u20a9", "\u20a9#,##0.00", "kstyle");
    instance.setCurrencyLocale(locale);
    list = instance.getElementsByTagNameNS(
      OdfDocumentNamespace.NUMBER.getUri(), "currency-symbol");
    Assert.assertTrue("Has currency symbol", list.getLength() > 0);
    cSymbol = (NumberCurrencySymbolElement) list.item(0);
    Assert.assertEquals(language, cSymbol.getNumberLanguageAttribute());
    Assert.assertEquals(country, cSymbol.getNumberCountryAttribute());

    // then, a language only
    instance = new OdfNumberCurrencyStyle(dom,
      "\u20a9", "\u20a9#,##0.00", "kstyle");
    instance.setCurrencyLocale(language);
    list = instance.getElementsByTagNameNS(
      OdfDocumentNamespace.NUMBER.getUri(), "currency-symbol");
    Assert.assertTrue("Has currency symbol", list.getLength() > 0);
    cSymbol = (NumberCurrencySymbolElement) list.item(0);
    Assert.assertEquals(language, cSymbol.getNumberLanguageAttribute());

  }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.number.NumberCurrencySymbolElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.