IErlElementLocator.Scope.PROJECT_ONLY);
final IErlModule x2 = model.findIncludeFromProject(aProject, xx, null,
IErlElementLocator.Scope.ALL_PROJECTS);
final IErlModule x3 = model.findIncludeFromProject(aProject, xx, null,
IErlElementLocator.Scope.REFERENCED_PROJECTS);
final IProjectDescription description = workspaceProject.getDescription();
description.setReferencedProjects(new IProject[] { project1
.getWorkspaceProject() });
workspaceProject.setDescription(description, null);
aProject.open(null);
final IErlModule x4 = model.findIncludeFromProject(aProject, xx, null,
IErlElementLocator.Scope.PROJECT_ONLY);
final IErlModule x5 = model.findIncludeFromProject(aProject, xx, null,
IErlElementLocator.Scope.ALL_PROJECTS);
final IErlModule x6 = model.findIncludeFromProject(aProject, xx, null,
IErlElementLocator.Scope.REFERENCED_PROJECTS);
// then
// the non-external should be preferred
assertNotNull(x1);
assertEquals(xxHrl, x1.getName());
assertNotSame(referencedInclude, x1);
assertEquals(referencedInclude, x2);
assertNotNull(x3);
assertEquals(xxHrl, x3.getName());
assertNotSame(referencedInclude, x3);
assertNotNull(x4);
assertNotSame(referencedInclude, x4);
assertEquals(referencedInclude, x5);
assertEquals(referencedInclude, x6);
} finally {
if (externalIncludeFile != null && externalIncludeFile.exists()) {
externalIncludeFile.delete();
}
((ErlProject) aProject).setIncludeDirs(includeDirs);
final IProjectDescription description = workspaceProject.getDescription();
description.setReferencedProjects(referencedProjects);
workspaceProject.setDescription(description, null);
}
}