Package org.apache.sling.models.impl.injector

Examples of org.apache.sling.models.impl.injector.SimpleInjector


        factory.activate(componentCtx);
    }

    @Test
    public void testInjectorWhichDoesNotImplementAnnotationProcessor() {
        factory.bindInjector(new SimpleInjector(), new ServicePropertiesMap(1, 1));

        TestModel model = factory.getAdapter(new Object(), TestModel.class);
        assertNotNull(model);
        assertEquals("test string", model.getTestString());
    }
View Full Code Here


    @Test
    public void testInjectorWithCustomAnnotation() {
        CustomAnnotationInjector injector = new CustomAnnotationInjector();

        factory.bindInjector(new SimpleInjector(), new ServicePropertiesMap(1, 1));
        factory.bindInjector(injector, new ServicePropertiesMap(1, 1));
        factory.bindInjectAnnotationProcessorFactory(injector, new ServicePropertiesMap(1, 1));

        CustomAnnotationModel model = factory.getAdapter(new Object(), CustomAnnotationModel.class);
        assertNotNull(model);
View Full Code Here

TOP

Related Classes of org.apache.sling.models.impl.injector.SimpleInjector

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.