Package org.springframework.springfaces.message

Examples of org.springframework.springfaces.message.DefaultObjectMessageSource


  }

  @Test
  public void shouldSupportTopLevelObjectWhenBackedWithObjectMessageSource() throws Exception {
    StaticMessageSource messageSource = new StaticMessageSource();
    MessageSourceMap map = new TestMessageSourceMap(new DefaultObjectMessageSource(messageSource));
    ObjectResolvable resolvable = new ObjectResolvable();
    messageSource.addMessage(ObjectResolvable.class.getName(), Locale.getDefault(), "test");
    String actual = map.get(resolvable).toString();
    assertThat(actual, is(equalTo("test")));
  }
View Full Code Here


  }

  @Test
  public void shouldResolveParamtersUsingObjectMessageSource() throws Exception {
    StaticMessageSource messageSource = new StaticMessageSource();
    MessageSourceMap map = new TestMessageSourceMap(new DefaultObjectMessageSource(messageSource));
    ObjectResolvable resolvable = new ObjectResolvable();
    messageSource.addMessage(ObjectResolvable.class.getName(), Locale.getDefault(), "test");
    MessageSourceResolvable value = (MessageSourceResolvable) map.get("x", resolvable);
    assertThat((String) value.getArguments()[0], is(equalTo("test")));
  }
View Full Code Here

    map.get(resolvable);
  }

  @Test
  public void shouldReturnObjectStringOnNoSuchObjectMessageException() throws Exception {
    MessageSourceMap map = new TestMessageSourceMap(new DefaultObjectMessageSource(new StaticMessageSource()));
    ObjectResolvable resolvable = new ObjectResolvable();
    String actual = map.get(resolvable).toString();
    assertThat(actual, is("Object Resolvable"));
  }
View Full Code Here

TOP

Related Classes of org.springframework.springfaces.message.DefaultObjectMessageSource

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.