Package org.apache.tapestry5

Examples of org.apache.tapestry5.FieldTranslator


        replay();

        FieldTranslatorSource source = new FieldTranslatorSourceImpl(ts, globalMessages, fs);

        FieldTranslator ft = source.createDefaultTranslator(field, "myfield", messages, locale, propertyType, ap);

        assertEquals(ft.getType(), Map.class);

        ft.render(writer);

        verify();
    }
View Full Code Here


        replay();

        FieldTranslatorSource source = new FieldTranslatorSourceImpl(ts, globalMessages, fs);

        FieldTranslator ft = source.createDefaultTranslator(field, "myfield", messages, locale, propertyType, ap);

        assertEquals(ft.getType(), Map.class);

        ft.render(writer);

        verify();
    }
View Full Code Here

        replay();

        FieldTranslatorSource source = new FieldTranslatorSourceImpl(ts, null, fs);

        FieldTranslator ft = source.createDefaultTranslator(field, "myfield", messages, locale, propertyType, ap);

        assertEquals(ft.getType(), Map.class);

        ft.render(writer);

        verify();
    }
View Full Code Here

        replay();

        FieldTranslatorSource source = new FieldTranslatorSourceImpl(ts, null, fs);

        FieldTranslator ft = source.createDefaultTranslator(field, "myfield", messages, locale, propertyType, ap);

        assertEquals(ft.getType(), Map.class);

        ft.render(writer);

        verify();
    }
View Full Code Here

        replay();

        FieldTranslatorSource source = new FieldTranslatorSourceImpl(ts, globalMessages, fs);

        FieldTranslator ft = source.createTranslator(resources, "map");

        assertEquals(ft.getType(), Map.class);

        ft.render(writer);

        verify();
    }
View Full Code Here

    @SuppressWarnings({"unchecked"})
    @Test
    public void parse_client_via_event() throws ValidationException
    {
        ComponentResources resources = mockComponentResources();
        FieldTranslator translator = mockFieldTranslator();
        NullFieldStrategy nullFieldStrategy = mockNullFieldStrategy();

        String clientValue = "abracadabra";

        IAnswer answer = new IAnswer()
View Full Code Here

    @Test
    public void parse_client_for_null_value_returns_null_and_bypasses_events_and_translator() throws Exception
    {
        ComponentResources resources = mockComponentResources();
        FieldTranslator translator = mockFieldTranslator();
        NullFieldStrategy nullFieldStrategy = mockNullFieldStrategy();

        String clientValue = "";

        train_replaceFromClient(nullFieldStrategy, "");

        ignoreEvent(resources, EventConstants.PARSE_CLIENT, clientValue);

        expect(translator.parse(clientValue)).andReturn("");

        replay();

        FieldValidationSupport support = new FieldValidationSupportImpl(typeCoercer);
View Full Code Here

    @SuppressWarnings({"ThrowableInstanceNeverThrown"})
    @Test
    public void parse_client_event_handler_throws_validation_exception() throws Exception
    {
        ComponentResources resources = mockComponentResources();
        FieldTranslator translator = mockFieldTranslator();
        ValidationException ve = new ValidationException("Just didn't feel right.");
        NullFieldStrategy nullFieldStrategy = mockNullFieldStrategy();

        String clientValue = "abracadabra";
View Full Code Here

    @SuppressWarnings({"ThrowableInstanceNeverThrown"})
    @Test
    public void parse_client_event_handler_fails_with_other_exception() throws Exception
    {
        ComponentResources resources = mockComponentResources();
        FieldTranslator translator = mockFieldTranslator();
        RuntimeException re = new RuntimeException("Just didn't feel right.");
        NullFieldStrategy nullFieldStrategy = mockNullFieldStrategy();

        String clientValue = "abracadabra";
View Full Code Here

    @Test
    public void parse_client_via_translator() throws ValidationException
    {
        ComponentResources resources = mockComponentResources();
        FieldTranslator translator = mockFieldTranslator();
        NullFieldStrategy nullFieldStrategy = mockNullFieldStrategy();

        String clientValue = "abracadabra";

        ignoreEvent(resources, EventConstants.PARSE_CLIENT, clientValue);

        expect(translator.parse(clientValue)).andReturn("foobar");

        replay();

        FieldValidationSupport support = new FieldValidationSupportImpl(typeCoercer);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.FieldTranslator

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.