]> source.dussan.org Git - aspectj.git/commitdiff
Fix MultiProjectIncrementalTests.testAspectPath_pr265693, 2nd try
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Thu, 11 Mar 2021 10:57:58 +0000 (17:57 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Thu, 11 Mar 2021 10:57:58 +0000 (17:57 +0700)
Do not assume a certain element order for tree nodes if there can be
more than one.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
tests/src/test/java/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index 968c37ae009758a3b47deb2a6fe41eb311d22efd..8e5db450f1648e351d14c245e8101aebb00795af 100644 (file)
@@ -1697,9 +1697,13 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                IProgramElement root = getModelFor(bug2).getHierarchy().getRoot();
                IProgramElement binariesNode = getChild(root, "binaries");
                assertNotNull(binariesNode);
-               IProgramElement packageNode = binariesNode.getChildren().get(0);
-               assertEquals("a.b.c", packageNode.getName());
+               IProgramElement packageNode = binariesNode.getChildren().stream()
+                       .filter(programElement -> programElement.getName().equals("a.b.c"))
+                       .findFirst()
+                       .orElse(null);
+               assertNotNull(packageNode);
                IProgramElement fileNode = packageNode.getChildren().get(0);
+               assertNotNull(fileNode);
                assertEquals(IProgramElement.Kind.FILE, fileNode.getKind());
        }
 
@@ -4015,4 +4019,4 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                }
        }
 
-}
\ No newline at end of file
+}