Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.Registry


    /** The following tests work better as integration tests. */

    @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.tapestry.ioc.internal.UpcaseService)>");

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

        assertEquals(ts.toString(), "<ToStringService: ToString>");
    }
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();
View Full Code Here

    }

    @Test
    public void integration()
    {
        Registry r = buildRegistry(StartupModule.class);

        assertFalse(StartupModule._startupInvoked);

        r.performRegistryStartup();

        assertTrue(StartupModule._startupInvoked);

        // Ideally we'd have a way to show that the ThreadCleanupHub was notified after
        // RegistryStartup did its thing, but ...
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();
View Full Code Here

    /** The following tests work better as integration tests. */

    @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.tapestry.ioc.internal.UpcaseService)>");

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

        assertEquals(ts.toString(), "<ToStringService: ToString>");
    }
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();
View Full Code Here

    }

    @Test
    public void integration()
    {
        Registry r = buildRegistry(StartupModule.class);

        assertFalse(StartupModule._startupInvoked);

        r.performRegistryStartup();

        assertTrue(StartupModule._startupInvoked);

        // Ideally we'd have a way to show that the PerthreadManager was notified after
        // RegistryStartup did its thing, but ...

        r.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

    }

    @Test
    public void integration()
    {
        Registry r = buildRegistry(StartupModule.class);

        assertFalse(StartupModule._startupInvoked);

        r.performRegistryStartup();

        assertTrue(StartupModule._startupInvoked);

        // Ideally we'd have a way to show that the ThreadCleanupHub was notified after
        // RegistryStartup did its thing, but ...

        r.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

TOP

Related Classes of org.apache.tapestry.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.