コード例 #1
0
  protected void finishSession() throws InterruptedException {
    disposeDebugProcess();

    if (mySession != null) {
      new WriteAction() {
        protected void run(Result result) throws Throwable {
          mySession.stop();
        }
      }.execute();

      waitFor(
          mySession
              .getDebugProcess()
              .getProcessHandler()); // wait for process termination after session.stop() which is
      // async

      XDebuggerTestUtil.disposeDebugSession(mySession);

      mySession = null;
      myDebugProcess = null;
      myPausedSemaphore = null;
    }

    final ExecutionResult result = myExecutionResult;
    if (myExecutionResult != null) {
      UIUtil.invokeLaterIfNeeded(
          new Runnable() {
            @Override
            public void run() {
              Disposer.dispose(result.getExecutionConsole());
            }
          });
      myExecutionResult = null;
    }
  }
コード例 #2
0
  protected void waitForTerminate() throws InterruptedException, InvocationTargetException {
    setProcessCanTerminate(true);

    Assert.assertTrue(
        "Debugger didn't terminated within timeout\nOutput:" + output(),
        waitFor(myTerminateSemaphore));
    XDebuggerTestUtil.waitForSwing();
  }
コード例 #3
0
 @NotNull
 protected String output() {
   if (mySession != null && mySession.getConsoleView() != null) {
     PythonDebugLanguageConsoleView pydevConsoleView =
         (PythonDebugLanguageConsoleView) mySession.getConsoleView();
     return XDebuggerTestUtil.getConsoleText(pydevConsoleView.getTextConsole());
   }
   return "Console output not available.";
 }
コード例 #4
0
  protected void waitForPause() throws InterruptedException, InvocationTargetException {
    Assert.assertTrue(
        "Debugger didn't stopped within timeout\nOutput:" + output(), waitFor(myPausedSemaphore));

    XDebuggerTestUtil.waitForSwing();
  }
コード例 #5
0
 public Variable(XValue value) throws InterruptedException {
   myValueNode = XDebuggerTestUtil.computePresentation(value);
 }
コード例 #6
0
 protected void setVal(String name, String value)
     throws InterruptedException, PyDebuggerException {
   XValue var = XDebuggerTestUtil.evaluate(mySession, name).first;
   myDebugProcess.changeVariable((PyDebugValue) var, value);
 }
コード例 #7
0
 protected Variable eval(String name) throws InterruptedException {
   Assert.assertTrue("Eval works only while suspended", mySession.isSuspended());
   XValue var = XDebuggerTestUtil.evaluate(mySession, name).first;
   Assert.assertNotNull("There is no variable named " + name, var);
   return new Variable(var);
 }
コード例 #8
0
 private void doToggleBreakpoint(String file, int line) {
   Assert.assertTrue(canPutBreakpointAt(getProject(), file, line));
   XDebuggerTestUtil.toggleBreakpoint(
       getProject(), LocalFileSystem.getInstance().findFileByPath(file), line);
 }