Search in sources :

Example 1 with SharedLibraryEntry

use of com.intellij.lang.javascript.flex.projectStructure.model.SharedLibraryEntry in project intellij-plugins by JetBrains.

the class FlexmojosImporterTestBase method checkLibrariesOfFlexType.

private static void checkLibrariesOfFlexType(final Module module, final FlexBuildConfiguration bc) {
    final List<LibraryOrderEntry> moduleLibEntries = ContainerUtil.filter(ModuleRootManager.getInstance(module).getOrderEntries(), new FilteringIterator.InstanceOf(LibraryOrderEntry.class));
    final List<SharedLibraryEntry> bcLibEntries = ContainerUtil.filter(bc.getDependencies().getEntries(), new FilteringIterator.InstanceOf(SharedLibraryEntry.class));
    assertTrue(bcLibEntries.size() > 0);
    assertEquals(moduleLibEntries.size(), bcLibEntries.size());
    for (SharedLibraryEntry entry : bcLibEntries) {
        assertTrue(entry.getLibraryName().contains(":swc:") || entry.getLibraryName().contains(":rb.swc:") || entry.getLibraryName().contains(":resource-bundle:"));
        assertEquals(LibraryTablesRegistrar.PROJECT_LEVEL, entry.getLibraryLevel());
        final Library library = FlexProjectRootsUtil.findOrderEntry(module.getProject(), entry);
        assertNotNull(library);
        assertTrue(((LibraryEx) library).getKind() == FlexLibraryType.FLEX_LIBRARY);
        checkContainsLibrary(moduleLibEntries, library);
    }
}
Also used : FilteringIterator(com.intellij.util.containers.FilteringIterator) SharedLibraryEntry(com.intellij.lang.javascript.flex.projectStructure.model.SharedLibraryEntry) LibraryEx(com.intellij.openapi.roots.impl.libraries.LibraryEx) LibraryOrderEntry(com.intellij.openapi.roots.LibraryOrderEntry) Library(com.intellij.openapi.roots.libraries.Library)

Aggregations

SharedLibraryEntry (com.intellij.lang.javascript.flex.projectStructure.model.SharedLibraryEntry)1 LibraryOrderEntry (com.intellij.openapi.roots.LibraryOrderEntry)1 LibraryEx (com.intellij.openapi.roots.impl.libraries.LibraryEx)1 Library (com.intellij.openapi.roots.libraries.Library)1 FilteringIterator (com.intellij.util.containers.FilteringIterator)1