Package com.habitsoft.kiyaa.server

Examples of com.habitsoft.kiyaa.server.ServerLocalizedParser


import com.habitsoft.kiyaa.test.util.GwtTestLocalizedParser;

public class TestServerLocalizedParser extends TestCase {

    public void testCurrencyFormatting() throws Exception {
        ServerLocalizedParser parser = new ServerLocalizedParser(Locale.US);
        GwtTestLocalizedParser.assertEquals("$1.23", parser.formatCurrency(123, "USD", false, false));
        GwtTestLocalizedParser.assertEquals(-123, parser.parseCurrency("($1.23)", "USD"));
        GwtTestLocalizedParser.assertEquals(123, parser.parseCurrency("$1.23", "USD"));
        /* None of these are supported - the parser is very strict
        assertEquals(123, parser.parseCurrency("$-1.23", "USD"));
        assertEquals(123, parser.parseCurrency("$1.23", "USD"));
        assertEquals(123, parser.parseCurrency("1.23", "USD"));
        assertEquals(120, parser.parseCurrency("1.2", "USD"));
View Full Code Here


        //assertEquals("CAD1.23", parser.formatCurrency(123, "CAD", false, false));
        //assertEquals("INR123", parser.formatCurrency(123, "INR", false, false));
    }
   
    public void testPercentages() {
        GwtTestLocalizedParser.testPercentages(new ServerLocalizedParser(Locale.US));
    }
View Full Code Here

TOP

Related Classes of com.habitsoft.kiyaa.server.ServerLocalizedParser

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.