use of org.eclipse.m2e.core.ui.internal.editing.PomEdits.EXCLUSION in project m2e-core-tests by tesla.
the class ExcludeArtifactRefactoringTest method hasExclusionSet.
/*
* The editor has the given exclusion set
*/
protected static boolean hasExclusionSet(MavenPomEditor editor, final ArtifactKey dependencyKey, final ArtifactKey excluded) throws Exception {
final boolean[] found = new boolean[1];
found[0] = false;
performOnDOMDocument(new OperationTuple(editor.getDocument(), document -> {
Element dep = findChild(findChild(document.getDocumentElement(), DEPENDENCIES), DEPENDENCY, childEquals(GROUP_ID, dependencyKey.getGroupId()), childEquals(ARTIFACT_ID, dependencyKey.getArtifactId()), childEquals(VERSION, dependencyKey.getVersion()));
if (dep != null) {
Element exclusion = findChild(findChild(dep, EXCLUSIONS), EXCLUSION, childEquals(GROUP_ID, excluded.getGroupId()), childEquals(ARTIFACT_ID, excluded.getArtifactId()));
found[0] = exclusion != null;
}
}, true));
return found[0];
}
Aggregations