Package org.richfaces.component.behavior

Examples of org.richfaces.component.behavior.AnonymousFunctionCall


public class AnonymousFunctionCallTest {
    // -------------------------- OTHER METHODS --------------------------

    @Test
    public void args2values2() {
        Assert.assertEquals("(function(a,b){alert(a+b)})(1,2)", new AnonymousFunctionCall("a", "b").addParameterValue(1, 2)
                .addToBody("alert(a+b)").toScript());
        Assert.assertEquals("(function(a,b){alert(a+b)})(1,2)", new AnonymousFunctionCall().addParameterName("a", "b")
                .addParameterValue(1, 2).addToBody("alert(a+b)").toScript());
        Assert.assertEquals("(function(a,b){alert(a+b)})(1,2)", new AnonymousFunctionCall().addParameterName("a")
                .addParameterName("b").addParameterValue(1, 2).addToBody("alert(a+b)").toScript());
    }
View Full Code Here


                .addParameterName("b").addParameterValue(1, 2).addToBody("alert(a+b)").toScript());
    }

    @Test
    public void args2values3() {
        Assert.assertEquals("(function(a,b){alert(a+b)})(1,2,3)", new AnonymousFunctionCall("a", "b")
                .addParameterValue(1, 2, 3).addToBody("alert(a+b)").toScript());
    }
View Full Code Here

    }

    @Test
    public void args3values2() {
        Assert.assertEquals("(function(a,b,c){alert(a+b)})(1,2)",
                new AnonymousFunctionCall("a", "b", "c").addParameterValue(1, 2).addToBody("alert(a+b)").toScript());
    }
View Full Code Here

                new AnonymousFunctionCall("a", "b", "c").addParameterValue(1, 2).addToBody("alert(a+b)").toScript());
    }

    @Test
    public void noArgs() {
        Assert.assertEquals("(function(){alert(123)})()", new AnonymousFunctionCall().addToBody("alert(123)").toScript());
    }
View Full Code Here

        Assert.assertEquals("(function(){alert(123)})()", new AnonymousFunctionCall().addToBody("alert(123)").toScript());
    }

    @Test
    public void noArgsNoBody() {
        Assert.assertEquals("(function(){})()", new AnonymousFunctionCall().toScript());
    }
View Full Code Here

TOP

Related Classes of org.richfaces.component.behavior.AnonymousFunctionCall

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.