Package org.apache.tapestry

Examples of org.apache.tapestry.Field


    @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


public class MaxLengthTest extends InternalBaseTestCase
{
    @Test
    public void short_enough() throws Exception
    {
        Field field = mockField();
        MessageFormatter formatter = mockMessageFormatter();
        String value = "Now the student has become the master.";

        replay();
View Full Code Here

    @Test
    public void long_value() throws Exception
    {
        String label = "My Field";
        Field field = mockFieldWithLabel(label);
        MessageFormatter formatter = mockMessageFormatter();
        String value = "Now the student has become the master.";
        String message = "{message}";
        Integer constraint = value.length() - 1;
View Full Code Here

    }

    @Test
    public void add_validations()
    {
        Field barney = newField("barney");
        Field fred = newField("fred");

        replay();

        FormSupportImpl support = new FormSupportImpl();
View Full Code Here

    }

    private Field newField(String clientId)
    {
        Field field = newMock(Field.class);

        expect(field.getClientId()).andReturn(clientId).atLeastOnce();

        return field;
    }
View Full Code Here

    @Test
    public void label_error_no_existing_class_attribute()
    {
        MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel(), null);
        Environment env = newEnvironment();
        Field field = newField();
        ValidationTracker tracker = newValidationTracker();

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, true);
View Full Code Here

    @Test
    public void label_error_with_existing_class_attribute()
    {
        MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel(), null);
        Environment env = newEnvironment();
        Field field = newField();
        ValidationTracker tracker = newValidationTracker();

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, true);
View Full Code Here

    @Test
    public void field_error()
    {
        MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel(), null);
        Environment env = newEnvironment();
        Field field = newField();
        ValidationTracker tracker = newValidationTracker();

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, true);
        train_peekRequired(env, MarkupWriter.class, writer);
View Full Code Here

    @Test
    public void field_ok()
    {
        Environment env = newEnvironment();
        Field field = newField();
        ValidationTracker tracker = newValidationTracker();

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, false);
View Full Code Here

    @Test
    public void label_when_field_not_in_error()
    {
        Environment env = newEnvironment();
        Field field = newField();
        ValidationTracker tracker = newValidationTracker();

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, false);
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.