Esempio n. 1
0
  /**
   * @short check concurrent save requests to the same document at the same time.
   * @descr First we simulate an UI save by dispatching the right URL to the document and at the
   *     same time we try to trigger an AutoSave from another thread. So these operations should be
   *     started at the same time. It should not crash. The AutoSave request must be postphoned.
   */
  @Test
  public void checkConcurrentAutoSaveToNormalUISave() {
    m_aLog.log(Protocol.TYPE_TESTMARK, "AutoSave");
    m_aLog.log(Protocol.TYPE_SCOPE_OPEN, "checkConcurrentAutoSaveToNormalUISave()");

    AutoSaveListener xListener = new AutoSaveListener(m_xSMGR, m_xAutoSave, m_aLog);

    try {
      DocThread aThread = new DocThread();
      aThread.start();
      aThread.join();
    } catch (Throwable ex) {
    }

    xListener.disableListener();

    m_aLog.log(Protocol.TYPE_SCOPE_CLOSE, "checkConcurrentAutoSaveToNormalUISave()");
    m_aLog.logStatistics();
  }