コード例 #1
0
  public void swapOut() {
    if (fTestRoot == null) return;
    if (isRunning() || isStarting() || isKeptAlive()) return;

    Object[] listeners = fSessionListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
      ITestSessionListener registered = (ITestSessionListener) listeners[i];
      if (!registered.acceptsSwapToDisk()) return;
    }

    try {
      File swapFile = getSwapFile();

      DLTKTestingModel.exportTestRunSession(this, swapFile);
      fTestResult = fTestRoot.getTestResult(true);
      fTestRoot = null;
      fTestRunnerClient = null;
      fIdToTest = new HashMap<String, TestElement>();
      fCategoryMap = new HashMap<String, TestCategoryElement>();
      fIncompleteTestSuites = null;
      fUnrootedSuite = null;

    } catch (IllegalStateException e) {
      DLTKTestingPlugin.log(e);
    } catch (CoreException e) {
      DLTKTestingPlugin.log(e);
    }
  }
コード例 #2
0
  public void swapIn() {
    if (fTestRoot != null) return;

    try {
      DLTKTestingModel.importIntoTestRunSession(getSwapFile(), this);
    } catch (IllegalStateException e) {
      DLTKTestingPlugin.log(e);
      fTestRoot = new TestRoot(this);
      fTestResult = null;
    } catch (CoreException e) {
      DLTKTestingPlugin.log(e);
      fTestRoot = new TestRoot(this);
      fTestResult = null;
    }
  }
コード例 #3
0
 private File getSwapFile() throws IllegalStateException {
   File historyDir = DLTKTestingPlugin.getHistoryDirectory();
   String isoTime =
       new SimpleDateFormat("yyyyMMdd-HHmmss.SSS").format(new Date(getStartTime())); // $NON-NLS-1$
   String swapFileName = isoTime + ".xml"; // $NON-NLS-1$
   return new File(historyDir, swapFileName);
 }