Package org.apache.tapestry5.ioc

Examples of org.apache.tapestry5.ioc.Registry


    }

    @Test
    public void integration()
    {
        Registry registry = buildRegistry();

        PropertyAccess pa = registry.getService("PropertyAccess", PropertyAccess.class);

        Bean b = new Bean();

        int value = random.nextInt();

        pa.set(b, "value", value);

        assertEquals(b.getValue(), value);

        registry.shutdown();
    }
View Full Code Here


{
    @SuppressWarnings("unchecked")
    @Test
    public void testLoadAppModule()
    {
        Registry registry = new TapestryAppInitializer(null, "org.apache.tapestry5.integration.app0",
                                                       "foo").createRegistry();

        Transformer<String> s1 = registry.getService("Service1", Transformer.class);
        assertEquals(s1.transform("a"), "A");
    }
View Full Code Here

public class TapestryApplicationContext extends XmlWebApplicationContext
{
    @Override
    protected DefaultListableBeanFactory createBeanFactory()
    {
        Registry registry = (Registry) getServletContext().getAttribute(TapestryFilter.REGISTRY_CONTEXT_NAME);

        if (registry == null)
            throw new IllegalStateException(
                    "Expected a Tapestry IoC Registry to be stored in the ServletContext, but the attribute was null.");
View Full Code Here

     */

    @Test
    public void integration_tests()
    {
        Registry registry = buildRegistry();

        UpcaseService us = registry.getService(UpcaseService.class);

        assertEquals(us.upcase("hello"), "HELLO");
        assertEquals(us.toString(), "<Proxy for Upcase(org.apache.tapestry5.ioc.internal.UpcaseService)>");

        ToStringService ts = registry.getService(ToStringService.class);

        assertEquals(ts.toString(), "<ToStringService: ToString>");

        registry.shutdown();
    }
View Full Code Here

    }

    @Test
    public void recursive_singleton_integration_test()
    {
        Registry registry = buildRegistry();

        FoeService foe = registry.getService("RecursiveFoe", FoeService.class);

        try
        {
            foe.foe();
            unreachable();
        }
        catch (RuntimeException ex)
        {
            // The details are checked elsewhere.
        }

        registry.shutdown();
    }
View Full Code Here

    }

    @Test
    public void integration()
    {
        Registry registry = buildRegistry();

        PropertyAccess pa = registry.getService("PropertyAccess", PropertyAccess.class);

        Bean b = new Bean();

        int value = random.nextInt();

        pa.set(b, "value", value);

        assertEquals(b.getValue(), value);

        registry.shutdown();
    }
View Full Code Here

public class TapestryApplicationContext extends XmlWebApplicationContext
{
    @Override
    protected DefaultListableBeanFactory createBeanFactory()
    {
        Registry registry = (Registry) getServletContext().getAttribute(TapestryFilter.REGISTRY_CONTEXT_NAME);

        if (registry == null)
            throw new IllegalStateException(
                    "Expected a Tapestry IoC Registry to be stored in the ServletContext, but the attribute was null.");
View Full Code Here

     */

    @Test
    public void integration_tests()
    {
        Registry registry = buildRegistry();

        UpcaseService us = registry.getService(UpcaseService.class);

        assertEquals(us.upcase("hello"), "HELLO");
        assertEquals(us.toString(), "<Proxy for Upcase(org.apache.tapestry5.ioc.internal.UpcaseService)>");

        ToStringService ts = registry.getService(ToStringService.class);

        assertEquals(ts.toString(), "<ToStringService: ToString>");

        registry.shutdown();
    }
View Full Code Here

    }

    @Test
    public void recursive_singleton_integration_test()
    {
        Registry registry = buildRegistry();

        FoeService foe = registry.getService("RecursiveFoe", FoeService.class);

        try
        {
            foe.foe();
            unreachable();
        }
        catch (RuntimeException ex)
        {
            // The details are checked elsewhere.
        }

        registry.shutdown();
    }
View Full Code Here

{
    @SuppressWarnings("unchecked")
    @Test
    public void testLoadAppModule()
    {
        Registry registry = new TapestryAppInitializer(null, "org.apache.tapestry5.integration.app0",
                                                       "foo", "").createRegistry();

        Transformer<String> s1 = registry.getService("Service1", Transformer.class);
        assertEquals(s1.transform("a"), "A");
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ioc.Registry

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.