Examples of ObjectLocator


Examples of org.apache.tapestry.ioc.ObjectLocator

    {
        ObjectProvider prov1 = mockObjectProvider();
        ObjectProvider prov2 = mockObjectProvider();
        Class type = Runnable.class;
        AnnotationProvider ap = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        Object expected = mockRunnable();

        train_provide(prov1, type, ap, locator, null);
        train_provide(prov2, type, ap, locator, null);
View Full Code Here

Examples of org.apache.tapestry.ioc.ObjectLocator

    @Test
    public void unordered_contribution()
    {
        _toContribute = new Object();
        Configuration configuration = mockConfiguration();
        ObjectLocator locator = mockObjectLocator();

        configuration.add(_toContribute);

        replay();
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectLocator

        Constructor constructor = constructors[0];

        if (insideConstructor)
            throw new RuntimeException(IOCMessages.recursiveModuleConstructor(moduleClass, constructor));

        ObjectLocator locator = new ObjectLocatorImpl(registry, this);
        Map<Class, Object> resourcesMap = CollectionFactory.newMap();

        resourcesMap.put(Logger.class, logger);
        resourcesMap.put(ObjectLocator.class, locator);
        resourcesMap.put(OperationTracker.class, registry);
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectLocator

    }

    @Test
    public void valid_class_contribution()
    {
        ObjectLocator locator = mockObjectLocator();
        HashMap contributedValue = new HashMap();
        train_autobuild(locator, HashMap.class, contributedValue);
        List<Map> collection = CollectionFactory.newList();
        TypeCoercerProxy tc = mockTypeCoercerProxy();
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectLocator

    @Test
    public void proper_key_and_value()
    {
        ContributionDef def = mockContributionDef();
        Map<Class, ContributionDef> keyToContribution = newMap();
        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();
        TypeCoercerProxy tc = mockTypeCoercerProxy();

        Class key = Integer.class;
        Runnable value = mockRunnable();
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectLocator

    @Test
    public void coerced_value()
    {
        ContributionDef def = mockContributionDef();
        Map<Class, ContributionDef> keyToContribution = newMap();
        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();
        TypeCoercerProxy tc = mockTypeCoercerProxy();
        String contributedValue = "coerceme";

        Class key = Integer.class;
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectLocator

    public void duplicate_key()
    {
        ContributionDef def1 = newContributionDef("contributionPlaceholder1");
        ContributionDef def2 = newContributionDef("contributionPlaceholder2");
        Map<Class, ContributionDef> keyToContribution = newMap();
        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();
        TypeCoercerProxy tc = mockTypeCoercerProxy();

        keyToContribution.put(Integer.class, def1);
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectLocator

    public void null_key()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Map<Class, ContributionDef> keyToContribution = newMap();
        Runnable value = mockRunnable();
        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();

        replay();

        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectLocator

    public void wrong_key_type()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Map<?, ContributionDef> keyToContribution = CollectionFactory.newMap();
        Runnable value = mockRunnable();
        ObjectLocator locator = mockObjectLocator();
        Map<Class, Runnable> map = CollectionFactory.newMap();

        replay();

        MappedConfiguration wrapper = new ValidatingMappedConfigurationWrapper(Runnable.class, locator, null, map,
View Full Code Here

Examples of org.apache.tapestry5.ioc.ObjectLocator

    public void null_value()
    {
        ContributionDef def = newContributionDef("contributionPlaceholder1");
        Map<Class, ContributionDef> keyToContribution = CollectionFactory.newMap();
        Map<Class, Runnable> map = CollectionFactory.newMap();
        ObjectLocator locator = mockObjectLocator();

        replay();

        MappedConfiguration<Class, Runnable> wrapper = new ValidatingMappedConfigurationWrapper<Class, Runnable>(
                Runnable.class, locator, null, map, null, SERVICE_ID, def, Class.class, keyToContribution);
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.