Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 482 submodule tests #134

Merged
merged 2 commits into from
Jan 11, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/**
* Hello fellow tester: everytime this test finds a regression add an 'x' here: everytime you do mindless test update
* add an 'y' here:
* add an 'y' here: y
*
* @author mkleint
*/
Expand All @@ -48,12 +48,12 @@ public void testMNGEclipse2552() throws Exception {
IProject project = projects[0];
IMarker[] markers = project.findMarkers(IMavenConstants.MARKER_POM_LOADING_ID, true, IResource.DEPTH_INFINITE);
assertEquals(2, markers.length);
XmlEditorHelpers.assertEditorHintWarningMarker(IMavenConstants.MARKER_POM_LOADING_ID,
IMavenConstants.EDITOR_HINT_PARENT_GROUP_ID, null /* message */, 8 /* lineNumber */, 1 /* resolutions */,
markers[0]);
XmlEditorHelpers.assertEditorHintWarningMarker(IMavenConstants.MARKER_POM_LOADING_ID,
IMavenConstants.EDITOR_HINT_PARENT_VERSION, null /* message */, 10 /* lineNumber */, 1 /* resolutions */,
markers[1]);
// The order is non-deterministic so check both variants
try {
assertMarkers(markers, 1, 0);
} catch (Error e) {
assertMarkers(markers, 0, 1);
}
// Fix the problem - the marker should be removed
copyContent(project, "pom_good.xml", "pom.xml");
markers = project.findMarkers(IMavenConstants.MARKER_POM_LOADING_ID, true, IResource.DEPTH_INFINITE);
Expand Down Expand Up @@ -89,4 +89,13 @@ public void testMNGEclipse2552() throws Exception {
}
}


private void assertMarkers(IMarker[] markers, int indexToCheckFirst, int indexToCheckSecond) throws Exception {
XmlEditorHelpers.assertEditorHintWarningMarker(IMavenConstants.MARKER_POM_LOADING_ID,
IMavenConstants.EDITOR_HINT_PARENT_GROUP_ID, null /* message */, 8 /* lineNumber */, 1 /* resolutions */,
markers[indexToCheckFirst]);
XmlEditorHelpers.assertEditorHintWarningMarker(IMavenConstants.MARKER_POM_LOADING_ID,
IMavenConstants.EDITOR_HINT_PARENT_VERSION, null /* message */, 10 /* lineNumber */, 1 /* resolutions */,
markers[indexToCheckSecond]);
}
}