Examples of InjectionProvider


Examples of org.apache.tapestry5.services.InjectionProvider

    @Test
    public void injection_provider_threw_exception()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        RuntimeException failure = new RuntimeException("Oops.");

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
        train_getFieldAnnotation(ct, "myfield", Inject.class, annotation);

        train_getFieldType(ct, "myfield", REQUEST_CLASS_NAME);
        train_toClass(ct, REQUEST_CLASS_NAME, Request.class);

        expect(ip.provideInjection("myfield", Request.class, locator, ct, model)).andThrow(failure);

        train_getClassName(ct, "foo.bar.Baz");

        replay();
View Full Code Here

Examples of org.apache.tapestry5.services.InjectionProvider

        MutableComponentModel model = mockMutableComponentModel();
        ObjectLocator locator = mockObjectLocator();

        replay();

        InjectionProvider provider = new BlockInjectionProvider();

        assertFalse(provider.provideInjection("myfield", Object.class, locator, ct, model));

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.InjectionProvider

        expect(ct.getField(fieldName)).andReturn(field);
        expect(field.getAnnotation(Path.class)).andReturn(null);

        replay();

        InjectionProvider provider = new AssetInjectionProvider(symbolSource, assetSource);

        assertFalse(provider.provideInjection(fieldName, String.class, locator, ct, model));

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.InjectionProvider

        MutableComponentModel model = mockMutableComponentModel();
        ObjectLocator locator = mockObjectLocator();

        replay();

        InjectionProvider provider = new BlockInjectionProvider();

        assertFalse(provider.provideInjection("myfield", Object.class, locator, ct, model));

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.InjectionProvider

        train_getFieldAnnotation(ct, fieldName, Path.class, null);

        replay();

        InjectionProvider provider = new AssetInjectionProvider(symbolSource, assetSource);

        assertFalse(provider.provideInjection(fieldName, String.class, locator, ct, model));

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.InjectionProvider

        ct.makeReadOnly(fieldName);

        replay();

        InjectionProvider provider = new AssetInjectionProvider(symbolSource, assetSource);

        assertTrue(provider.provideInjection(fieldName, fieldType, locator, ct, model));

        verify();
    }
View Full Code Here

Examples of org.apache.tapestry5.services.InjectionProvider

    @Test
    public void anonymous_injection()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
View Full Code Here

Examples of org.apache.tapestry5.services.InjectionProvider

    @Test
    public void anonymous_injection_not_provided()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
View Full Code Here

Examples of org.apache.tapestry5.services.InjectionProvider

    @Test
    public void injection_provider_threw_exception()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        RuntimeException failure = new RuntimeException("Oops.");

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
        train_getFieldAnnotation(ct, "myfield", Inject.class, annotation);

        train_getFieldType(ct, "myfield", REQUEST_CLASS_NAME);
        train_toClass(ct, REQUEST_CLASS_NAME, Request.class);

        expect(ip.provideInjection("myfield", Request.class, locator, ct, model)).andThrow(failure);

        train_getClassName(ct, "foo.bar.Baz");

        replay();
View Full Code Here

Examples of org.qi4j.runtime.injection.InjectionProvider

    }

    public InjectionProvider newInjectionProvider( Resolution resolution, DependencyModel dependencyModel )
        throws InvalidInjectionException
    {
        InjectionProvider injectionProvider = decoratedFactory.newInjectionProvider( resolution, dependencyModel );
        if( injectionProvider != null )
        {
            return new CachingInjectionProviderDecorator( injectionProvider );
        }
        else
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.