Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.ServiceBuilderResources


    public void auto_dependency()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        Method method = findMethod(fixture, "build_auto");

        ServiceBuilderResources resources = mockServiceBuilderResources();
        Logger logger = mockLogger();

        fixture._fie = mockFieService();
        fixture._expectedFoe = mockFoeService();

        trainForConstructor(resources, logger);

        train_getModuleBuilder(resources, fixture);

        expect(resources.getObject(eq(FoeService.class), isA(AnnotationProvider.class))).andReturn(
                fixture._expectedFoe);

        train_isDebugEnabled(logger, false);

        replay();
View Full Code Here


        try
        {
            ServiceLifecycle lifecycle = _registry.getServiceLifecycle(def.getServiceLifeycle());

            ServiceBuilderResources resources = new ServiceResourcesImpl(_registry, this, def, log);

            // Build up a stack of operations that will be needed to instantiate the service
            // (by the proxy, at a later date).

            ObjectCreator creator = def.createServiceCreator(resources);
View Full Code Here

        if (logger.isDebugEnabled()) logger.debug(IOCMessages.creatingService(serviceId));

        try
        {
            ServiceBuilderResources resources = new ServiceResourcesImpl(_registry, this, def,
                    _classFactory, logger);

            // Build up a stack of operations that will be needed to realize the service
            // (by the proxy, at a later date).
View Full Code Here

    @Test
    public void noargs_method()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        ServiceBuilderResources resources = newServiceCreatorResources();
        Log log = newLog();

        fixture._fie = newFieService();

        trainForConstructor(resources, log);
View Full Code Here

    @Test
    public void method_with_args()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        Method method = findMethod(fixture, "build_args");
        ServiceBuilderResources resources = newServiceCreatorResources();

        Log log = newLog();

        fixture._expectedServiceId = SERVICE_ID;
        fixture._expectedServiceInterface = FieService.class;
View Full Code Here

    @Test
    public void injected_service_method()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        ServiceBuilderResources resources = newServiceCreatorResources();
        Log log = newLog();

        fixture._fie = newFieService();
        fixture._expectedFoe = newFoe();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void injected_ordered_collection()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        ServiceBuilderResources resources = newServiceCreatorResources();
        Log log = newLog();

        fixture._fie = newFieService();
        List<Runnable> result = newMock(List.class);
        fixture._expectedConfiguration = result;

        trainForConstructor(resources, log);

        train_getModuleBuilder(resources, fixture);

        expect(resources.getOrderedConfiguration(Runnable.class)).andReturn(result);

        train_isDebugEnabled(log, false);

        replay();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void injected_unordered_collection()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        ServiceBuilderResources resources = newServiceCreatorResources();
        Log log = newLog();

        fixture._fie = newFieService();
        Collection<Runnable> result = newMock(Collection.class);
        fixture._expectedConfiguration = result;

        trainForConstructor(resources, log);

        train_getModuleBuilder(resources, fixture);

        expect(resources.getUnorderedConfiguration(Runnable.class)).andReturn(result);

        train_isDebugEnabled(log, false);

        replay();
View Full Code Here

    @Test
    public void builder_method_returns_null()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        ServiceBuilderResources resources = newServiceCreatorResources();
        Log log = newLog();

        trainForConstructor(resources, log);

        train_getModuleBuilder(resources, fixture);
View Full Code Here

    @Test
    public void builder_method_failed()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        ServiceBuilderResources resources = newServiceCreatorResources();
        Log log = newLog();

        trainForConstructor(resources, log);

        train_getModuleBuilder(resources, fixture);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.ServiceBuilderResources

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.