Ejemplo n.º 1
0
  /** Make sure we are reading a supported version. * */
  protected void checkVersion(Element root) throws InvalidVersionException {
    if (!root.hasAttribute("version"))
      throw new InvalidVersionException(Strings.getString("UnknownVersion"));

    if (!root.getAttribute("version").equals(FILE_FORMAT_VERSION))
      throw new InvalidVersionException(
          Strings.getString("VersionInvalid: ") + root.getAttribute("version"));
  }
  public RecordingItem getAssertionItem() throws Exception {
    if (windowIdentifierPresenter.getSetTitleAction().isEnabled()) {
      String title = windowIdentifierPresenter.getTitleModel().getString();
      if (title.length() <= 0) throw new Exception(Strings.getString("TitleCannotBeNull"));

      return new WindowShowingItem(title);
    } else {
      int val = windowIdentifierPresenter.getIdModel().getValue();
      if (val < 0) throw new Exception(Strings.getString("InvalidWindowID"));

      return new WindowShowingItem(val);
    }
  }
 public String getAssertTitle() {
   return Strings.getString("AssertWindowShowing");
 }