Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.ServiceBuilderResources


    @Test
    public void multiple_constructors_on_autobuild_service_implementation()
    {
        Log log = mockLog();
        ServiceBuilderResources resources = mockServiceBuilderResources();

        train_isDebugEnabled(log, true);

        // The point is, we're choosing the constructor with the largest number of parameters.
View Full Code Here


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

        fixture._fie = mockFieService();

        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 = mockServiceBuilderResources();

        Log log = mockLog();

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

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

        Log log = mockLog();

        fixture._expectedString = "Injected";

        fixture._fie = mockFieService();

        trainForConstructor(resources, log);

        train_getModuleBuilder(resources, fixture);

        train_isDebugEnabled(log, true);

        log.debug(IOCMessages.invokingMethod(CREATOR_DESCRIPTION));

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

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

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

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

        fixture._fie = mockFieService();
        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 = mockServiceBuilderResources();
        Log log = mockLog();

        fixture._fie = mockFieService();
        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 = mockServiceBuilderResources();
        Log log = mockLog();

        Method method = findMethod(fixture, "build_noargs");

        trainForConstructor(resources, log);
View Full Code Here

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

        Method method = findMethod(fixture, "build_fail");

        trainForConstructor(resources, log);
View Full Code Here

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

        ServiceBuilderResources resources = mockServiceBuilderResources();
        Log log = mockLog();

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

        trainForConstructor(resources, log);

        train_getModuleBuilder(resources, fixture);

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

        train_isDebugEnabled(log, false);

        replay();
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.