microsoft / microsoft/vscode-java-debug

Breakpoints not set when using org.mockito:mockito-inline

オープン
#955 コメント 6 件 リアクション 0 件 担当者 1 名 GitHub で見る

@testforstephen がすでに取り組んでいます。

2021年3月8日 から。

ai-triaged bug variables
主要言語
TypeScript
スター
591
フォーク
429
平均マージ
1日 9時間
マージ済み PR(30日)
19

説明

When using org.mockito:mockito-inline in unit tests, trying to debug the tests is harder because upon starting the debug breakpoint will have to be created after all mocks/spies are created.
In addition all live context becomes invisible.

Environment
  • Operating System: MacOS
  • JDK version: openjdk version "11.0.7" 2020-04-14 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
  • Visual Studio Code version: 1.53.2 622cb03f7e070a9670c94bae1a45d78d7181fbd4 x64
  • Java extension version: v0.12.1
  • Java Debugger extension version: v0.31.0
Steps To Reproduce
  1. run git clone https://github.com/sfrank-mc/vscode-java-debug-bug (or go through the code and replicate locally)
  2. open the workspace inside the vscode-java-debug-bug with vscode
  3. open file at src/main/java/vscode/java/debug/bug/App.java and place a breakpoint at line 8
  4. open file at src/test/java/vscode/java/debug/bug/AppTest.java and debug the test called testAppHasAGreeting
  5. notice test will pass without breakpoint being hit.

Workaround and second issue:

  1. open file at src/test/java/vscode/java/debug/bug/AppTest.java and set a breakpoint at line 15
  2. debug the test called testAppHasAGreeting
  3. breakpoint at line 15 is hit. don't continue.
  4. open file at src/main/java/vscode/java/debug/bug/App.java
  5. remove the breakpoint at line 8
  6. re-create the breakpoint at line 8
  7. continue running the debug session (F5)
  8. notice breakpoint is hit.
  9. notice there is no live context info:
Screenshot 2021-03-04 at 09 56 03

Control check:

  1. open file at build.gradle
  2. comment line 30
  3. uncomment line 31
  4. perform steps 3 and 4.
  5. notice breakpoint is hit.
Current Result

Debug breakpoints broken in every run
No debug info even if breakpoint is re-created

Expected Result

Debug breakpoints should be maintained between runs
Debug info should be available

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。