Package org.apache.tapestry.ioc.def

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


    {
        Log log = mockLog();

        replay();

        ModuleDef md = new DefaultModuleDefImpl(AutobuildModule.class, log, _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


    {
        Log log = mockLog();

        replay();

        ModuleDef md = new DefaultModuleDefImpl(ComplexAutobuildModule.class, log, _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

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

        replay();

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

        // Prove that the bind method was not invoke

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

        verify();
    }
View Full Code Here

                StringHolder.class,
                new ToUpperCaseStringHolder());

        replay();

        ModuleDef def = new DefaultModuleDefImpl(MutlipleAutobuildServiceConstructorsModule.class,
                log, _classFactory);

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

        assertNotNull(sd);

        ObjectCreator oc = sd.createServiceCreator(resources);
View Full Code Here

    {
        Log log = mockLog();

        replay();

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

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

        assertTrue(sd.isEagerLoad());

        verify();
    }
View Full Code Here

        SymbolProvider provider = new SingleKeySymbolProvider(
                InternalConstants.TAPESTRY_ALIAS_MODE_SYMBOL, "servlet");
        ContributionDef contribution = new SyntheticSymbolSourceContributionDef("AliasMode",
                provider, "before:ApplicationDefaults");

        ModuleDef module = new SyntheticModuleDef(contribution);

        builder.add(module);

        _registry = builder.build();
View Full Code Here

        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

        SymbolProvider provider = new SingleKeySymbolProvider(
                InternalConstants.TAPESTRY_ALIAS_MODE_SYMBOL, "servlet");
        ContributionDef contribution = new SyntheticSymbolSourceContributionDef("AliasMode",
                provider, "before:ApplicationDefaults");

        ModuleDef module = new SyntheticModuleDef(contribution);

        builder.add(module);

        _registry = builder.build();
View Full Code Here

    {
        InternalRegistry registry = mockInternalRegistry();
        Log log = mockLog();
        ClassFactory factory = new ClassFactoryImpl();

        ModuleDef moduleDef = new DefaultModuleDefImpl(ModuleImplTestModule.class, log,
                getClassFactory());

        Module module = new ModuleImpl(registry, moduleDef, null, log);

        expect(registry.logForService("Upcase")).andReturn(log);
View Full Code Here

    public void find_service_ids_for_interface()
    {
        InternalRegistry registry = mockInternalRegistry();
        Log log = mockLog();

        ModuleDef moduleDef = new DefaultModuleDefImpl(ModuleImplTestModule.class, log, null);

        Module module = new ModuleImpl(registry, moduleDef, null, log);

        replay();
View Full Code Here

TOP

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