Examples of interpolate()


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

        Assert.assertEquals(interpolator.interpolate("{1}", "bad", "{0}"), "{0}");
       
        // this tests that embedded {} expressions are parsed correctly.
        Assert.assertEquals(interpolator.interpolate(CHOICE_EXPR, 0), "There are no files.");
        Assert.assertEquals(interpolator.interpolate(CHOICE_EXPR, 1), "There is one file.");
        Assert.assertEquals(interpolator.interpolate(CHOICE_EXPR, 2), "There are 2 files.");

        // test sequences of multiple #
        Assert.assertEquals(interpolator.interpolate("#0",2), "2");
        Assert.assertEquals(interpolator.interpolate("##0",2), "#2");
        Assert.assertEquals(interpolator.interpolate("###0",2), "##2");
View Full Code Here

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

        Assert.assertEquals(interpolator.interpolate(CHOICE_EXPR, 0), "There are no files.");
        Assert.assertEquals(interpolator.interpolate(CHOICE_EXPR, 1), "There is one file.");
        Assert.assertEquals(interpolator.interpolate(CHOICE_EXPR, 2), "There are 2 files.");

        // test sequences of multiple #
        Assert.assertEquals(interpolator.interpolate("#0",2), "2");
        Assert.assertEquals(interpolator.interpolate("##0",2), "#2");
        Assert.assertEquals(interpolator.interpolate("###0",2), "##2");
       
        // test a value expression in the mix
        Contexts.getEventContext().set("contextVariable", "value");
View Full Code Here

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

        Assert.assertEquals(interpolator.interpolate(CHOICE_EXPR, 1), "There is one file.");
        Assert.assertEquals(interpolator.interpolate(CHOICE_EXPR, 2), "There are 2 files.");

        // test sequences of multiple #
        Assert.assertEquals(interpolator.interpolate("#0",2), "2");
        Assert.assertEquals(interpolator.interpolate("##0",2), "#2");
        Assert.assertEquals(interpolator.interpolate("###0",2), "##2");
       
        // test a value expression in the mix
        Contexts.getEventContext().set("contextVariable", "value");
        Assert.assertEquals(interpolator.interpolate("#{contextVariable}"), "value");
View Full Code Here

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

        Assert.assertEquals(interpolator.interpolate(CHOICE_EXPR, 2), "There are 2 files.");

        // test sequences of multiple #
        Assert.assertEquals(interpolator.interpolate("#0",2), "2");
        Assert.assertEquals(interpolator.interpolate("##0",2), "#2");
        Assert.assertEquals(interpolator.interpolate("###0",2), "##2");
       
        // test a value expression in the mix
        Contexts.getEventContext().set("contextVariable", "value");
        Assert.assertEquals(interpolator.interpolate("#{contextVariable}"), "value");
        Assert.assertEquals(interpolator.interpolate("#0 #{contextVariable} #1", "a", "z"), "a value z");
View Full Code Here

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

        Assert.assertEquals(interpolator.interpolate("##0",2), "#2");
        Assert.assertEquals(interpolator.interpolate("###0",2), "##2");
       
        // test a value expression in the mix
        Contexts.getEventContext().set("contextVariable", "value");
        Assert.assertEquals(interpolator.interpolate("#{contextVariable}"), "value");
        Assert.assertEquals(interpolator.interpolate("#0 #{contextVariable} #1", "a", "z"), "a value z");
        Assert.assertEquals(interpolator.interpolate("#0 ##{contextVariable} #1", "a", "z"), "a #value z");
       
        Date date = new Date(0);
               
View Full Code Here

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

        Assert.assertEquals(interpolator.interpolate("###0",2), "##2");
       
        // test a value expression in the mix
        Contexts.getEventContext().set("contextVariable", "value");
        Assert.assertEquals(interpolator.interpolate("#{contextVariable}"), "value");
        Assert.assertEquals(interpolator.interpolate("#0 #{contextVariable} #1", "a", "z"), "a value z");
        Assert.assertEquals(interpolator.interpolate("#0 ##{contextVariable} #1", "a", "z"), "a #value z");
       
        Date date = new Date(0);
               
        Assert.assertEquals(interpolator.interpolate("{0,date,short}", date), DateFormat.getDateInstance(DateFormat.SHORT).format(date));
View Full Code Here

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

       
        // test a value expression in the mix
        Contexts.getEventContext().set("contextVariable", "value");
        Assert.assertEquals(interpolator.interpolate("#{contextVariable}"), "value");
        Assert.assertEquals(interpolator.interpolate("#0 #{contextVariable} #1", "a", "z"), "a value z");
        Assert.assertEquals(interpolator.interpolate("#0 ##{contextVariable} #1", "a", "z"), "a #value z");
       
        Date date = new Date(0);
               
        Assert.assertEquals(interpolator.interpolate("{0,date,short}", date), DateFormat.getDateInstance(DateFormat.SHORT).format(date));
       
View Full Code Here

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

        Assert.assertEquals(interpolator.interpolate("#0 #{contextVariable} #1", "a", "z"), "a value z");
        Assert.assertEquals(interpolator.interpolate("#0 ##{contextVariable} #1", "a", "z"), "a #value z");
       
        Date date = new Date(0);
               
        Assert.assertEquals(interpolator.interpolate("{0,date,short}", date), DateFormat.getDateInstance(DateFormat.SHORT).format(date));
       
        // test that a messageformat error doesn't blow up
        Assert.assertEquals(interpolator.interpolate("{nosuchmessage}"), "{nosuchmessage}");
       
        try
View Full Code Here

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

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

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

        // test that a messageformat error doesn't blow up
        Assert.assertEquals(interpolator.interpolate("{nosuchmessage}"), "{nosuchmessage}");
       
        try
        {
            interpolator.interpolate("hello #{", (Object) null);
            Assert.fail("interpolator not raised an exception");
        } catch (Throwable t)
        {
           
        }
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.