Package org.apache.tapestry5.ioc

Examples of org.apache.tapestry5.ioc.ObjectCreator.createObject()


        replay();

        ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION,
                                                           findMethod(fixture, "build_injected"));

        Object actual = sc.createObject();

        assertSame(actual, fixture.fie);

        verify();
    }
View Full Code Here


        replay();

        ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION,
                                                           findMethod(fixture, "buildWithOrderedConfiguration"));

        Object actual = sc.createObject();

        assertSame(actual, fixture.fie);

        verify();
    }
View Full Code Here

        replay();

        ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION,
                                                           findMethod(fixture, "buildWithUnorderedConfiguration"));

        Object actual = sc.createObject();

        assertSame(actual, fixture.fie);

        verify();
    }
View Full Code Here

        ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION, method);

        try
        {
            sc.createObject();
            unreachable();
        }
        catch (RuntimeException ex)
        {
            Assert.assertEquals(ex.getMessage(), "Builder method " + CREATOR_DESCRIPTION
View Full Code Here

        ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION, method);

        try
        {
            sc.createObject();
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertEquals(ex.getMessage(), "Error invoking service builder method "
View Full Code Here

        replay();

        ObjectCreator sc = new ServiceBuilderMethodInvoker(resources, CREATOR_DESCRIPTION, method);

        Object actual = sc.createObject();

        verify();

        assertSame(actual, fixture.fie);
    }
View Full Code Here

        replay();

        ObjectCreator wrapper = new RecursiveServiceCreationCheckWrapper(def, delegate, logger);

        assertSame(wrapper.createObject(), service);

        try
        {
            wrapper.createObject();
            unreachable();
View Full Code Here

        assertSame(wrapper.createObject(), service);

        try
        {
            wrapper.createObject();
            unreachable();
        }
        catch (IllegalStateException ex)
        {
            assertMessageContains(
View Full Code Here

        ObjectCreator delegate = mockObjectCreator();
        Object service = new Object();

        ServiceDef def = new ServiceDefImpl(Runnable.class, "Bar", null, "singleton", false, false, source);

        expect(delegate.createObject()).andThrow(failure);

        logger.error("Construction of service Bar failed: Just cranky.", failure);

        replay();
View Full Code Here

        ObjectCreator wrapper = new RecursiveServiceCreationCheckWrapper(def, delegate, logger);

        try
        {
            wrapper.createObject();
            unreachable();
        }
        catch (RuntimeException ex)
        {
            assertSame(ex, failure);
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.