use of com.google.devtools.build.lib.packages.AspectDescriptor in project bazel by bazelbuild.
the class AspectCollectionTest method validateAspectPaths.
private static void validateAspectPaths(AspectCollection collection, ImmutableList<Pair<Aspect, ImmutableList<Aspect>>> expectedList) {
HashMap<AspectDescriptor, AspectDeps> allPaths = new HashMap<>();
for (AspectDeps aspectPath : collection.getVisibleAspects()) {
collectAndValidateAspectDeps(aspectPath, allPaths);
}
HashSet<AspectDescriptor> expectedKeys = new HashSet<>();
for (Pair<Aspect, ImmutableList<Aspect>> expected : expectedList) {
assertThat(allPaths).containsKey(expected.first.getDescriptor());
AspectDeps aspectPath = allPaths.get(expected.first.getDescriptor());
assertThat(Iterables.transform(aspectPath.getDependentAspects(), ASPECT_PATH_TO_DESCRIPTOR)).containsExactlyElementsIn(Iterables.transform(expected.second, ASPECT_TO_DESCRIPTOR)).inOrder();
expectedKeys.add(expected.first.getDescriptor());
}
assertThat(allPaths.keySet()).containsExactlyElementsIn(expectedKeys);
}
Aggregations