Package org.apache.tapestry.form.translator

Examples of org.apache.tapestry.form.translator.Translator


    }

    public void testRender()
    {
        MockControl translatorc = newControl(Translator.class);
        Translator translator = (Translator) translatorc.getMock();

        MockControl supportc = newControl(ValidatableFieldSupport.class);
        ValidatableFieldSupport support = (ValidatableFieldSupport) supportc.getMock();

        TextArea component = (TextArea) newInstance(
View Full Code Here


    }

    public void testRenderValue()
    {
        MockControl translatorc = newControl(Translator.class);
        Translator translator = (Translator) translatorc.getMock();

        MockControl validatableFieldSupportc = newControl(ValidatableFieldSupport.class);
        ValidatableFieldSupport validatableFieldSupport = (ValidatableFieldSupport) validatableFieldSupportc
                .getMock();
View Full Code Here

    }

    public void testRenderDisabled()
    {
        MockControl translatorc = newControl(Translator.class);
        Translator translator = (Translator) translatorc.getMock();

        MockControl validatableFieldSupportc = newControl(ValidatableFieldSupport.class);
        ValidatableFieldSupport validatableFieldSupport = (ValidatableFieldSupport) validatableFieldSupportc
                .getMock();
View Full Code Here

    }

    public void testRenderWithInformalParameters()
    {
        MockControl translatorc = newControl(Translator.class);
        Translator translator = (Translator) translatorc.getMock();

        MockControl validatableFieldSupportc = newControl(ValidatableFieldSupport.class);
        ValidatableFieldSupport validatableFieldSupport = (ValidatableFieldSupport) validatableFieldSupportc
                .getMock();
View Full Code Here

    }

    public void testRenderNullValue()
    {
        MockControl translatorc = newControl(Translator.class);
        Translator translator = (Translator) translatorc.getMock();

        MockControl validatableFieldSupportc = newControl(ValidatableFieldSupport.class);
        ValidatableFieldSupport validatableFieldSupport = (ValidatableFieldSupport) validatableFieldSupportc
                .getMock();
View Full Code Here

       
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle(field);
       
        MockControl translatorControl = newControl(Translator.class);
        Translator translator = (Translator) translatorControl.getMock();
       
        field.getForm();
        fieldControl.setReturnValue(form);

        form.isClientValidationEnabled();
        formControl.setReturnValue(true);

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

        form.getName();
        formControl.setReturnValue("myform");

        field.getName();
        fieldControl.setReturnValue("myfield");

        field.getTranslator();
        fieldControl.setReturnValue(translator);
       
        translator.renderContribution(writer, cycle, new FormComponentContributorContextImpl(field), field);
        translatorControl.setMatcher(new AggregateArgumentsMatcher(new ArgumentMatcher[]
        { new EqualsMatcher(), new EqualsMatcher(), new TypeMatcher(), new EqualsMatcher() }));
       
        replayControls();
View Full Code Here

       
        MockControl delegateControl = newControl(IValidationDelegate.class);
        IValidationDelegate delegate = (IValidationDelegate) delegateControl.getMock();
       
        MockControl translatorControl = newControl(Translator.class);
        Translator translator = (Translator) translatorControl.getMock();

        Object object = new Object();
        String expected = "result";

        field.getForm();
        fieldControl.setReturnValue(form);
       
        form.getDelegate();
        formControl.setReturnValue(delegate);
       
        delegate.isInError();
        delegateControl.setReturnValue(false);
       
        field.getTranslator();
        fieldControl.setReturnValue(translator);
       
        translator.format(field, object);
        translatorControl.setReturnValue(expected);
       
        replayControls();
       
        String result = support.format(field, object);
View Full Code Here

       
        MockControl delegateControl = newControl(IValidationDelegate.class);
        IValidationDelegate delegate = (IValidationDelegate) delegateControl.getMock();
       
        MockControl translatorControl = newControl(Translator.class);
        Translator translator = (Translator) translatorControl.getMock();

        String text = "test";
        Object expected = new Object();

        field.getForm();
        fieldControl.setReturnValue(form);
       
        form.getDelegate();
        formControl.setReturnValue(delegate);
       
        delegate.recordFieldInputValue(text);
       
        field.getTranslator();
        fieldControl.setReturnValue(translator);
       
        try
        {
            translator.parse(field, text);
            translatorControl.setReturnValue(expected);
           
            replayControls();
           
            Object result = support.parse(field, text);
View Full Code Here

       
        MockControl delegateControl = newControl(IValidationDelegate.class);
        IValidationDelegate delegate = (IValidationDelegate) delegateControl.getMock();
       
        MockControl translatorControl = newControl(Translator.class);
        Translator translator = (Translator) translatorControl.getMock();

        String text = "test";

        field.getForm();
        fieldControl.setReturnValue(form);
       
        form.getDelegate();
        formControl.setReturnValue(delegate);
       
        delegate.recordFieldInputValue(text);
       
        field.getTranslator();
        fieldControl.setReturnValue(translator);
       
        ValidatorException expected = new ValidatorException("Failure");
       
        try
        {
            translator.parse(field, text);
            translatorControl.setThrowable(expected);

            replayControls();
           
            support.parse(field, text);
View Full Code Here

        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle(field);

        MockControl translatorControl = newControl(Translator.class);
        Translator translator = (Translator) translatorControl.getMock();

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

        form.isClientValidationEnabled();
        formControl.setReturnValue(true);

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

        form.getName();
        formControl.setReturnValue("myform");

        field.getTranslator();
        fieldControl.setReturnValue(translator);

        translator.renderContribution(
                writer,
                cycle,
                new FormComponentContributorContextImpl(field),
                field);
        translatorControl.setMatcher(new AggregateArgumentsMatcher(new ArgumentMatcher[]
View Full Code Here

TOP

Related Classes of org.apache.tapestry.form.translator.Translator

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.