Package org.apache.tapestry.ioc.def

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


{
    @SuppressWarnings("unchecked")
    @Test
    public void valid_contribution()
    {
        ContributionDef def = newContributionDef();
        Log log = newLog();
        Configuration configuration = newConfiguration();
        Runnable value = newRunnable();

        configuration.add(value);
View Full Code Here


    @Test
    public void null_contribution()
    {
        Log log = newLog();
        Configuration configuration = newConfiguration();
        ContributionDef def = new ContributionDefImpl("foo.Bar",
                findMethod("contributeUnorderedNull"));

        log.warn(IOCMessages.contributionWasNull("foo.Bar", def));

        replay();
View Full Code Here

    @Test
    public void wrong_type_of_contribution()
    {
        Log log = newLog();
        Configuration configuration = newConfiguration();
        ContributionDef def = new ContributionDefImpl("foo.Bar",
                findMethod("contributeUnorderedNull"));

        log.warn(IOCMessages.contributionWrongValueType(
                "foo.Bar",
                def,
View Full Code Here

public class ValidatingOrderedConfigurationWrapperTest extends IOCInternalTestCase
{
    @Test
    public void valid_type_long_form()
    {
        ContributionDef def = newContributionDef();
        Log log = newLog();
        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();
        Runnable contribution = newRunnable();

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

    }

    @Test
    public void valid_type_short_form()
    {
        ContributionDef def = newContributionDef();
        Log log = newLog();
        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();
        Runnable contribution = newRunnable();

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

    }

    @Test
    public void null_object_passed_through()
    {
        ContributionDef def = newContributionDef();
        Log log = newLog();
        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();

        configuration.add("fred.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("barney.Service", method);
        Log log = newLog();
        OrderedConfiguration<Runnable> configuration = newOrderedConfiguration();

        log.warn(IOCMessages.contributionWrongValueType(
                "barney.Service",
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

            _log.warn(IOCMessages.contributionWrongValueType(_serviceId, _contributionDef, value
                    .getClass(), _expectedValueType));
            return;
        }

        ContributionDef existing = _keyToContributor.get(key);

        if (existing != null)
        {
            _log.warn(IOCMessages.contributionDuplicateKey(_serviceId, _contributionDef, existing));
            return;
View Full Code Here

        _builder.add(moduleBuilderClasses);
    }

    private void addSyntheticSymbolSourceModule()
    {
        ContributionDef symbolSourceContribution = new SyntheticSymbolSourceContributionDef("ServletContext",
                                                                                            _appProvider,
                                                                                            "before:ApplicationDefaults");

        ContributionDef aliasModeContribution = new SyntheticSymbolSourceContributionDef("AliasMode",
                                                                                         new SingleKeySymbolProvider(
                                                                                                 InternalConstants.TAPESTRY_ALIAS_MODE_SYMBOL,
                                                                                                 _aliasMode),
                                                                                         "before:ServletContext");

        ContributionDef appNameContribution = new SyntheticSymbolSourceContributionDef("AppName",
                                                                                       new SingleKeySymbolProvider(
                                                                                               InternalConstants.TAPESTRY_APP_NAME_SYMBOL,
                                                                                               _appName),
                                                                                       "before:ServletContext");
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.