Package org.apache.tapestry.form

Examples of org.apache.tapestry.form.ValidationMessages


    public void test_Null_Format()
    throws Exception
    {
        NumberTranslator translator = new NumberTranslator("pattern=0.00,omitZero");
        IFormComponent field = newField();
        ValidationMessages messages = newMock(ValidationMessages.class);
       
        replay();
       
        Number num = (Number)translator.parse(field, messages, "");
       
View Full Code Here


    private void testParse(Translator translator, String number, Number expected) throws Exception
    {
        IFormComponent field = newField();
       
        ValidationMessages messages = newMock(ValidationMessages.class);

        trainGetLocale(messages, Locale.ENGLISH);

        replay();
View Full Code Here

    private void testFailedParse(Translator translator, String messageOverride)
    {
        IFormComponent field = newField("Number Field");
       
        ValidationMessages messages = newMock(ValidationMessages.class);

        trainGetLocale(messages, Locale.ENGLISH);

        trainBuildMessage(
                messages,
View Full Code Here

public class TestEmail extends BaseValidatorTestCase
{
    public void test_OK() throws Exception
    {
        IFormComponent field = newField();
        ValidationMessages messages = newMessages();

        replay();

        new Email().validate(field, messages, "hlship@apache.org");
View Full Code Here

    }

    public void test_Ok_Single_Character() throws Exception
    {
        IFormComponent field = newField();
        ValidationMessages messages = newMessages();

        replay();
       
        Email email = new Email();
        email.validate(field, messages, "j@apache.org");
View Full Code Here

    }
   
    public void test_Fail()
    {
        IFormComponent field = newField("My Email");
        ValidationMessages messages = newMessages(
                null,
                ValidationStrings.INVALID_EMAIL,
                new Object[]
                { "My Email" },
                "default message");
View Full Code Here

    }

    public void test_Fail_Custom_Message()
    {
        IFormComponent field = newField("My Email");
        ValidationMessages messages = newMessages(
                "custom",
                ValidationStrings.INVALID_EMAIL,
                new Object[]
                { "My Email" },
                "custom message");
View Full Code Here

public class TestMin extends BaseValidatorTestCase
{
    public void test_OK() throws Exception
    {
        IFormComponent field = newField();
        ValidationMessages messages = newMessages();

        Integer object = new Integer(10);

        replay();
View Full Code Here

    }

    public void test_Fail()
    {
        IFormComponent field = newField("My Field");
        ValidationMessages messages = newMessages(
                null,
                ValidationStrings.VALUE_TOO_SMALL,
                new Object[]
                { "My Field", String.valueOf(new Double(10).doubleValue()) },
                "Exception!");

        expect(messages.getLocale()).andReturn(Locale.getDefault()).atLeastOnce();

        replay();

        try
        {
View Full Code Here

    }

    public void test_Fail_Custom_Message()
    {
        IFormComponent field = newField("My Field");
        ValidationMessages messages = newMessages(
                "custom",
                ValidationStrings.VALUE_TOO_SMALL,
                new Object[]
                { "My Field", String.valueOf(new Double(10).doubleValue()) },
                "custom message");

        expect(messages.getLocale()).andReturn(Locale.getDefault()).atLeastOnce();

        replay();

        try
        {
View Full Code Here

TOP

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

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.