Package org.apache.tapestry.form

Examples of org.apache.tapestry.form.IFormComponent


    }

    public void testInvalidFormat()
    {
        v.setValueTypeClass(Integer.class);
        IFormComponent field = newField("invalidFormat");

        replayControls();

        try
        {
View Full Code Here


    public void testOverrideInvalidNumericFormatMessage()
    {
        v.setValueTypeClass(Integer.class);
        v.setInvalidNumericFormatMessage("Dude, gimme a number for {0}.");

        IFormComponent field = newField("invalidFormat");

        replayControls();

        try
        {
View Full Code Here

    }

    private IFormComponent newField(String displayName, String name, IForm form)
    {
        MockControl control = newControl(IFormComponent.class);
        IFormComponent field = (IFormComponent) control.getMock();

        field.getForm();
        control.setReturnValue(form);

        field.getName();
        control.setReturnValue(name);

        field.getDisplayName();
        control.setReturnValue(displayName, 2);

        field.getForm();
        control.setReturnValue(form);

        return field;
    }
View Full Code Here

    public void testInvalidInput()
    {
        IForm form = newForm(3);

        MockControl control = newControl(IFormComponent.class);
        IFormComponent field = (IFormComponent) control.getMock();

        field.getForm();
        control.setReturnValue(form, 2);

        field.getName();
        control.setReturnValue("testAdd");

        field.getForm();
        control.setReturnValue(form);

        field.getName();
        control.setReturnValue("testAdd");

        replayControls();

        String errorMessage = "Need a bigger one.";
View Full Code Here

    public void testValidatorErrorRenderer()
    {
        IForm form = newForm(3);

        MockControl control = newControl(IFormComponent.class);
        IFormComponent field = (IFormComponent) control.getMock();

        field.getForm();
        control.setReturnValue(form, 2);

        field.getName();
        control.setReturnValue("testValidatorErrorRenderer");

        field.getForm();
        control.setReturnValue(form);

        field.getName();
        control.setReturnValue("testValidatorErrorRenderer");

        replayControls();

        IRender errorRenderer = new RenderString("Just don't like it.");
View Full Code Here

    public void testNoError()
    {
        IForm form = newForm(2);

        MockControl control = newControl(IFormComponent.class);
        IFormComponent field = (IFormComponent) control.getMock();

        field.getForm();
        control.setReturnValue(form, 2);

        field.getName();
        control.setReturnValue("input");

        replayControls();

        d.setFormComponent(field);
View Full Code Here

    public void testUnassociatedErrors()
    {
        IForm form = newForm(2);

        MockControl control = newControl(IFormComponent.class);
        IFormComponent field = (IFormComponent) control.getMock();

        field.getForm();
        control.setReturnValue(form, 2);

        field.getName();
        control.setReturnValue("input");

        replayControls();

        d.setFormComponent(field);
View Full Code Here

    public void testMultipleInvalidInput()
    {
        IForm form = newForm(6);

        MockControl c1 = newControl(IFormComponent.class);
        IFormComponent f1 = (IFormComponent) c1.getMock();

        MockControl c2 = newControl(IFormComponent.class);
        IFormComponent f2 = (IFormComponent) c2.getMock();

        f1.getForm();
        c1.setReturnValue(form, 2);

        f1.getName();
        c1.setReturnValue("monty");

        f1.getForm();
        c1.setReturnValue(form);

        f1.getName();
        c1.setReturnValue("monty");

        f2.getForm();
        c2.setReturnValue(form);

        f2.getName();
        c2.setReturnValue("python");

        f2.getForm();
        c2.setReturnValue(form);

        f2.getName();
        c2.setReturnValue("python");

        f2.getForm();
        c2.setReturnValue(form);

        f2.getName();
        c2.setReturnValue("python");

        replayControls();

        String e1 = "And now for something completely different.";
View Full Code Here

    public void testReset()
    {
        IForm form = newForm(8);

        MockControl c1 = newControl(IFormComponent.class);
        IFormComponent f1 = (IFormComponent) c1.getMock();

        MockControl c2 = newControl(IFormComponent.class);
        IFormComponent f2 = (IFormComponent) c2.getMock();

        f1.getForm();
        c1.setReturnValue(form, 2);

        f1.getName();
        c1.setReturnValue("monty");

        f1.getForm();
        c1.setReturnValue(form);

        f1.getName();
        c1.setReturnValue("monty");

        f2.getForm();
        c2.setReturnValue(form);

        f2.getName();
        c2.setReturnValue("python");

        f2.getForm();
        c2.setReturnValue(form);

        f2.getName();
        c2.setReturnValue("python");

        f2.getForm();
        c2.setReturnValue(form);

        f2.getName();
        c2.setReturnValue("python");

        f1.getForm();
        c1.setReturnValue(form);
View Full Code Here

    public void testResetAll()
    {
        IForm form = newForm(8);

        MockControl c1 = newControl(IFormComponent.class);
        IFormComponent f1 = (IFormComponent) c1.getMock();

        MockControl c2 = newControl(IFormComponent.class);
        IFormComponent f2 = (IFormComponent) c2.getMock();

        f1.getForm();
        c1.setReturnValue(form, 2);

        f1.getName();
        c1.setReturnValue("monty");

        f1.getForm();
        c1.setReturnValue(form);

        f1.getName();
        c1.setReturnValue("monty");

        f2.getForm();
        c2.setReturnValue(form);

        f2.getName();
        c2.setReturnValue("python");

        f2.getForm();
        c2.setReturnValue(form);

        f2.getName();
        c2.setReturnValue("python");

        f2.getForm();
        c2.setReturnValue(form);

        f2.getName();
        c2.setReturnValue("python");

        f1.getForm();
        c1.setReturnValue(form);

        f2.getForm();
        c2.setReturnValue(form);

        replayControls();

        String e1 = "And now for something completely different.";
View Full Code Here

TOP

Related Classes of org.apache.tapestry.form.IFormComponent

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.