Search in sources :

Example 1 with GoModuleLibrariesInitializer

use of com.goide.project.GoModuleLibrariesInitializer in project go-lang-idea-plugin by go-lang-plugin-org.

the class GoPathLibraryTest method assertLibrary.

private void assertLibrary(@NotNull Collection<String> libUrls, String... exclusionUrls) {
    UIUtil.dispatchAllInvocationEvents();
    GoModuleLibrariesInitializer initializer = myModule.getComponent(GoModuleLibrariesInitializer.class);
    ModuleRootManager model = ModuleRootManager.getInstance(myModule);
    LibraryOrderEntry libraryOrderEntry = OrderEntryUtil.findLibraryOrderEntry(model, initializer.getLibraryName());
    if (libUrls.isEmpty()) {
        assertNull(libraryOrderEntry);
        return;
    }
    LibraryEx library = (LibraryEx) libraryOrderEntry.getLibrary();
    assertNotNull(library);
    assertSameElements(Arrays.asList(library.getUrls(OrderRootType.CLASSES)), libUrls);
    assertSameElements(library.getExcludedRootUrls(), exclusionUrls);
}
Also used : GoModuleLibrariesInitializer(com.goide.project.GoModuleLibrariesInitializer) LibraryEx(com.intellij.openapi.roots.impl.libraries.LibraryEx)

Aggregations

GoModuleLibrariesInitializer (com.goide.project.GoModuleLibrariesInitializer)1 LibraryEx (com.intellij.openapi.roots.impl.libraries.LibraryEx)1