Package org.jboss.seam.core

Examples of org.jboss.seam.core.Interpolator.interpolate()


        Assert.assertEquals("{0}", interpolator.interpolate("{1}", "bad", "{0}"));
       
        // this tests that embedded {} expressions are parsed correctly.
        Assert.assertEquals("There are no files.", interpolator.interpolate(CHOICE_EXPR, 0));
        Assert.assertEquals("There is one file.", interpolator.interpolate(CHOICE_EXPR, 1));
        Assert.assertEquals("There are 2 files.", interpolator.interpolate(CHOICE_EXPR, 2));
       
        Date date = new Date(0);
               
        Assert.assertEquals(DateFormat.getDateInstance(DateFormat.SHORT).format(date), interpolator.interpolate("{0,date,short}", date));
       
View Full Code Here


        Assert.assertEquals("There is one file.", interpolator.interpolate(CHOICE_EXPR, 1));
        Assert.assertEquals("There are 2 files.", interpolator.interpolate(CHOICE_EXPR, 2));
       
        Date date = new Date(0);
               
        Assert.assertEquals(DateFormat.getDateInstance(DateFormat.SHORT).format(date), interpolator.interpolate("{0,date,short}", date));
       
        // test that a messageformat error doesn't blow up
        Assert.assertEquals("{nosuchmessage}", interpolator.interpolate("{nosuchmessage}"));
       
        try {
View Full Code Here

        Date date = new Date(0);
               
        Assert.assertEquals(DateFormat.getDateInstance(DateFormat.SHORT).format(date), interpolator.interpolate("{0,date,short}", date));
       
        // test that a messageformat error doesn't blow up
        Assert.assertEquals("{nosuchmessage}", interpolator.interpolate("{nosuchmessage}"));
       
        try {
            interpolator.interpolate("hello #{", (Object) null);
        } catch (Throwable t) {
            Assert.fail("interpolator raised an exception");
View Full Code Here

       
        // test that a messageformat error doesn't blow up
        Assert.assertEquals("{nosuchmessage}", interpolator.interpolate("{nosuchmessage}"));
       
        try {
            interpolator.interpolate("hello #{", (Object) null);
        } catch (Throwable t) {
            Assert.fail("interpolator raised an exception");
        }
    }
View Full Code Here

    @Test
    public void testFail()
    {
        Interpolator interpolator = Interpolator.instance();

        Assert.assertEquals("3 5 7", interpolator.interpolate("#0 #1 #2", 3, 5, 7));
        Assert.assertEquals("3 5 7", interpolator.interpolate("{0} {1} {2}", 3, 5, 7));

        // this tests that the result of an expression evaluation is not evaluated again
        Assert.assertEquals("{0}", interpolator.interpolate("{1}", "bad", "{0}"));
       
View Full Code Here

    public void testFail()
    {
        Interpolator interpolator = Interpolator.instance();

        Assert.assertEquals("3 5 7", interpolator.interpolate("#0 #1 #2", 3, 5, 7));
        Assert.assertEquals("3 5 7", interpolator.interpolate("{0} {1} {2}", 3, 5, 7));

        // this tests that the result of an expression evaluation is not evaluated again
        Assert.assertEquals("{0}", interpolator.interpolate("{1}", "bad", "{0}"));
       
        // this tests that embedded {} expressions are parsed correctly.
View Full Code Here

        Assert.assertEquals("3 5 7", interpolator.interpolate("#0 #1 #2", 3, 5, 7));
        Assert.assertEquals("3 5 7", interpolator.interpolate("{0} {1} {2}", 3, 5, 7));

        // this tests that the result of an expression evaluation is not evaluated again
        Assert.assertEquals("{0}", interpolator.interpolate("{1}", "bad", "{0}"));
       
        // this tests that embedded {} expressions are parsed correctly.
        Assert.assertEquals("There are no files.", interpolator.interpolate(CHOICE_EXPR, 0));
        Assert.assertEquals("There is one file.", interpolator.interpolate(CHOICE_EXPR, 1));
        Assert.assertEquals("There are 2 files.", interpolator.interpolate(CHOICE_EXPR, 2));
View Full Code Here

        // this tests that the result of an expression evaluation is not evaluated again
        Assert.assertEquals("{0}", interpolator.interpolate("{1}", "bad", "{0}"));
       
        // this tests that embedded {} expressions are parsed correctly.
        Assert.assertEquals("There are no files.", interpolator.interpolate(CHOICE_EXPR, 0));
        Assert.assertEquals("There is one file.", interpolator.interpolate(CHOICE_EXPR, 1));
        Assert.assertEquals("There are 2 files.", interpolator.interpolate(CHOICE_EXPR, 2));
                  
        Assert.assertEquals("12/31/69", interpolator.interpolate("{0,date,short}", new Date(0)));
View Full Code Here

        // this tests that the result of an expression evaluation is not evaluated again
        Assert.assertEquals("{0}", interpolator.interpolate("{1}", "bad", "{0}"));
       
        // this tests that embedded {} expressions are parsed correctly.
        Assert.assertEquals("There are no files.", interpolator.interpolate(CHOICE_EXPR, 0));
        Assert.assertEquals("There is one file.", interpolator.interpolate(CHOICE_EXPR, 1));
        Assert.assertEquals("There are 2 files.", interpolator.interpolate(CHOICE_EXPR, 2));
                  
        Assert.assertEquals("12/31/69", interpolator.interpolate("{0,date,short}", new Date(0)));
       
View Full Code Here

        Assert.assertEquals("{0}", interpolator.interpolate("{1}", "bad", "{0}"));
       
        // this tests that embedded {} expressions are parsed correctly.
        Assert.assertEquals("There are no files.", interpolator.interpolate(CHOICE_EXPR, 0));
        Assert.assertEquals("There is one file.", interpolator.interpolate(CHOICE_EXPR, 1));
        Assert.assertEquals("There are 2 files.", interpolator.interpolate(CHOICE_EXPR, 2));
                  
        Assert.assertEquals("12/31/69", interpolator.interpolate("{0,date,short}", new Date(0)));
       
        // test that a messageformat error doesn't blow up
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.