Пример #1
0
  /**
   * Starts to load a component and then immediately tries to cancel the process.
   *
   * <p>Has <b>OK</b> status if the process was cancelled or finished (appropriate listener methods
   * were called).
   */
  public void _cancel() {
    boolean result = true;

    oObj.load(frame, url, args, listener);
    oObj.cancel();

    shortWait();

    if (listener.cancelled) {
      log.println("Loading was canceled.");
    }
    if (listener.finished) {
      log.println("Loading was finished.");
      loaded = true;
    }
    if (!listener.cancelled && !listener.finished) {
      log.println("Loading was not canceled and not finished");
      result = false;
    }

    tRes.tested("cancel()", result);
  }
Пример #2
0
  /**
   * Firts <code>cancel</code> method test is called. If in that test loaing process was interrupted
   * by <code>cancel</code> call then <code>load</code> test executes. It loads a component, waits
   * some moment to listener have a chance to be called and then checks if the load listener was
   * called.
   *
   * <p>Has <b>OK</b> status if <code>cancel</code> method test didn't interrupt loading and it was
   * successful, or if in this method it loads successful and listener's <code>finished</code>
   * method was called. The following method tests are to be executed before :
   *
   * <ul>
   *   <li><code> cancel() </code>
   * </ul>
   */
  public void _load() {
    executeMethod("cancel()");

    if (!loaded) {
      oObj.load(frame, url, args, listener);

      shortWait();

      loaded = listener.finished;
    }

    tRes.tested("load()", loaded);
  }