Skip to content

Cs claude/add tests and jacoco#11

Open
carltham wants to merge 4 commits into
emilianbold:mainfrom
carltham:cs-claude/add-tests-and-jacoco
Open

Cs claude/add tests and jacoco#11
carltham wants to merge 4 commits into
emilianbold:mainfrom
carltham:cs-claude/add-tests-and-jacoco

Conversation

@carltham

Copy link
Copy Markdown

I tried to stabilise the build with tests, and I can maybe take over as maintainer

Carl Sundvisson and others added 4 commits June 13, 2026 18:05
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>
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.

1 participant