IErlElementLocator.Scope.PROJECT_ONLY);
final IErlModule z2 = model.findIncludeFromModule(module, zz, null,
IErlElementLocator.Scope.ALL_PROJECTS);
final IErlModule z3 = model.findIncludeFromModule(module, zz, null,
IErlElementLocator.Scope.REFERENCED_PROJECTS);
final IProjectDescription description = workspaceProject.getDescription();
description.setReferencedProjects(new IProject[] { project1
.getWorkspaceProject() });
workspaceProject.setDescription(description, null);
myProject.open(null);
final IErlModule z4 = model.findIncludeFromModule(module, zz, null,
IErlElementLocator.Scope.PROJECT_ONLY);
final IErlModule z5 = model.findIncludeFromModule(module, zz, null,
IErlElementLocator.Scope.ALL_PROJECTS);
final IErlModule z6 = model.findIncludeFromModule(module, zz, null,
IErlElementLocator.Scope.REFERENCED_PROJECTS);
final String ww = "ww";
final IErlModule w1 = model.findIncludeFromModule(module, ww, null,
IErlElementLocator.Scope.PROJECT_ONLY);
final IErlElementLocator mymodel = ErlangEngine.getInstance().getModel();
final IErlModule w2 = mymodel.findIncludeFromProject(myProject, ww, null,
IErlElementLocator.Scope.PROJECT_ONLY);
// then
// scope should be respected
assertNotNull(x1);
assertEquals(xxHrl, x1.getName());
assertNotNull(x2);
assertEquals(xxHrl, x2.getName());
assertNotNull(x3);
assertEquals(xxHrl, x3.getName());
assertEquals(include, y1);
assertEquals(include, y2);
assertEquals(include, y3);
assertNull(z1);
assertEquals(referencedInclude, z2);
assertNull(z3);
assertNull(z4);
assertEquals(referencedInclude, z5);
assertEquals(referencedInclude, z6);
assertEquals(includeInModuleDir, w1);
assertNull(w2);
} finally {
if (externalIncludeFile != null && externalIncludeFile.exists()) {
externalIncludeFile.delete();
}
((ErlProject) myProject).setIncludeDirs(includeDirs);
final IProjectDescription description = workspaceProject.getDescription();
description.setReferencedProjects(referencedProjects);
workspaceProject.setDescription(description, null);
}
}