Package org.apache.tapestry.ioc

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


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

        configuration.add(_toContribute);

        replay();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void unordered_collection_with_service_lookup()
    {
        Configuration configuration = mockConfiguration();
        ObjectLocator locator = mockObjectLocator();
        UpcaseService service = mockUpcaseService();

        train_getService(locator, "zip.Zap", UpcaseService.class, service);

        configuration.add(service);
View Full Code Here

    @Test
    public void unordered_collection_with_incorrect_configuration_parameter()
    {
        Configuration configuration = mockConfiguration();
        ObjectLocator locator = mockObjectLocator();

        Throwable t = new RuntimeException("Missing service.");

        expect(locator.getObject(eq(MappedConfiguration.class), isA(AnnotationProvider.class)))
                .andThrow(t);

        replay();

        Method m = findMethod("contributeUnorderedWrongParameter");
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void ordered_collection_with_service_lookup()
    {
        OrderedConfiguration configuration = mockOrderedConfiguration();
        ObjectLocator locator = mockObjectLocator();
        UpcaseService service = mockUpcaseService();

        train_getService(locator, "zip.Zap", UpcaseService.class, service);

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

    @SuppressWarnings("unchecked")
    @Test
    public void mapped_collection_with_service_lookup()
    {
        MappedConfiguration configuration = mockMappedConfiguration();
        ObjectLocator locator = mockObjectLocator();
        UpcaseService service = mockUpcaseService();

        train_getService(locator, "zip.Zap", UpcaseService.class, service);

        configuration.add("upcase", service);
View Full Code Here

        Log log = logForService(serviceId);

        boolean debug = log.isDebugEnabled();

        ObjectLocator locator = new ServiceResourcesImpl(this, module, serviceDef, _classFactory,
                log);

        for (ContributionDef def : contributions)
        {
            MappedConfiguration<K, V> validating = new ValidatingMappedConfigurationWrapper<K, V>(
View Full Code Here

        Log log = logForService(serviceId);

        boolean debug = log.isDebugEnabled();

        ObjectLocator locator = new ServiceResourcesImpl(this, module, serviceDef, _classFactory,
                log);

        for (ContributionDef def : contributions)
        {
            Configuration<T> validating = new ValidatingConfigurationWrapper<T>(serviceId, log,
View Full Code Here

        if (contributions.isEmpty()) return;

        Log log = logForService(serviceId);
        boolean debug = log.isDebugEnabled();

        ObjectLocator locator = new ServiceResourcesImpl(this, module, serviceDef, _classFactory,
                log);

        for (ContributionDef def : contributions)
        {
            OrderedConfiguration<T> validating = new ValidatingOrderedConfigurationWrapper<T>(
View Full Code Here

        if (_insideConstructor)
            throw new RuntimeException(IOCMessages.recursiveModuleConstructor(
                    builderClass,
                    constructor));

        ObjectLocator locator = new ObjectLocatorImpl(_registry, this);
        Map<Class, Object> parameterDefaults = newMap();

        parameterDefaults.put(Log.class, _log);
        parameterDefaults.put(ObjectLocator.class, locator);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.ObjectLocator

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.