Package org.apache.tapestry.ioc.def

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


    }

    @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

        builder.add(TapestryModule.class);

        // A synthetic module to ensure that the tapestry.alias-mode is set correctly.

        SymbolProvider provider = new SingleKeySymbolProvider(InternalConstants.TAPESTRY_ALIAS_MODE_SYMBOL, "servlet");
        ContributionDef contribution = new SyntheticSymbolSourceContributionDef("AliasMode", provider,
                                                                                "before:ApplicationDefaults");

        ModuleDef module = new SyntheticModuleDef(contribution);

        builder.add(module);
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

        configuration.add("fred", service);

        replay();

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

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

        def.contribute(this, locator, configuration);

        verify();
    }
View Full Code Here

        // Any other parameters will be validated and worked out at runtime, when we invoke the
        // service contribution method.

        String qualifiedId = IOCUtilities.toQualifiedId(_moduleId, serviceId);

        ContributionDef def = new ContributionDefImpl(qualifiedId, method);

        _contributionDefs.add(def);
    }
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.