Package org.springframework.context

Examples of org.springframework.context.NoSuchMessageException


      String fallback = getDefaultMessage(codes[0]);
      if (fallback != null) {
        return fallback;
      }
    }
    throw new NoSuchMessageException(codes.length > 0 ? codes[codes.length - 1] : null, locale);
  }
View Full Code Here


    }
    String fallback = getDefaultMessage(code);
    if (fallback != null) {
      return fallback;
    }
    throw new NoSuchMessageException(code, locale);
  }
View Full Code Here

      String fallback = getDefaultMessage(codes[0]);
      if (fallback != null) {
        return fallback;
      }
    }
    throw new NoSuchMessageException(codes.length > 0 ? codes[codes.length - 1] : null, locale);
  }
View Full Code Here

  public void shouldThrowOnMissingMessageWhenInProduction() throws Exception {
    given(this.viewRoot.getViewId()).willReturn("/WEB-INF/pages/example/page.xhtml");
    given(this.facesContext.isProjectStage(ProjectStage.Production)).willReturn(true);
    MessageSourceMap messageSourceMap = callSetParent();
    given(this.applicationContext.getMessage((MessageSourceResolvable) any(), (Locale) any())).willThrow(
        new NoSuchMessageException("test"));
    this.thrown.expect(NoSuchMessageException.class);
    messageSourceMap.get("test").toString();
  }
View Full Code Here

  public void shouldAddFacesMessageOnMissingMessageWhenNotInProduction() throws Exception {
    given(this.viewRoot.getViewId()).willReturn("/WEB-INF/pages/example/page.xhtml");
    given(this.facesContext.isProjectStage(ProjectStage.Production)).willReturn(false);
    MessageSourceMap messageSourceMap = callSetParent();
    given(this.applicationContext.getMessage((MessageSourceResolvable) any(), (Locale) any())).willThrow(
        new NoSuchMessageException("test"));
    messageSourceMap.get("test").toString();
    verify(this.facesContext).addMessage(anyString(), this.messageCaptor.capture());
    assertThat(this.messageCaptor.getValue().getDetail(), is("No message found under code 'test' for locale '"
        + Locale.getDefault().toString() + "'."));
  }
View Full Code Here

TOP

Related Classes of org.springframework.context.NoSuchMessageException

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.