Examples of NoSuchMessageException


Examples of org.springframework.context.NoSuchMessageException

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

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

Examples of org.springframework.context.NoSuchMessageException

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

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

Examples of org.springframework.context.NoSuchMessageException

  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

Examples of org.springframework.context.NoSuchMessageException

  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

Examples of plugins.Freetalk.exceptions.NoSuchMessageException

      q.descend("mMessage").constrain(message).identity();
      q.descend("mBoard").constrain(this).identity();
      ObjectSet<DownloadedMessageLink> messageLinks = new Persistent.InitializingObjectSet<Board.DownloadedMessageLink>(mFreetalk, q);
     
      switch(messageLinks.size()) {
        case 0: throw new NoSuchMessageException(message.getID());
        case 1: return messageLinks.next();
        default: throw new DuplicateMessageException(message.getID());
      }
    }
View Full Code Here

Examples of plugins.Freetalk.exceptions.NoSuchMessageException

        q.descend("mBoard").constrain(this).identity();
        q.descend("mIndex").constrain(index);
      final ObjectSet<DownloadedMessageLink> messageLinks = new Persistent.InitializingObjectSet<Board.DownloadedMessageLink>(mFreetalk, q);
     
      switch(messageLinks.size()) {
        case 0: throw new NoSuchMessageException("index: " + index);
        case 1: return messageLinks.next();
        default: throw new DuplicateMessageException("index: " + index);
      }
    }
View Full Code Here

Examples of plugins.Freetalk.exceptions.NoSuchMessageException

      case 1:
        final Message m = result.next();
        m.initializeTransient(mFreetalk);
        return m;
      case 0:
        throw new NoSuchMessageException(id);
      default:
        throw new DuplicateMessageException(id);
    }
  }
View Full Code Here

Examples of plugins.Freetalk.exceptions.NoSuchMessageException

      case 1:
        final OwnMessage m = result.next();
        m.initializeTransient(mFreetalk);
        return m;
      case 0:
        throw new NoSuchMessageException(id);
      default:
        throw new DuplicateMessageException(id);
    }
  }
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.