Package org.springframework.context.support

Examples of org.springframework.context.support.StaticMessageSource.addMessage()


  }

  public void testAddAllErrors() {
    StaticMessageSource messageSource = new StaticMessageSource();
    messageSource.addMessage("foo", Locale.getDefault(), "bar");
    messageSource.addMessage("bar", Locale.getDefault(), "{0}");

    DefaultMessageContext context = new DefaultMessageContext(messageSource);
    Object object = new Object();
    MessageContextErrors errors = new MessageContextErrors(context, "object", object, null, null);
    MapBindingResult result = new MapBindingResult(new HashMap(), "object");
View Full Code Here


        .getELResolver().getType(context, null, getBaseVariable()));
  }

  public void testGetType_ResolvableCode() {
    StaticMessageSource ms = new StaticMessageSource();
    ms.addMessage("foo.bar", Locale.getDefault(), "hello");

    RequestContextHolder.setRequestContext(new MockRequestContext());
    assertEquals("Message should resolve to a type of String", String.class, context.getELResolver().getType(
        context, ms, "foo.bar"));
  }
View Full Code Here

        context, ms, "foo.bar"));
  }

  public void testGetType_InvalidCode() {
    StaticMessageSource ms = new StaticMessageSource();
    ms.addMessage("foo.bar", Locale.getDefault(), "hello");

    RequestContextHolder.setRequestContext(new MockRequestContext());
    try {
      context.getELResolver().getType(context, ms, "foo.baz");
      fail("Message should not be resolvable");
View Full Code Here

  }

  public void testGetValue_ResolvableCode() {
    StaticMessageSource ms = new StaticMessageSource();
    ms.addMessage("foo.bar", Locale.getDefault(), "hello");

    RequestContextHolder.setRequestContext(new MockRequestContext());
    assertEquals("Message should resolve to a valid message value", "hello", context.getELResolver().getValue(
        context, ms, "foo.bar"));
  }
View Full Code Here

        context, ms, "foo.bar"));
  }

  public void testGetValue_InvalidCode() {
    StaticMessageSource ms = new StaticMessageSource();
    ms.addMessage("foo.bar", Locale.getDefault(), "hello");

    RequestContextHolder.setRequestContext(new MockRequestContext());
    try {
      context.getELResolver().getValue(context, ms, "foo.baz");
      fail("Message should not be resolvable");
View Full Code Here

 
  private EnumTableCellRenderer tetcr;
 
  public void testGetTableCellRendererComponent() {
    StaticMessageSource messageSource = new StaticMessageSource();
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.ONE", Locale.getDefault(), "one");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.TWO", Locale.getDefault(), "two");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.THREE", Locale.getDefault(), "three");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.FOUR", Locale.getDefault(), "four");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.FIVE", Locale.getDefault(), "five");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.SIX", Locale.getDefault(), "six");
View Full Code Here

  private EnumTableCellRenderer tetcr;
 
  public void testGetTableCellRendererComponent() {
    StaticMessageSource messageSource = new StaticMessageSource();
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.ONE", Locale.getDefault(), "one");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.TWO", Locale.getDefault(), "two");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.THREE", Locale.getDefault(), "three");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.FOUR", Locale.getDefault(), "four");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.FIVE", Locale.getDefault(), "five");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.SIX", Locale.getDefault(), "six");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.SEVEN", Locale.getDefault(), "seven");
View Full Code Here

 
  public void testGetTableCellRendererComponent() {
    StaticMessageSource messageSource = new StaticMessageSource();
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.ONE", Locale.getDefault(), "one");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.TWO", Locale.getDefault(), "two");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.THREE", Locale.getDefault(), "three");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.FOUR", Locale.getDefault(), "four");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.FIVE", Locale.getDefault(), "five");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.SIX", Locale.getDefault(), "six");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.SEVEN", Locale.getDefault(), "seven");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.EIGHT", Locale.getDefault(), "eight");
View Full Code Here

  public void testGetTableCellRendererComponent() {
    StaticMessageSource messageSource = new StaticMessageSource();
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.ONE", Locale.getDefault(), "one");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.TWO", Locale.getDefault(), "two");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.THREE", Locale.getDefault(), "three");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.FOUR", Locale.getDefault(), "four");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.FIVE", Locale.getDefault(), "five");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.SIX", Locale.getDefault(), "six");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.SEVEN", Locale.getDefault(), "seven");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.EIGHT", Locale.getDefault(), "eight");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.NINE", Locale.getDefault(), "nine");
View Full Code Here

    StaticMessageSource messageSource = new StaticMessageSource();
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.ONE", Locale.getDefault(), "one");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.TWO", Locale.getDefault(), "two");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.THREE", Locale.getDefault(), "three");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.FOUR", Locale.getDefault(), "four");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.FIVE", Locale.getDefault(), "five");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.SIX", Locale.getDefault(), "six");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.SEVEN", Locale.getDefault(), "seven");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.EIGHT", Locale.getDefault(), "eight");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.NINE", Locale.getDefault(), "nine");
    messageSource.addMessage("org.springframework.richclient.table.renderer.EnumTableCellRendererTests$Numbers.TEN", Locale.getDefault(), "ten");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.