Package org.apache.tapestry.ioc.def

Examples of org.apache.tapestry.ioc.def.ContributionDef


    }

    @Test
    public void null_key()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Log log = newLog();
        Map<Class, ContributionDef> keyToContribution = newMap();
        MappedConfiguration<Class, Runnable> delegate = newMappedConfiguration();
        Runnable value = newRunnable();
View Full Code Here


    @SuppressWarnings("unchecked")
    @Test
    public void wrong_key_type()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Log log = newLog();
        Map<?, ContributionDef> keyToContribution = newMap();
        MappedConfiguration delegate = newMappedConfiguration();
        Runnable value = newRunnable();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void wrong_value_type()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Log log = newLog();
        Map<?, ContributionDef> keyToContribution = newMap();
        MappedConfiguration delegate = newMappedConfiguration();

        log.warn(IOCMessages.contributionWrongValueType(
View Full Code Here

    }

    @Test
    public void null_value()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Log log = newLog();
        Map<Class, ContributionDef> keyToContribution = newMap();
        MappedConfiguration<Class, Runnable> delegate = newMappedConfiguration();

        log.warn(IOCMessages.contributionWasNull(SERVICE_ID, def));
View Full Code Here

        Set<ContributionDef> defs = md.getContributionDefs();

        assertEquals(defs.size(), 1);

        ContributionDef cd = defs.iterator().next();

        // The target service id is derived from the method name

        assertEquals(cd.getServiceId(), expectedServiceId);
        assertEquals(cd.toString(), moduleClass.getName() + "." + expectedMethodSignature);

        verify();
    }
View Full Code Here

        configuration.add(_toContribute);

        replay();

        Method m = findMethod("contributeUnordered");
        ContributionDef def = new ContributionDefImpl("foo.Bar", m);

        def.contribute(this, locator, configuration);

        verify();
    }
View Full Code Here

        configuration.add(service);

        replay();

        Method m = findMethod("contributeUnorderedParameter");
        ContributionDef def = new ContributionDefImpl("foo.Bar", m);

        def.contribute(this, locator, configuration);

        verify();
    }
View Full Code Here

        expect(locator.getService(MappedConfiguration.class)).andThrow(t);

        replay();

        Method m = findMethod("contributeUnorderedWrongParameter");
        ContributionDef def = new ContributionDefImpl("foo.Bar", m);

        try
        {
            def.contribute(this, locator, configuration);
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(ex.getMessage(), "Error invoking service contribution method "
View Full Code Here

        configuration.add("fred", service);

        replay();

        Method m = findMethod("contributeOrderedParameter");
        ContributionDef def = new ContributionDefImpl("foo.Bar", m);

        def.contribute(this, locator, configuration);

        verify();
    }
View Full Code Here

        configuration.add("upcase", service);

        replay();

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

        def.contribute(this, locator, configuration);

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.def.ContributionDef

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.