From dc12ba0d284950518db5c127a9a3bd617da3e395 Mon Sep 17 00:00:00 2001 From: Mikhail Pyltsin Date: Sat, 1 Mar 2025 09:32:53 +0100 Subject: [PATCH] [java-imports] IDEA-368382 incorrect place for module import - more tests GitOrigin-RevId: 5b0b65e0b74bb858dab0a0ceeb5f176b0e3f0fdc --- java/java-tests/testData/codeStyle/onlyModules.xml | 11 +++++++++++ .../psi/codeStyle/JavaCodeStyleSettingsTest.java | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 java/java-tests/testData/codeStyle/onlyModules.xml diff --git a/java/java-tests/testData/codeStyle/onlyModules.xml b/java/java-tests/testData/codeStyle/onlyModules.xml new file mode 100644 index 000000000000..3512f4b25d87 --- /dev/null +++ b/java/java-tests/testData/codeStyle/onlyModules.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/JavaCodeStyleSettingsTest.java b/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/JavaCodeStyleSettingsTest.java index 43d2f2429fba..5ddd141e4601 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/JavaCodeStyleSettingsTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/codeStyle/JavaCodeStyleSettingsTest.java @@ -207,6 +207,18 @@ public class JavaCodeStyleSettingsTest extends CodeStyleTestCase { assertEquals(PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY, table.getEntryAt(7)); } + public void testOnlyModules() throws SchemeImportException { + CodeStyleSettings settings = importSettings(); + + JavaCodeStyleSettings customSettings = settings.getCustomSettings(JavaCodeStyleSettings.class); + + PackageEntryTable table = customSettings.IMPORT_LAYOUT_TABLE; + assertSize(3, table.getEntries()); + assertEquals(PackageEntry.ALL_MODULE_IMPORTS, table.getEntryAt(0)); + assertEquals(PackageEntry.ALL_OTHER_IMPORTS_ENTRY, table.getEntryAt(1)); + assertEquals(PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY, table.getEntryAt(2)); + } + public void testWithoutOtherImportWithModule() throws SchemeImportException { CodeStyleSettings settings = importSettings();