Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.MappedConfiguration


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

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

        replay();

        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(SERVICE_ID, def,
                log, 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");
        Log log = mockLog();
        Map<?, ContributionDef> keyToContribution = newMap();
        MappedConfiguration delegate = mockMappedConfiguration();

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

        replay();

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

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

        verify();
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void mapped_collection_with_service_lookup()
    {
        MappedConfiguration configuration = mockMappedConfiguration();
        ObjectLocator locator = mockObjectLocator();
        UpcaseService service = mockUpcaseService();

        train_getService(locator, "zip.Zap", UpcaseService.class, service);

        configuration.add("upcase", service);

        replay();

        Method m = findMethod("contributeMappedParameter");
        ContributionDef def = new ContributionDefImpl("foo.Bar", m, null);
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

    @SuppressWarnings("unchecked")
    @Test
    public void mapped_collection_with_service_lookup()
    {
        MappedConfiguration configuration = mockMappedConfiguration();
        ObjectLocator locator = mockObjectLocator();
        UpcaseService service = mockUpcaseService();

        train_getService(locator, "zip.Zap", UpcaseService.class, service);

        configuration.add("upcase", service);

        replay();

        Method m = findMethod("contributeMappedParameter");
        ContributionDef def = new ContributionDefImpl("foo.Bar", m, null);
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

    public void wrong_key_type()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Log log = newLog();
        Map<?, ContributionDef> keyToContribution = newMap();
        MappedConfiguration delegate = newMappedConfiguration();
        Runnable value = newRunnable();

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

        replay();

        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(SERVICE_ID, def,
                log, 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");
        Log log = newLog();
        Map<?, ContributionDef> keyToContribution = newMap();
        MappedConfiguration delegate = newMappedConfiguration();

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

        replay();

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

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

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.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.