Package org.apache.tapestry5.ioc

Examples of org.apache.tapestry5.ioc.MappedConfiguration


    @SuppressWarnings("unchecked")
    @Test
    public void mapped_collection_with_service_lookup()
    {
        MappedConfiguration configuration = mockMappedConfiguration();
        ServiceResources resources = mockServiceResources(tracker);
        UpcaseService service = mockUpcaseService();
        Logger logger = mockLogger();

        train_getLogger(resources, logger);

        train_getService(resources, "zip.Zap", UpcaseService.class, service);
        train_getServiceId(resources, "Bif");

        configuration.add("upcase", service);

        replay();

        Method m = findMethod("contributeMappedParameter");
        ContributionDef def = new ContributionDefImpl("foo.Bar", m, null, null, null);
View Full Code Here


        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();

        replay();

        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(Runnable.class, locator, map, null,
                                                                               SERVICE_ID, def,
                                                                               Class.class, keyToContribution);

        try
        {
            wrapper.add("java.util.List", value);
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(ex.getMessage(),
View Full Code Here

        Map<Class, Runnable> map = CollectionFactory.newMap();


        replay();

        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(Runnable.class, locator, map, null,
                                                                               SERVICE_ID, def,
                                                                               Class.class, keyToContribution);

        try
        {
            wrapper.add(List.class, "do something");
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(ex.getMessage(),
View Full Code Here

        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();

        replay();

        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(map, null, SERVICE_ID, def,
                                                                               Class.class, Runnable.class,
                                                                               keyToContribution, locator);

        try
        {
            wrapper.add("java.util.List", value);
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(ex.getMessage(),
View Full Code Here

        Map<Class, Runnable> map = CollectionFactory.newMap();


        replay();

        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(map, null, SERVICE_ID, def,
                                                                               Class.class, Runnable.class,
                                                                               keyToContribution, locator);

        try
        {
            wrapper.add(List.class, "do something");
            unreachable();
        }
        catch (IllegalArgumentException ex)
        {
            assertEquals(ex.getMessage(),
View Full Code Here

    public void wrong_key_type()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Logger logger = mockLogger();
        Map<?, ContributionDef> keyToContribution = newMap();
        MappedConfiguration delegate = mockMappedConfiguration();
        Runnable value = mockRunnable();

        logger.warn(IOCMessages
                .contributionWrongKeyType(SERVICE_ID, def, String.class, Class.class));

        replay();

        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(SERVICE_ID, def,
                                                                               logger, Class.class, Runnable.class,
                                                                               keyToContribution, delegate);

        wrapper.add("java.util.List", value);

        verify();
    }
View Full Code Here

    public void wrong_value_type()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Logger logger = mockLogger();
        Map<?, ContributionDef> keyToContribution = newMap();
        MappedConfiguration delegate = mockMappedConfiguration();

        logger.warn(IOCMessages.contributionWrongValueType(
                SERVICE_ID,
                def,
                String.class,
                Runnable.class));

        replay();

        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(SERVICE_ID, def,
                                                                               logger, Class.class, Runnable.class,
                                                                               keyToContribution, delegate);

        wrapper.add(List.class, "do something");

        verify();
    }
View Full Code Here

        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
View Full Code Here

    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
View Full Code Here

    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.MappedConfiguration

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.