Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.TranslatorSource


    {
        Field field = mockField();
        Messages messages = mockMessages();
        Locale locale = Locale.ENGLISH;
        Class propertyType = Map.class;
        TranslatorSource ts = mockTranslatorSource();
        ValidationMessagesSource vms = mockValidationMessagesSource();
        FormSupport fs = mockFormSupport();
        Translator translator = mockTranslator("maptrans", Map.class);
        MessageFormatter formatter = mockMessageFormatter();
        MarkupWriter writer = mockMarkupWriter();
View Full Code Here


    {
        ComponentResources resources = mockComponentResources();
        FieldComponent field = mockFieldComponent();
        Messages messages = mockMessages();
        Locale locale = Locale.ENGLISH;
        TranslatorSource ts = mockTranslatorSource();
        ValidationMessagesSource vms = mockValidationMessagesSource();
        FormSupport fs = mockFormSupport();
        Translator translator = mockTranslator("map", Map.class);
        Messages validationMessages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
View Full Code Here

    {
        Translator translator = mockTranslator("mock", String.class);

        replay();

        TranslatorSource source = new TranslatorSourceImpl(newConfiguration(String.class, translator));

        assertSame(source.get("mock"), translator);

        verify();
    }
View Full Code Here

        Map<String, Translator> alternates = CollectionFactory.newMap();
        alternates.put("barney", t2);

        replay();

        TranslatorSource source = new TranslatorSourceImpl(configuration, alternates);

        assertSame(source.get("barney"), t2);

        verify();
    }
View Full Code Here

        configuration.put(String.class, fred);
        configuration.put(Long.class, barney);

        replay();

        TranslatorSource source = new TranslatorSourceImpl(configuration);

        try
        {
            source.get("wilma");
            unreachable();
        }
        catch (UnknownValueException ex)
        {
            assertMessageContains(ex, "Unknown translator type 'wilma'.");
View Full Code Here

    {
        Translator t = mockTranslator("string", String.class);

        replay();

        TranslatorSource source = new TranslatorSourceImpl(newConfiguration(String.class, t));

        assertSame(source.getByType(String.class), t);
        assertSame(source.findByType(String.class), t);
        assertNull(source.findByType(Integer.class));

        verify();
    }
View Full Code Here

        configuration.put(String.class, string);
        configuration.put(Boolean.class, bool);

        replay();

        TranslatorSource source = new TranslatorSourceImpl(configuration);

        try
        {
            source.getByType(Integer.class);
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(ex.getMessage(),
View Full Code Here

    {
        Field field = mockField();
        Messages messages = mockMessages();
        Locale locale = Locale.ENGLISH;
        Class propertyType = Map.class;
        TranslatorSource ts = mockTranslatorSource();
        AnnotationProvider ap = mockAnnotationProvider(null);

        train_findByType(ts, propertyType, null);

        replay();
View Full Code Here

    }

    @Test
    public void create_default_translator_with_annotation()
    {
        TranslatorSource ts = mockTranslatorSource();
        AnnotationProvider ap = mockAnnotationProvider("fred");
        Translator t = mockTranslator();

        expect(ts.get("fred")).andReturn(t);

        replay();

        FieldTranslatorSourceImpl source = new FieldTranslatorSourceImpl(ts, null, null);
View Full Code Here

    {
        Field field = mockField();
        Messages messages = mockMessages();
        Locale locale = Locale.ENGLISH;
        Class propertyType = Map.class;
        TranslatorSource ts = mockTranslatorSource();
        ValidationMessagesSource vms = mockValidationMessagesSource();
        FormSupport fs = mockFormSupport();
        Translator translator = mockTranslator("maptrans", Map.class);
        Messages validationMessages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.services.TranslatorSource

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.