use of org.eclipse.n4js.projectModel.IN4JSArchive in project n4js by eclipse.
the class AbstractN4JSArchiveTest method testGetLocation.
@SuppressWarnings("javadoc")
@Test
public void testGetLocation() {
IN4JSArchive archive = getArchive();
assertEquals(archiveFileURI, archive.getLocation());
}
use of org.eclipse.n4js.projectModel.IN4JSArchive in project n4js by eclipse.
the class AbstractN4JSArchiveTest method testGetLibraryName.
@SuppressWarnings("javadoc")
@Test
public void testGetLibraryName() {
IN4JSArchive archive = getArchive();
assertEquals(archiveProjectId, archive.getProjectId());
}
use of org.eclipse.n4js.projectModel.IN4JSArchive in project n4js by eclipse.
the class AbstractN4JSArchiveTest method testGetSourceContainers_02.
@SuppressWarnings("javadoc")
@Test
public void testGetSourceContainers_02() {
IN4JSArchive archive = getArchive();
ImmutableList<? extends IN4JSSourceContainer> first = archive.getSourceContainers();
ImmutableList<? extends IN4JSSourceContainer> second = archive.getSourceContainers();
assertEquals(first, second);
}
use of org.eclipse.n4js.projectModel.IN4JSArchive in project n4js by eclipse.
the class AbstractN4JSArchiveTest method testGetProject.
@SuppressWarnings("javadoc")
@Test
public void testGetProject() {
IN4JSArchive archive = getArchive();
assertEquals(myProjectId, archive.getProject().getProjectId());
}
use of org.eclipse.n4js.projectModel.IN4JSArchive in project n4js by eclipse.
the class NfarStorageMapper method updateCache.
private void updateCache(IN4JSEclipseProject project) {
Set<URI> libArchives = knownLibArchives.get(project.getLocation());
if (libArchives != null) {
Map<URI, Set<URI>> filteredMap = Maps.filterKeys(knownLibArchives, Predicates.not(Predicates.equalTo(project.getLocation())));
Set<URI> remainingLibs = Sets.newHashSet(Iterables.concat(filteredMap.values()));
for (URI archive : libArchives) {
if (!remainingLibs.contains(archive)) {
knownEntries.remove(archive);
}
}
}
if (project.exists()) {
libArchives = Sets.newHashSetWithExpectedSize(3);
List<? extends IN4JSArchive> libraries = project.getLibraries();
for (IN4JSArchive archive : libraries) {
URI location = archive.getLocation();
libArchives.add(location);
if (!knownEntries.containsKey(location)) {
Set<URI> entryURIs = Sets.newHashSet();
traverseArchive(archive, entryURIs);
knownEntries.put(location, Collections.unmodifiableSet(entryURIs));
}
}
knownLibArchives.put(project.getLocation(), libArchives);
} else {
knownLibArchives.remove(project.getLocation());
}
}
Aggregations