ApkFacetConfiguration implements FacetConfiguration { @NotNull public List<NativeLibrary> getLibrariesWithoutDebugSymbols() { if (NATIVE_LIBRARIES.isEmpty()) { return Collections.emptyList(); } return NATIVE_LIBRARIES.stream().filter(library -> !library.hasDebugSymbols).collect(Collectors.toList()); }  @Override FacetEditorTab[] createEditorTabs(FacetEditorContext editorContext, FacetValidatorsManager validatorsManager); @NotNull Collection<String> getDebugSymbolFolderPaths(@NotNull List<Abi> abis); @NotNull Map<File, File> getExplicitModuleSymbolMap(@NotNull final Abi abi); @NotNull Map<String, String> getSymbolFolderPathMappings(); @Override void readExternal(@NotNull Element element); @Override void writeExternal(@NotNull Element element); @NotNull List<NativeLibrary> getLibrariesWithoutDebugSymbols(); void removeIssues(@NotNull String category); @NonNls public String APK_PATH; @NonNls public String APP_PACKAGE; @NotNull public List<SetupIssue> SETUP_ISSUES; @NotNull public List<NativeLibrary> NATIVE_LIBRARIES; @NotNull public Set<String> JAVA_SOURCE_FOLDER_PATHS; }
@Test public void getLibrariesWithoutDebugSymbolsWithEmptyLibraries() { List<NativeLibrary> libraries = myConfiguration.getLibrariesWithoutDebugSymbols(); assertThat(libraries).isEmpty(); }
@Test public void getLibrariesWithoutDebugSymbolsWithLibrariesMissingDebugSymbols() { NativeLibrary library1 = new NativeLibrary("x.c"); library1.hasDebugSymbols = true; NativeLibrary library2 = new NativeLibrary("x.h"); NativeLibrary library3 = new NativeLibrary("y.c"); myConfiguration.NATIVE_LIBRARIES.add(library1); myConfiguration.NATIVE_LIBRARIES.add(library2); myConfiguration.NATIVE_LIBRARIES.add(library3); List<NativeLibrary> libraries = myConfiguration.getLibrariesWithoutDebugSymbols(); assertThat(libraries).containsAllOf(library2, library3); }
@Test public void getLibrariesWithoutDebugSymbolsWithLibrariesHavingDebugSymbols() { NativeLibrary library1 = new NativeLibrary("x.c"); library1.hasDebugSymbols = true; NativeLibrary library2 = new NativeLibrary("x.h"); library2.hasDebugSymbols = true; NativeLibrary library3 = new NativeLibrary("y.c"); library3.hasDebugSymbols = true; myConfiguration.NATIVE_LIBRARIES.add(library1); myConfiguration.NATIVE_LIBRARIES.add(library2); myConfiguration.NATIVE_LIBRARIES.add(library3); List<NativeLibrary> libraries = myConfiguration.getLibrariesWithoutDebugSymbols(); assertThat(libraries).isEmpty(); }