Package org.apache.tapestry5.ioc

Examples of org.apache.tapestry5.ioc.ObjectLocator


    }

    @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.");
View Full Code Here


    @Test
    public void not_type_block()
    {
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        ObjectLocator locator = mockObjectLocator();

        replay();

        InjectionProvider provider = new BlockInjectionProvider();
View Full Code Here

    @Test
    public void no_path_annotation()
    {
        SymbolSource symbolSource = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        ObjectLocator locator = mockObjectLocator();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        TransformField field = newMock(TransformField.class);

        String fieldName = "myField";
View Full Code Here

    public void no_annotation()
    {
        SymbolSource source = mockSymbolSource();
        TypeCoercer coercer = mockTypeCoercer();
        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();

        train_getAnnotation(annotationProvider, Symbol.class, null);

        replay();
View Full Code Here

    public void annotation_present()
    {
        SymbolSource source = mockSymbolSource();
        TypeCoercer coercer = mockTypeCoercer();
        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        String symbolName = "example-symbol";
        String symbolValue = "symbol-value";
        Long coercedValue = 123l;
        Symbol annotation = newSymbol(symbolName);
View Full Code Here

    public void intermediate_type()
    {
        SymbolSource source = mockSymbolSource();
        TypeCoercer coercer = mockTypeCoercer();
        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        String symbolName = "example-symbol";
        String symbolValue = "symbol-value";
        Long coercedValue = 123l;
        Symbol annotation = newSymbol(symbolName);
        IntermediateType it = newIntermediateType();
View Full Code Here

    @SuppressWarnings({"unchecked"})
    @Test
    public void valid_class_contribution()
    {
        ObjectLocator locator = mockObjectLocator();
        final HashMap value = new HashMap();
        train_autobuild(locator, HashMap.class, value);
        List<Map> collection = CollectionFactory.newList();

        replay();
View Full Code Here

        Logger logger = mockLogger();
        Orderer<Map> orderer = new Orderer<Map>(logger);
        Map pre = new HashMap();
        Map post = new HashMap();
        HashMap contribution = new HashMap();
        ObjectLocator locator = mockObjectLocator();

        train_autobuild(locator, HashMap.class, contribution);

        orderer.add("pre", pre);
        orderer.add("post", post);
View Full Code Here

    }

    @Test
    public void inject_service_annotation_on_field()
    {
        ObjectLocator ol = mockObjectLocator();
        FieldInjectionViaInjectService target = new FieldInjectionViaInjectService();
        Runnable fred = mockRunnable();

        train_getService(ol, "FredService", Runnable.class, fred);
View Full Code Here

    }

    @Test
    public void inject_annotation_on_field()
    {
        ObjectLocator ol = mockObjectLocator();
        FieldInjectionViaInject target = new FieldInjectionViaInject();
        final SymbolSource ss = mockSymbolSource();

        IAnswer answer = new IAnswer()
        {
            public Object answer() throws Throwable
            {
                Object[] args = EasyMock.getCurrentArguments();

                AnnotationProvider ap = (AnnotationProvider) args[1];

                // Verify that annotations on the field are accessible.

                assertNotNull(ap.getAnnotation(Builtin.class));

                return ss;
            }
        };

        expect(ol.getObject(eq(SymbolSource.class), isA(AnnotationProvider.class))).andAnswer(answer);

        replay();

        InternalUtils.injectIntoFields(target, ol, null, tracker);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.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.