Package org.apache.fop.util.text

Examples of org.apache.fop.util.text.AdvancedMessageFormat.format()


        format = new AdvancedMessageFormat("You are{isGood,if, very, not so} nice!");

        params = new java.util.HashMap();

        msg = format.format(params); //isGood is missing
        assertEquals("You are not so nice!", msg);

        params.put("isGood", Boolean.FALSE);
        msg = format.format(params);
        assertEquals("You are not so nice!", msg);
View Full Code Here


        msg = format.format(params); //isGood is missing
        assertEquals("You are not so nice!", msg);

        params.put("isGood", Boolean.FALSE);
        msg = format.format(params);
        assertEquals("You are not so nice!", msg);

        params.put("isGood", Boolean.TRUE);
        msg = format.format(params);
        assertEquals("You are very nice!", msg);
View Full Code Here

        params.put("isGood", Boolean.FALSE);
        msg = format.format(params);
        assertEquals("You are not so nice!", msg);

        params.put("isGood", Boolean.TRUE);
        msg = format.format(params);
        assertEquals("You are very nice!", msg);

        format = new AdvancedMessageFormat("You are{isGood,if, very\\, very} nice!");

        params = new java.util.HashMap();
View Full Code Here

        format = new AdvancedMessageFormat("You are{isGood,if, very\\, very} nice!");

        params = new java.util.HashMap();

        msg = format.format(params); //isGood is missing
        assertEquals("You are nice!", msg);

        params.put("isGood", Boolean.FALSE);
        msg = format.format(params);
        assertEquals("You are nice!", msg);
View Full Code Here

        msg = format.format(params); //isGood is missing
        assertEquals("You are nice!", msg);

        params.put("isGood", Boolean.FALSE);
        msg = format.format(params);
        assertEquals("You are nice!", msg);

        params.put("isGood", Boolean.TRUE);
        msg = format.format(params);
        assertEquals("You are very, very nice!", msg);
View Full Code Here

        params.put("isGood", Boolean.FALSE);
        msg = format.format(params);
        assertEquals("You are nice!", msg);

        params.put("isGood", Boolean.TRUE);
        msg = format.format(params);
        assertEquals("You are very, very nice!", msg);
    }

    @Test
    public void testEqualsFormatting() throws Exception {
View Full Code Here

                "Error{severity,equals,EventSeverity:FATAL,,\nSome explanation!}");

        Map params = new java.util.HashMap();

        params.put("severity", EventSeverity.FATAL);
        msg = format.format(params);
        assertEquals("Error", msg);

        params.put("severity", EventSeverity.WARN);
        msg = format.format(params);
        assertEquals("Error\nSome explanation!", msg);
View Full Code Here

        params.put("severity", EventSeverity.FATAL);
        msg = format.format(params);
        assertEquals("Error", msg);

        params.put("severity", EventSeverity.WARN);
        msg = format.format(params);
        assertEquals("Error\nSome explanation!", msg);
    }

    @Test
    public void testChoiceFormatting() throws Exception {
View Full Code Here

                "You have {amount,choice,0#nothing|0<{amount} bucks|100<more than enough}.");

        Map params = new java.util.HashMap();

        params.put("amount", new Integer(0));
        msg = format.format(params);
        assertEquals("You have nothing.", msg);

        params.put("amount", new Integer(7));
        msg = format.format(params);
        assertEquals("You have 7 bucks.", msg);
View Full Code Here

        params.put("amount", new Integer(0));
        msg = format.format(params);
        assertEquals("You have nothing.", msg);

        params.put("amount", new Integer(7));
        msg = format.format(params);
        assertEquals("You have 7 bucks.", msg);

        params.put("amount", new Integer(140));
        msg = format.format(params);
        assertEquals("You have more than enough.", msg);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.