Package org.apache.tapestry5.ioc.def

Examples of org.apache.tapestry5.ioc.def.ModuleDef


    {
        Logger logger = mockLogger();

        replay();

        ModuleDef def = new DefaultModuleDefImpl(DefaultServiceIdModule.class, logger, null);

        assertEquals(def.getServiceIds().size(), 1);

        ServiceDef sd = def.getServiceDef("FieService");

        assertEquals(sd.getServiceId(), "FieService");

        verify();
    }
View Full Code Here


        logger.warn(IOCMessages.buildMethodWrongReturnType(m));

        replay();

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

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

        verify();
    }
View Full Code Here

        logger.warn(IOCMessages.buildMethodWrongReturnType(m));

        replay();

        ModuleDef md = new DefaultModuleDefImpl(BuilderMethodModule.class, logger, null);

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

        verify();
    }
View Full Code Here

        logger.warn(IOCMessages.decoratorMethodWrongReturnType(m));

        replay();

        ModuleDef md = new DefaultModuleDefImpl(moduleClass, logger, null);

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

        verify();
    }
View Full Code Here

    {
        Logger logger = mockLogger();

        replay();

        ModuleDef md = new DefaultModuleDefImpl(moduleClass, logger, classFactory);

        Set<ContributionDef> defs = md.getContributionDefs();

        assertEquals(defs.size(), 1);

        ContributionDef cd = defs.iterator().next();
View Full Code Here

        Logger logger = mockLogger();
        logger.warn(IOCMessages.tooManyContributionParameters(m));

        replay();

        ModuleDef md = new DefaultModuleDefImpl(moduleClass, logger, null);

        assertTrue(md.getContributionDefs().isEmpty());

        verify();
    }
View Full Code Here

        Logger logger = mockLogger();
        logger.warn(IOCMessages.noContributionParameter(m));

        replay();

        ModuleDef md = new DefaultModuleDefImpl(moduleClass, logger, null);

        assertTrue(md.getContributionDefs().isEmpty());

        verify();
    }
View Full Code Here

    {
        Logger logger = mockLogger();

        replay();

        ModuleDef md = new DefaultModuleDefImpl(AutobuildModule.class, logger, classFactory);

        ServiceDef sd = md.getServiceDef("StringHolder");

        assertEquals(sd.getServiceInterface(), StringHolder.class);
        assertEquals(sd.getServiceId(), "StringHolder");
        assertEquals(sd.getServiceScope(), IOCConstants.DEFAULT_SCOPE);
        assertFalse(sd.isEagerLoad());
View Full Code Here

    {
        Logger logger = mockLogger();

        replay();

        ModuleDef md = new DefaultModuleDefImpl(ComplexAutobuildModule.class, logger, classFactory);

        ServiceDef sd = md.getServiceDef("SH");

        assertEquals(sd.getServiceInterface(), StringHolder.class);
        assertEquals(sd.getServiceId(), "SH");
        assertEquals(sd.getServiceScope(), "magic");
        assertTrue(sd.isEagerLoad());
View Full Code Here

        logger.error(and(contains(NonStaticBindMethodModule.class.getName()), contains("but is an instance method")));

        replay();

        ModuleDef md = new DefaultModuleDefImpl(NonStaticBindMethodModule.class, logger, classFactory);

        // Prove that the bind method was not invoke

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

        verify();
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.def.ModuleDef

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.