Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.ServiceLocator


    @Test
    public void symbols_are_expanded()
    {
        ObjectProvider provider = newObjectProvider();
        ServiceLocator locator = newServiceLocator();
        Runnable r = newRunnable();
        SymbolSource source = newSymbolSource();

        train_expandSymbols(source, "${symbol}", "prefix:expression");
        train_provide(provider, "expression", Runnable.class, locator, r);
View Full Code Here


    }

    @Test
    public void unknown_object_provider_prefix()
    {
        ServiceLocator locator = newServiceLocator();
        SymbolSource source = newSymbolSource();

        train_expandSymbols(source, "prefix:expression");

        replay();
View Full Code Here

    }

    @Test
    public void no_prefix_in_object_reference()
    {
        ServiceLocator locator = newServiceLocator();
        SymbolSource source = newSymbolSource();
        TypeCoercer coercer = newTypeCoercer();

        train_expandSymbols(source, "${value}", "55");
        train_coerce(coercer, "55", Integer.class, 55);
View Full Code Here

  @Test
  public void failure_getting_bean_from_context()
  {
    Log log = newLog();
    WebApplicationContext webContext = newWebApplicationContext();
    ServiceLocator locator = newServiceLocator();
    Throwable t = new RuntimeException("Simulated failure.");

    train_getBeanDefinitionNames(webContext, BEAN_NAME);

    log.info(STARTUP_MESSAGE + BEAN_NAME);
View Full Code Here

  @Test
  public void get_bean_from_context()
  {
    Log log = newLog();
    WebApplicationContext webContext = newWebApplicationContext();
    ServiceLocator locator = newServiceLocator();
    SpringBean bean = newMock(SpringBean.class);

    train_getBeanDefinitionNames(webContext, "fred", "barney", BEAN_NAME);

    log.info(STARTUP_MESSAGE + "barney, fred, " + BEAN_NAME);
View Full Code Here

  @Test
  public void bean_name_is_case_insensitive_if_in_bean_definitions()
  {
    Log log = newLog();
    WebApplicationContext webContext = newWebApplicationContext();
    ServiceLocator locator = newServiceLocator();
    SpringBean bean = newMock(SpringBean.class);

    train_getBeanDefinitionNames(webContext, "fred", "barney", BEAN_NAME);

    log.info(STARTUP_MESSAGE + "barney, fred, " + BEAN_NAME);
View Full Code Here

  @Test
  public void bean_name_outside_of_bean_definitions_supported_with_provided_case()
  {
    Log log = newLog();
    WebApplicationContext webContext = newWebApplicationContext();
    ServiceLocator locator = newServiceLocator();
    SpringBean bean = newMock(SpringBean.class);

    train_getBeanDefinitionNames(webContext, "fred", "barney");

    log.info(STARTUP_MESSAGE + "barney, fred");
View Full Code Here

    @Test
    public void unordered_contribution()
    {
        _toContribute = new Object();
        Configuration configuration = newConfiguration();
        ServiceLocator locator = newServiceLocator();

        configuration.add(_toContribute);

        replay();
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void unordered_collection_with_service_lookup()
    {
        Configuration configuration = newConfiguration();
        ServiceLocator locator = newServiceLocator();
        UpcaseService service = newUpcaseService();

        train_getService(locator, "zip.Zap", UpcaseService.class, service);

        configuration.add(service);
View Full Code Here

    @Test
    public void unordered_collection_with_incorrect_configuration_parameter()
    {
        Configuration configuration = newConfiguration();
        ServiceLocator locator = newServiceLocator();

        Throwable t = new RuntimeException("Missing service.");

        expect(locator.getService(MappedConfiguration.class)).andThrow(t);

        replay();

        Method m = findMethod("contributeUnorderedWrongParameter");
        ContributionDef def = new ContributionDefImpl("foo.Bar", m, null);
View Full Code Here

TOP

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

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.