Cs claude/add tests and jacoco#11
Open
carltham wants to merge 4 commits into
Open
Conversation
Adds 25 unit tests across DiffTabTrackerTest, MCPResponseBuilderTest, NetBeansMCPHandlerTest, and extends CloseTabTest/CloseAllDiffTabsTest. Adds jacoco-maven-plugin 0.8.11 to generate coverage reports on mvn test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds NbUtilsTest, LockFileManagerTest, and extends CloseTabTest and NetBeansMCPHandlerTest. Splits catch blocks in NetBeansMCPHandler so IllegalArgumentException (bad client input) is returned silently while unexpected exceptions are still logged at WARNING. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add 43 new tests across NetBeansMCPHandlerTest, LockFileManagerTest, NbUtilsTest, CloseTabTest, CloseAllDiffTabsTest, GetWorkspaceFoldersTest, GetDiagnosticsTest/InternalTest, GetCurrentSelectionTest, CheckDocumentDirtyTest, GetOpenEditorsTest, OpenFileTest, SaveDocumentTest, ToolMetadataTest, and new GetDiagnosticsInternalTest - Test real NB registry paths (findTopComponent, closeAllDiffTabs loop), createLockFile/updateLockFile filesystem lifecycle, Mockito-based WebSocket session tracking (startSelectionTracking/startDiffTabTracking), sendAsyncToolResponse via mocked Jetty RemoteEndpoint, handleDiffTabClosed with DiffTabTracker integration, and GetDiagnostics.createDiagnostic/convertAnnotationToDiagnostic internals - Make sendAsyncToolResponse and handleDiffTabClosed (NetBeansMCPHandler) and createDiagnostic/convertAnnotationToDiagnostic (GetDiagnostics) package-private to enable direct testing - Expand JaCoCo excludes to drop NB lifecycle/UI classes and OpenDiff (EditorUtils, WebSocketMCPServer, MCPWebSocketHandler, ClaudeCodeInstaller, ClaudeCodeAction, ClaudeCodeStatusLineElement, Bundle, OpenDiff, NetBeansMCPHandler$*, GetWorkspaceFolders$*) from the coverage denominator since they require a running NB instance; 58% represents the realistic ceiling for unit tests without NB platform integration Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add protected-method seams to tool classes so tests can inject mock NB platform objects without a running NetBeans instance. Add comprehensive test suites covering all major code paths: error/catch branches, async tool responses, DataObject/FileObject lookup chains, project-info seams, lock-file I/O failures, and MCP handler edge cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tried to stabilise the build with tests, and I can maybe take over as maintainer