Package org.apache.tapestry.ioc.internal

Examples of org.apache.tapestry.ioc.internal.DefaultModuleDefImpl


        while (!queue.isEmpty())
        {
            Class c = queue.remove(0);

            ModuleDef def = new DefaultModuleDefImpl(c, _log, _classFactory);
            add(def);

            SubModule annotation = ((AnnotatedElement) c).getAnnotation(SubModule.class);

            if (annotation == null) continue;
View Full Code Here


        while (!queue.isEmpty())
        {
            Class c = queue.remove(0);

            ModuleDef def = new DefaultModuleDefImpl(c, _logger, _classFactory);
            add(def);

            SubModule annotation = ((AnnotatedElement) c).getAnnotation(SubModule.class);

            if (annotation == null) continue;
View Full Code Here

        while (!queue.isEmpty())
        {
            Class c = queue.remove(0);

            ModuleDef def = new DefaultModuleDefImpl(c, _log);
            add(def);

            SubModule annotation = ((AnnotatedElement) c).getAnnotation(SubModule.class);

            if (annotation == null) continue;
View Full Code Here

        replay();

        // BigDecimal is arbitrary, any class would do.

        ModuleDef md = new DefaultModuleDefImpl(BigDecimal.class, log);

        Assert.assertEquals("java.math", md.getModuleId());

        verify();
    }
View Full Code Here

        replay();

        // BigDecimal is arbitrary, any class would do.

        ModuleDef md = new DefaultModuleDefImpl(ModuleBuilderWithId.class, log);

        Assert.assertEquals("tapestry.ioc", md.getModuleId());

        verify();
    }
View Full Code Here

        replay();

        // BigDecimal is arbitrary, any class would do.

        ModuleDef md = new DefaultModuleDefImpl(SimpleModule.class, log);

        Set<String> ids = md.getServiceIds();

        assertEquals(ids.size(), 3);
        assertTrue(ids.contains("ioc.Fred"));
        assertTrue(ids.contains("ioc.Barney"));
        assertTrue(ids.contains("ioc.Wilma"));

        ServiceDef sd = md.getServiceDef("ioc.Fred");

        assertEquals(sd.getServiceId(), "ioc.Fred");

        assertEquals(sd.getServiceInterface(), FieService.class);

        assertEquals(sd.toString(), className + ".buildFred()");
        assertEquals(sd.getServiceLifeycle(), IOCConstants.DEFAULT_LIFECYCLE);
        assertEquals(sd.isPrivate(), false);
        assertEquals(sd.isEagerLoad(), false);

        sd = md.getServiceDef("ioc.Barney");

        assertEquals(sd.getServiceId(), "ioc.Barney");

        assertEquals(sd.getServiceInterface(), FoeService.class);

        assertEquals(sd.toString(), className + ".buildBarney()");
        assertEquals(sd.getServiceLifeycle(), "threaded");
        assertEquals(sd.isPrivate(), true);

        sd = md.getServiceDef("ioc.Wilma");
        assertEquals(sd.isEagerLoad(), true);

        // Now the decorator method.

        Set<DecoratorDef> defs = md.getDecoratorDefs();

        assertEquals(defs.size(), 1);

        DecoratorDef dd = defs.iterator().next();
View Full Code Here

        replay();

        // BigDecimal is arbitrary, any class would do.

        ModuleDef md = new DefaultModuleDefImpl(ServiceIdConflictMethodModule.class, log);

        Set<String> ids = md.getServiceIds();

        assertEquals(ids.size(), 1);
        assertTrue(ids.contains("ioc.Fred"));

        ServiceDef sd = md.getServiceDef("ioc.Fred");

        assertEquals(sd.getServiceId(), "ioc.Fred");

        assertEquals(sd.getServiceInterface(), FieService.class);
View Full Code Here

        log.warn(IOCMessages.buildMethodWrongReturnType(m), null);

        replay();

        ModuleDef md = new DefaultModuleDefImpl(VoidBuilderMethodModule.class, log);

        assertTrue(md.getServiceIds().isEmpty());

        verify();
    }
View Full Code Here

        log.warn(IOCMessages.decoratorMethodWrongReturnType(m), null);

        replay();

        ModuleDef md = new DefaultModuleDefImpl(moduleClass, log);

        assertTrue(md.getDecoratorDefs().isEmpty());

        verify();
    }
View Full Code Here

        log.warn(IOCMessages.decoratorMethodNeedsDelegateParameter(m), null);

        replay();

        ModuleDef md = new DefaultModuleDefImpl(moduleClass, log);

        assertTrue(md.getDecoratorDefs().isEmpty());

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.internal.DefaultModuleDefImpl

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.