1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
Feature: Threads
Background:
Given I have maven project "m" in "tmp"
And I add project "m" folder "tmp" to the list of workspace folders
And I open a java file "tmp/m/src/main/java/temp/App.java"
And I clear the buffer
And I insert:
"""
package temp;
class App {
public static void main(String[] args) {
foo();
}
public static void foo() {
System.out.print(123);
}
}
"""
And I call "save-buffer"
And I start lsp-java
And The server status must become "^LSP[jdtls:[0-9]+]$"
And I place the cursor before "System"
And I call "dap-breakpoint-toggle"
And I go to beginning of buffer
And I attach handler "breakpoint" to hook "dap-stopped-hook"
And I call "dap-java-debug"
And The hook handler "breakpoint" would be called
And the cursor should be before "System"
@Threads
Scenario: Listing sessions
When I call "dap-ui-sessions"
Then I should be in buffer "*sessions*"
Then I should see:
"""
[+] temp.App (m) (running)
"""
@Threads
Scenario: Listing sessions - listing threads
When I call "dap-ui-sessions"
Then I should be in buffer "*sessions*"
And I should see:
"""
[+] temp.App (m) (running)
"""
When I place the cursor before "temp"
And I attach handler "threads-expanded" to hook "dap-ui-stack-frames-loaded"
And I call "tree-mode-expand-level"
Then I should see:
"""
[-] temp.App (m) (running)
‘-Loading...
"""
And The hook handler "threads-expanded" would be called
Then I should see:
"""
[-] temp.App (m) (running)
|-[+] Thread [Signal Dispatcher]
|-[+] Thread [Finalizer]
|-[+] Thread [Reference Handler]
‘-[+] Thread [main]
"""
@Threads @UI @Stackframes
Scenario: Stackframes
When I call "dap-ui-sessions"
Then I should be in buffer "*sessions*"
And I should see:
"""
[+] temp.App (m) (running)
"""
When I place the cursor before "temp"
And I attach handler "threads-expanded" to hook "dap-ui-stack-frames-loaded"
And I call "tree-mode-expand-level"
And The hook handler "threads-expanded" would be called
And I should see:
"""
[-] temp.App (m) (running)
|-[+] Thread [Signal Dispatcher]
|-[+] Thread [Finalizer]
|-[+] Thread [Reference Handler]
‘-[+] Thread [main] (stopped)
"""
When I place the cursor before "main"
And I call "tree-mode-expand-level"
And I should see:
"""
[-] temp.App (m) (running)
|-[+] Thread [Signal Dispatcher]
|-[+] Thread [Finalizer]
|-[+] Thread [Reference Handler]
‘-[-] Thread [main] (stopped)
|-App.foo() (App.java:8)
‘-App.main(String[]) (App.java:5)
"""
|