Package org.apache.tapestry

Examples of org.apache.tapestry.Field


public class MinTest extends InternalBaseTestCase
{
    @Test
    public void large_enough() throws Exception
    {
        Field field = mockField();
        MessageFormatter formatter = mockMessageFormatter();
        Long constraint = 50l;

        replay();
View Full Code Here


    @Test
    public void value_too_small() throws Exception
    {
        String label = "My Field";
        Field field = mockFieldWithLabel(label);
        MessageFormatter formatter = mockMessageFormatter();
        String message = "{message}";
        Long constraint = 100l;
        Number value = 99;
View Full Code Here

public class MaxTest extends InternalBaseTestCase
{
    @Test
    public void small_enough() throws Exception
    {
        Field field = mockField();
        MessageFormatter formatter = mockMessageFormatter();
        Long constraint = 50l;

        replay();
View Full Code Here

    @Test
    public void value_too_large() throws Exception
    {
        String label = "My Field";
        Field field = mockFieldWithLabel(label);
        MessageFormatter formatter = mockMessageFormatter();
        String message = "{message}";
        Long constraint = 100l;
        Number value = 101;
View Full Code Here

        return newMock(FieldValidatorSource.class);
    }

    protected final Field mockFieldWithLabel(String label)
    {
        Field field = mockField();

        train_getLabel(field, label);

        return field;
    }
View Full Code Here

    }

    @Test
    public void add_validations()
    {
        Field barney = mockField();
        ClientBehaviorSupport clientBehaviorSupport = mockClientBehaviorSupport();

        clientBehaviorSupport.addValidation(barney, "required", "Who can live without Barney?", null);

        replay();
View Full Code Here

    }

    @Test
    public void add_validation_when_client_validation_is_disabled()
    {
        Field barney = mockField();
        ClientBehaviorSupport clientBehaviorSupport = mockClientBehaviorSupport();

        replay();

        FormSupportImpl support = new FormSupportImpl(null, null, clientBehaviorSupport, false);
View Full Code Here

{
    @SuppressWarnings("unchecked")
    @Test
    public void null_value_skipped() throws Exception
    {
        Field field = mockField();
        MessageFormatter formatter = mockMessageFormatter();
        Validator validator = mockValidator();

        train_isRequired(validator, false);
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void blank_value_skipped() throws Exception
    {
        Field field = mockField();
        MessageFormatter formatter = mockMessageFormatter();
        Validator validator = mockValidator();

        train_isRequired(validator, false);
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void nonmatching_value_type_skipped() throws Exception
    {
        Field field = mockField();
        MessageFormatter formatter = mockMessageFormatter();
        Validator validator = mockValidator();
        Integer value = 15;

        train_isRequired(validator, true);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.Field

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.