Package org.apache.tapestry.ioc.def

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


{
    @SuppressWarnings("unchecked")
    @Test
    public void valid_contribution()
    {
        ContributionDef def = mockContributionDef();
        Logger logger = mockLogger();
        Configuration configuration = mockConfiguration();
        Runnable value = mockRunnable();

        configuration.add(value);
View Full Code Here


    @Test
    public void null_contribution()
    {
        Logger logger = mockLogger();
        Configuration configuration = mockConfiguration();
        ContributionDef def = new ContributionDefImpl("Bar", findMethod("contributeUnorderedNull"),
                getClassFactory());

        logger.warn(IOCMessages.contributionWasNull("Bar", def));

        replay();
View Full Code Here

    @Test
    public void wrong_type_of_contribution()
    {
        Logger logger = mockLogger();
        Configuration configuration = mockConfiguration();
        ContributionDef def = new ContributionDefImpl("Bar", findMethod("contributeUnorderedNull"),
                getClassFactory());

        logger.warn(IOCMessages
                .contributionWrongValueType("Bar", def, String.class, Runnable.class));
View Full Code Here

public class ValidatingOrderedConfigurationWrapperTest extends IOCInternalTestCase
{
    @Test
    public void valid_type_long_form()
    {
        ContributionDef def = mockContributionDef();
        Logger logger = mockLogger();
        OrderedConfiguration<Runnable> configuration = mockOrderedConfiguration();
        Runnable contribution = mockRunnable();

        configuration.add("id", contribution, "after:pre", "before:post");
View Full Code Here

    }

    @Test
    public void valid_type_short_form()
    {
        ContributionDef def = mockContributionDef();
        Logger logger = mockLogger();
        OrderedConfiguration<Runnable> configuration = mockOrderedConfiguration();
        Runnable contribution = mockRunnable();

        configuration.add("id", contribution);
View Full Code Here

    }

    @Test
    public void null_object_passed_through()
    {
        ContributionDef def = mockContributionDef();
        Logger logger = mockLogger();
        OrderedConfiguration<Runnable> configuration = mockOrderedConfiguration();

        configuration.add("id", null);
View Full Code Here

    @Test
    public void incorrect_contribution_type_is_passed_through_as_null()
    {
        Method method = findMethod("contributeBarneyService");

        ContributionDef def = new ContributionDefImpl("Service", method, getClassFactory());
        Logger log = mockLogger();
        OrderedConfiguration<Runnable> configuration = mockOrderedConfiguration();

        log.warn(IOCMessages.contributionWrongValueType(
                "Service",
View Full Code Here

        configuration.add(_toContribute);

        replay();

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

        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, null);

        def.contribute(this, locator, configuration);

        verify();
    }
View Full Code Here

                .andThrow(t);

        replay();

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

        try
        {
            def.contribute(this, locator, configuration);
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(ex.getMessage(), "Error invoking service contribution method "
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.