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
1 change: 1 addition & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This is a minor release.
* [#431](https://github.com/pmd/pmd-eclipse-plugin/pull/431): chore: Improve logging during tests at waitForPMDJobs - [Andreas Dangel](https://github.com/adangel) (@adangel)
* [#432](https://github.com/pmd/pmd-eclipse-plugin/pull/432): refactor: Remove custom JavaProject cache - [Andreas Dangel](https://github.com/adangel) (@adangel)
* [#449](https://github.com/pmd/pmd-eclipse-plugin/pull/449): chore: Upload surefire reports for failed unit tests - [Andreas Dangel](https://github.com/adangel) (@adangel)
* [#451](https://github.com/pmd/pmd-eclipse-plugin/pull/451): chore: Make ViolationDetailsDialogTest more reliable - [Andreas Dangel](https://github.com/adangel) (@adangel)

### 📦 Dependency updates

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,39 @@ public void openDialogViaProblemView() throws Exception {
openJavaPerspective();

SWTBotView problemsView = bot.viewByPartName("Problems");
SWTBotTreeItem warningsNode = problemsView.bot().tree().getTreeItem("Warnings (4 items)").expand();

// Wait for the tree to fully render
bot.waitUntil(new DefaultCondition() {
@Override
public boolean test() throws Exception {
try {
// Try to find all violation nodes - if all exist, tree is ready
return warningsNode.getItems().length >= 4;
} catch (Exception e) {
return false;
}
}

@Override
public String getFailureMessage() {
return "Warnings tree items did not render";
}
});

// Now search for the marker by partial match or iterate through nodes
SWTBotTreeItem markerItem = null;
for (SWTBotTreeItem node : warningsNode.getItems()) {
if (node.getText().contains("UnnecessaryModifier")) {
markerItem = node;
break;
}
}

Assert.assertNotNull("Could not find UnnecessaryModifier violation in Problems view", markerItem);
String markerText = "UnnecessaryModifier: Unnecessary modifier 'public' on method 'run': the method is declared in an interface type";
SWTBotTreeItem item = problemsView.bot().tree().getTreeItem("Warnings (4 items)").expand();
SWTBotTreeItem markerItem = item.getNode(markerText).select();
Assert.assertEquals(markerText, markerItem.getText());
markerItem.select();
markerItem.contextMenu("Show details...").click();

assertDialog();
Expand Down