Examples of ServiceBuilderResources


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

Examples of org.apache.tapestry.ioc.ServiceBuilderResources

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

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

            // 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

Examples of org.apache.tapestry5.ioc.ServiceBuilderResources

        {
            public Object invoke()
            {
                try
                {
                    ServiceBuilderResources resources = new ServiceResourcesImpl(registry, module, 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

Examples of org.apache.tapestry5.ioc.ServiceBuilderResources

        ServletContext servletContext = mockServletContext();
        ConfigurableWebApplicationContext ac = newMock(ConfigurableWebApplicationContext.class);
        Runnable fred = mockRunnable();
        Runnable barney = mockRunnable();

        ServiceBuilderResources resources = mockServiceBuilderResources();

        train_getInitParameter(servletContext, SpringConstants.USE_EXTERNAL_SPRING_CONTEXT, "true");

        train_getAttribute(servletContext, WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ac);
        expect(ac.getBeanDefinitionNames()).andReturn(new String[] {"fred", "&barney"});
View Full Code Here

Examples of org.apache.tapestry5.ioc.ServiceBuilderResources

    @Test
    public void noargs_method()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        ServiceBuilderResources resources = mockServiceBuilderResources(tracker);
        Logger logger = mockLogger();

        fixture.fie = mockFieService();

        trainForConstructor(resources, logger);
View Full Code Here

Examples of org.apache.tapestry5.ioc.ServiceBuilderResources

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

        Logger logger = mockLogger();

        fixture.expectedServiceInterface = FieService.class;
        fixture.expectedServiceResources = resources;
View Full Code Here

Examples of org.apache.tapestry5.ioc.ServiceBuilderResources

    @Test
    public void inject_annotation_bypasses_resources()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        Method method = findMethod(fixture, "build_with_forced_injection");
        ServiceBuilderResources resources = mockServiceBuilderResources(tracker);

        Logger logger = mockLogger();

        fixture.expectedString = "Injected";

        fixture.fie = mockFieService();

        trainForConstructor(resources, logger);

        train_getModuleBuilder(resources, fixture);

        ignoreDebug(logger);

        // This simulates what the real stack does when it sees @Value("Injected")

        expect(resources.getObject(eq(String.class), isA(AnnotationProvider.class))).andReturn("Injected");

        replay();

        ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION, method);
View Full Code Here

Examples of org.apache.tapestry5.ioc.ServiceBuilderResources

    @Test
    public void injected_service_method()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        ServiceBuilderResources resources = mockServiceBuilderResources(tracker);
        Logger logger = mockLogger();

        fixture.fie = mockFieService();
        fixture.expectedFoe = newFoe();
View Full Code Here

Examples of org.apache.tapestry5.ioc.ServiceBuilderResources

    @Test
    public void named_injected_service_method()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        ServiceBuilderResources resources = mockServiceBuilderResources(tracker);
        Logger logger = mockLogger();

        fixture.fie = mockFieService();
        fixture.expectedFoe = newFoe();
View Full Code Here

Examples of org.apache.tapestry5.ioc.ServiceBuilderResources

    @SuppressWarnings("unchecked")
    @Test
    public void injected_ordered_collection()
    {
        ServiceBuilderMethodFixture fixture = new ServiceBuilderMethodFixture();
        ServiceBuilderResources resources = mockServiceBuilderResources(tracker);
        Logger logger = mockLogger();

        fixture.fie = mockFieService();
        List<Runnable> result = newMock(List.class);
        fixture.expectedConfiguration = result;

        trainForConstructor(resources, logger);

        train_getModuleBuilder(resources, fixture);

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

        ignoreDebug(logger);

        replay();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.