Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.InfrastructureManager


public class InfrastructureImplTest extends InternalBaseTestCase
{
    @Test
    public void mode_not_set_when_resolution_requested()
    {
        InfrastructureManager manager = newInfrastructureManager();
        ServiceLocator locator = newServiceLocator();

        replay();

        Infrastructure infra = new InfrastructureImpl(manager);
View Full Code Here


    }

    @Test
    public void resolve_object_within_mode()
    {
        InfrastructureManager manager = newInfrastructureManager();
        ServiceLocator locator = newServiceLocator();
        Runnable r = newRunnable();

        Map<String, Object> configuration = newMap();
        configuration.put("myrunnable", r);
View Full Code Here

    /** Check that the manager is only consulted once. */
    @Test
    public void configuration_is_cached()
    {
        InfrastructureManager manager = newInfrastructureManager();
        ServiceLocator locator = newServiceLocator();
        Runnable r = newRunnable();

        Map<String, Object> configuration = newMap();
        configuration.put("myrunnable", r);
View Full Code Here

    }

    @Test
    public void expression_not_found_in_configuration()
    {
        InfrastructureManager manager = newInfrastructureManager();
        ServiceLocator locator = newServiceLocator();

        Map<String, Object> configuration = newMap();

        configuration.put("fred", this);
View Full Code Here

    }

    @Test
    public void requested_type_not_compatible_with_object()
    {
        InfrastructureManager manager = newInfrastructureManager();
        ServiceLocator locator = newServiceLocator();
        Runnable r = newRunnable();

        Map<String, Object> configuration = newMap();
        configuration.put("myrunnable", r);
View Full Code Here

        replay();

        Collection<InfrastructureContribution> configuration = buildConfiguration();

        InfrastructureManager manager = new InfrastructureManagerImpl(log, configuration);

        Map<String, Object> map = manager.getContributionsForMode("foo");

        assertEquals(map.size(), 2);
        assertEquals(map.get("fred"), "FRED");
        assertEquals(map.get("barney"), "BARNEY");
View Full Code Here

        replay();

        Collection<InfrastructureContribution> configuration = buildConfiguration();
        configuration.add(new InfrastructureContribution("fred", "FRED-CONFLICT"));

        InfrastructureManager manager = new InfrastructureManagerImpl(log, configuration);

        Map<String, Object> map = manager.getContributionsForMode("foo");

        assertEquals(map.size(), 2);
        assertEquals(map.get("fred"), "FRED");
        assertEquals(map.get("barney"), "BARNEY");
View Full Code Here

        Collection<InfrastructureContribution> configuration = buildConfiguration();

        configuration.add(new InfrastructureContribution("barney", "bar", "BARNEY2"));

        InfrastructureManager manager = new InfrastructureManagerImpl(log, configuration);

        Map<String, Object> map = manager.getContributionsForMode("foo");

        assertEquals(map.size(), 2);
        assertEquals(map.get("fred"), "FRED");
        assertEquals(map.get("barney"), "BARNEY");
View Full Code Here

        Collection<InfrastructureContribution> configuration = buildConfiguration();

        configuration.add(new InfrastructureContribution("fred", "foo", "FRED-OVERRIDE"));

        InfrastructureManager manager = new InfrastructureManagerImpl(log, configuration);

        Map<String, Object> map = manager.getContributionsForMode("foo");

        assertEquals(map.size(), 2);
        assertEquals(map.get("fred"), "FRED-OVERRIDE");
        assertEquals(map.get("barney"), "BARNEY");
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.InfrastructureManager

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.