Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.ObjectCreator


        train_isDebugEnabled(log, false);

        replay();

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

        Object actual = sc.createObject();

        assertSame(actual, fixture._fie);

        verify();
    }
View Full Code Here


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

        replay();

        ObjectCreator sc = new ServiceBuilderMethodInvoker(method, resources);

        Object actual = sc.createObject();

        assertSame(actual, fixture._fie);

        verify();
    }
View Full Code Here

        train_isDebugEnabled(log, false);

        replay();

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

        Object actual = sc.createObject();

        assertSame(actual, fixture._fie);

        verify();
    }
View Full Code Here

        train_isDebugEnabled(log, false);

        replay();

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

        Object actual = sc.createObject();

        assertSame(actual, fixture._fie);

        verify();
View Full Code Here

        train_isDebugEnabled(log, false);

        replay();

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

        Object actual = sc.createObject();

        assertSame(actual, fixture._fie);

        verify();
    }
View Full Code Here

        train_isDebugEnabled(log, false);

        replay();

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

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

        train_isDebugEnabled(log, false);

        replay();

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

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

        train_isDebugEnabled(log, false);

        replay();

        ObjectCreator sc = new ServiceBuilderMethodInvoker(method, resources);

        Object actual = sc.createObject();

        verify();

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

    @Test
    public void ensure_only_called_once() throws Exception
    {
        Method method = getClass().getMethod("buildMyService");

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

        ServiceDef def = new ServiceDefImpl("foo.Bar", "singleton", method, false, false);

        train_createObject(delegate, service);

        replay();

        ObjectCreator oneShot = new OneShotServiceCreator(def, delegate);

        assertSame(oneShot.createObject(), service);

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

            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);

            creator = new LifecycleWrappedServiceCreator(lifecycle, resources, creator);

            // Don't allow the tapestry.ioc services to be decorated.
View Full Code Here

TOP

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

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.