feat: add JavaTestRunAllTests and JavaTestDebugAllTests commands by mKrswe · Pull Request #467 · nvim-java/nvim-java · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions lua/java-test/api.lua
28 changes: 28 additions & 0 deletions lua/java-test/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,34 @@ function M.run_current_method()
.run()
end

function M.run_all_tests()
log.info('run all tests')

return runner(function()
local test_api = JavaTestApi:new({
client = lsp_utils.get_jdtls(),
runner = DapRunner(),
})
return test_api:execute_all_tests(M.get_report(), { noDebug = true })
end)
.catch(get_error_handler('failed to run all tests'))
.run()
end

function M.debug_all_tests()
log.info('debug all tests')

return runner(function()
local test_api = JavaTestApi:new({
client = lsp_utils.get_jdtls(),
runner = DapRunner(),
})
return test_api:execute_all_tests(M.get_report(), {})
end)
.catch(get_error_handler('failed to debug all tests'))
.run()
end

function M.view_last_report()
if M.last_report then
M.last_report:show_report()
Expand Down
12 changes: 12 additions & 0 deletions plugin/java.lua