Examples of MappedConfiguration


Examples of org.apache.tapestry.ioc.MappedConfiguration

    @SuppressWarnings("unchecked")
    @Test
    public void mapped_collection_with_service_lookup()
    {
        MappedConfiguration configuration = newMappedConfiguration();
        ServiceLocator locator = newServiceLocator();
        UpcaseService service = newUpcaseService();

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

        configuration.add("upcase", service);

        replay();

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

Examples of org.apache.tapestry.ioc.MappedConfiguration

    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

Examples of org.apache.tapestry.ioc.MappedConfiguration

    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

Examples of org.apache.tapestry.ioc.MappedConfiguration

    @SuppressWarnings("unchecked")
    @Test
    public void mapped_collection_with_service_lookup()
    {
        MappedConfiguration configuration = newMappedConfiguration();
        ServiceLocator locator = newServiceLocator();
        UpcaseService service = newUpcaseService();

        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

Examples of org.apache.tapestry5.ioc.MappedConfiguration

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

        replay();

        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(Runnable.class, locator, null, 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

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

Examples of org.apache.tapestry5.ioc.MappedConfiguration

    @SuppressWarnings("unchecked")
    @Test
    public void mapped_collection_with_named_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("contributeMappedParameterNamedServiceLookup");
        ContributionDef def = new ContributionDefImpl("foo.Bar", m, null, null, null);
View Full Code Here

Examples of org.apache.tapestry5.ioc.MappedConfiguration

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

        replay();

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

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

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

Examples of org.apache.tapestry5.ioc.MappedConfiguration

        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
TOP
Copyright © 2018 www.massapi.com. 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.