// throws BackingStoreException;
@Test
public void getExternalModules() throws Exception {
File externalFile = null;
File externalsFile = null;
final IErlProject aProject = project2;
final String externalModulesString = aProject.getProperties()
.getExternalModules();
try {
// given
// an erlang project and an external file not in any project
final String externalFileName = "external.erl";
externalFile = createTmpFile(externalFileName,
"-module(external).\nf([_ | _]=L ->\n atom_to_list(L).\n");
final String absolutePath = externalFile.getAbsolutePath();
externalsFile = createTmpFile(XX_ERLIDEX, absolutePath);
aProject.open(null);
final Collection<IErlModule> otpModules = aProject.getExternalModules();
((ErlProject) aProject).setExternalModulesFile(externalsFile
.getAbsolutePath());
aProject.open(null);
// when
// fetching all external modules
final Collection<IErlModule> externalModules = aProject.getExternalModules();
// then
// the external file should be returned
final Set<IErlModule> otpSet = Sets.newHashSet(otpModules);
final Set<IErlModule> externalSet = Sets.newHashSet(externalModules);
final Set<IErlModule> difference = Sets.difference(externalSet, otpSet);