IProject project;
long taskCount;
// Test project with dub.json, but no D nature
LatchRunnable latchRunnable = new LatchRunnable();
getModelAgent().submit(latchRunnable);
taskCount = getModelAgent().getSubmittedTaskCount();
project = createAndOpenProject(DUB_TEST, true).getProject();
writeDubJson(project, jsObject(jsEntry("name", "xptobundle")));
// check no changes or updates submitted:
assertTrue(getModelAgent().getSubmittedTaskCount() == taskCount);
assertTrue(model.getBundleInfo(project) == null);
latchRunnable.releaseAll();
// Ensure non-d projects dont provoke updates
deleteProject(DUB_TEST);
assertTrue(getModelAgent().getSubmittedTaskCount() == taskCount);
// Test project with D nature, but no dub.json
taskCount = getModelAgent().getSubmittedTaskCount();
project = createAndOpenDeeProject(DUB_TEST, true).getProject();
// check no changes or updates submitted:
assertTrue(getModelAgent().getSubmittedTaskCount() == taskCount);
assertTrue(model.getBundleInfo(project) == null);
// Test concurrency: updating a project that was removed in the meantime
LatchRunnable preUpdateLatch = writeDubJsonWithModelLatch(project,
"{"+ jsEntry("name", "xptobundle")+ jsFileEnd());
DubBundleDescription unresolvedBundleDesc = getExistingDubBundleInfo(project);
assertTrue(model.getBundleInfo(project) != null);
project.delete(true, null);
preUpdateLatch.releaseAll();
_awaitModelUpdates_();
assertTrue(model.getBundleInfo(project) == null);
_awaitModelUpdates_();
// Run sequence of workspace model tests
project = createAndOpenDeeProject(DUB_TEST, true).getProject();
runBasicTestSequence______________(project);
project.delete(true, null); // cleanup
assertTrue(model.getBundleInfo(project) == null);
assertTrue(model.getProjectInfo(project) == null);
// Verify code path where a non-D project that already has dub manifest is made a D project.
_awaitModelUpdates_();
project = createAndOpenProject(DUB_TEST, true);
LatchRunnable modelLatch = writeDubJsonWithModelLatch(project, jsObject(jsEntry("name", "xptobundle")));
setupStandardDeeProject(project);
System.out.println("--------- .project contents: ");
System.out.println(readFileContents(project.getFile(".project")));
unresolvedBundleDesc = getExistingDubBundleInfo(project);
modelLatch.releaseAll();
checkDubModel(unresolvedBundleDesc, project,
main(loc(project), null, "xptobundle", DubBundle.DEFAULT_VERSION, srcFolders(), rawDeps()));
testProjectBPDependencies();
}