diff --git a/cli/src/test/java/de/jplag/cli/LanguageTest.java b/cli/src/test/java/de/jplag/cli/LanguageTest.java index e2e860c4f..055c486af 100644 --- a/cli/src/test/java/de/jplag/cli/LanguageTest.java +++ b/cli/src/test/java/de/jplag/cli/LanguageTest.java @@ -18,9 +18,11 @@ import de.jplag.cli.test.CliArgument; import de.jplag.cli.test.CliTest; import de.jplag.exceptions.ExitException; +import de.jplag.multilang.MultiLanguage; import de.jplag.options.JPlagOptions; class LanguageTest extends CliTest { + private static final List> ignoredLanguages = List.of(MultiLanguage.class); @Test void testDefaultLanguage() throws ExitException, IOException { @@ -58,6 +60,7 @@ void testCustomSuffixes() throws ExitException, IOException { } public static Collection getAllLanguages() { - return LanguageLoader.getAllAvailableLanguages().values(); + return LanguageLoader.getAllAvailableLanguages().values().stream().filter(language -> !ignoredLanguages.contains(language.getClass())) + .toList(); } } diff --git a/language-api/src/main/java/de/jplag/options/DefaultLanguageOption.java b/language-api/src/main/java/de/jplag/options/DefaultLanguageOption.java index 3be2a255d..892628cba 100644 --- a/language-api/src/main/java/de/jplag/options/DefaultLanguageOption.java +++ b/language-api/src/main/java/de/jplag/options/DefaultLanguageOption.java @@ -20,7 +20,7 @@ public class DefaultLanguageOption implements LanguageOption { this.hasValue = true; } - DefaultLanguageOption(OptionType type, String description, String name) { + DefaultLanguageOption(OptionType type, String name, String description) { this(type, name, description, null); this.hasValue = false; } diff --git a/language-api/src/main/java/de/jplag/options/LanguageOptions.java b/language-api/src/main/java/de/jplag/options/LanguageOptions.java index b8167bd26..8f0bf2a7e 100644 --- a/language-api/src/main/java/de/jplag/options/LanguageOptions.java +++ b/language-api/src/main/java/de/jplag/options/LanguageOptions.java @@ -56,7 +56,7 @@ protected LanguageOption createDefaultOption(OptionType type, String n * @return The new option */ protected LanguageOption createOption(OptionType type, String name, String description) { - LanguageOption option = new DefaultLanguageOption<>(type, description, name); + LanguageOption option = new DefaultLanguageOption<>(type, name, description); this.options.add(option); return option; } diff --git a/languages/multi-language/src/main/java/de/jplag/multilang/MultiLanguageOptions.java b/languages/multi-language/src/main/java/de/jplag/multilang/MultiLanguageOptions.java index c94bf0406..9d4c0a230 100644 --- a/languages/multi-language/src/main/java/de/jplag/multilang/MultiLanguageOptions.java +++ b/languages/multi-language/src/main/java/de/jplag/multilang/MultiLanguageOptions.java @@ -12,9 +12,9 @@ public class MultiLanguageOptions extends LanguageOptions { private static final String ERROR_LANGUAGE_NOT_FOUND = "The selected language %s could not be found"; private static final String ERROR_NOT_ENOUGH_LANGUAGES = "To use multi language specify at least 1 language"; + private static final String OPTION_DESCRIPTION_LANGUAGES = "The languages that should be used. This is a ',' separated list"; - public LanguageOption languageNames = createOption(OptionType.string(), "languages", - "The languages that should be used. This is a ',' separated list"); + public LanguageOption languageNames = createOption(OptionType.string(), "languages", OPTION_DESCRIPTION_LANGUAGES); private List languages = null; public List getLanguages() {