Search in sources :

Example 1 with IN4JSArchive

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());
}
Also used : IN4JSArchive(org.eclipse.n4js.projectModel.IN4JSArchive) Test(org.junit.Test)

Example 2 with IN4JSArchive

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());
}
Also used : IN4JSArchive(org.eclipse.n4js.projectModel.IN4JSArchive) Test(org.junit.Test)

Example 3 with IN4JSArchive

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);
}
Also used : IN4JSArchive(org.eclipse.n4js.projectModel.IN4JSArchive) Test(org.junit.Test)

Example 4 with IN4JSArchive

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());
}
Also used : IN4JSArchive(org.eclipse.n4js.projectModel.IN4JSArchive) Test(org.junit.Test)

Example 5 with IN4JSArchive

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());
    }
}
Also used : Set(java.util.Set) IN4JSArchive(org.eclipse.n4js.projectModel.IN4JSArchive) URI(org.eclipse.emf.common.util.URI)

Aggregations

IN4JSArchive (org.eclipse.n4js.projectModel.IN4JSArchive)10 Test (org.junit.Test)7 URI (org.eclipse.emf.common.util.URI)2 ImmutableList (com.google.common.collect.ImmutableList)1 Set (java.util.Set)1 ProjectDescription (org.eclipse.n4js.n4mf.ProjectDescription)1 SimpleProjectDescription (org.eclipse.n4js.n4mf.SimpleProjectDescription)1 IN4JSProject (org.eclipse.n4js.projectModel.IN4JSProject)1 IN4JSSourceContainer (org.eclipse.n4js.projectModel.IN4JSSourceContainer)1