Skip to content

Commit 4e5f24a

Browse files
committed
Wait for auto-build in JavaModelTests.testGetNonJavaResources
Logging of received deltas shows AutoBuildJob.AutoBuildOffJob usually sending the deltas necessary for the test to pass. In the case of testGetNonJavaResources failing, AutoBuildOffJob ran slightly earlier and did not notify about changes for test project SP2. This change adds waiting on auto-build, which will also join the AutoBuildOffJob. This hopefully ensures delta notifications are received before doing assertions in the test. See: #2716
1 parent 29b848c commit 4e5f24a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaModelTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,30 +486,34 @@ public void testGetJavaProjects2() throws CoreException {
486486
/*
487487
* Test retrieving non-Java projects.
488488
*/
489-
public void testGetNonJavaResources() throws CoreException {
489+
public void testGetNonJavaResources() throws Exception {
490490
try {
491491
IJavaModel model = getJavaModel();
492492

493493
this.createJavaProject("JP", new String[]{}, "");
494+
waitForAutoBuild();
494495
assertResourceNamesEqual(
495496
"Unexpected non-Java resources",
496497
"",
497498
model.getNonJavaResources());
498499

499500
createProject("SP1");
501+
waitForAutoBuild();
500502
assertResourceNamesEqual(
501503
"Unexpected non-Java resources after creation of SP1",
502504
"SP1",
503505
model.getNonJavaResources());
504506

505507
createProject("SP2");
508+
waitForAutoBuild();
506509
assertResourceNamesEqual(
507510
"Unexpected non-Java resources after creation of SP2",
508511
"SP1\n" +
509512
"SP2",
510513
model.getNonJavaResources());
511514

512515
this.deleteProject("SP1");
516+
waitForAutoBuild();
513517
assertResourceNamesEqual(
514518
"Unexpected non-Java resources after deletion of SP1",
515519
"SP2",

0 commit comments

Comments
 (0)