Skip to content

feat(java-bridge): implement PowerMock support to fix test tree disappearance#30

Closed
runchen0919 wants to merge 1 commit into
monkey666-cr:mainfrom
runchen0919:feat/powermock-support
Closed

feat(java-bridge): implement PowerMock support to fix test tree disappearance#30
runchen0919 wants to merge 1 commit into
monkey666-cr:mainfrom
runchen0919:feat/powermock-support

Conversation

@runchen0919

Copy link
Copy Markdown
Contributor

Summary

This PR implements a bytecode-level fix for the issue where PowerMock test methods disappear from the VS Code Test Explorer after running a single test.

Key Changes

  • Added PowerMockRunnerPatcher as an OSGi WeavingHook to intercept vscode-java-test bundle loading.
  • Injected a bytecode guard to prevent runtime test results from unconditionally overwriting the static test tree when PowerMock is detected.
  • Implemented PowerMockHelper with a dual-layer detection strategy (JDT API + Class name heuristics) and a high-performance cache (ConcurrentHashMap).
  • Added a reproduction project in examples/powermock-repro-project for verification.
  • Provided comprehensive design documentation in both English and Chinese.

Verification

  • Unit tests for PowerMockHelper and PowerMockRunnerPatcher are included.
  • Manual verification using the reproduction project confirms that the test tree remains intact after running individual tests.

…pearance

- Add PowerMockRunnerPatcher to intercept and fix test method disappearance
- Implement PowerMockHelper for bytecode manipulation of PowerMock runners
- Register PowerMock patcher as a WeavingHook in BazelActivator
- Add comprehensive documentation in PowerMock-Design-Summary.md
- Include a reproduction project in examples/powermock-repro-project
- Update README files to reflect new PowerMock support capabilities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants