[java-imports] IDEA-368382 incorrect place for module import

- more tests


(cherry picked from commit 5b0b65e0b74bb858dab0a0ceeb5f176b0e3f0fdc)

IJ-CR-156496

GitOrigin-RevId: 11f88eff3e5ac2934721b175fb94d34f91a5daed
This commit is contained in:
Mikhail Pyltsin
2025-03-01 09:32:53 +01:00
committed by intellij-monorepo-bot
parent 8830d6dde5
commit 314374a7c2
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<code_scheme name="Project" version="173">
<JavaCodeStyleSettings>
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="100" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="100" />
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="" withSubpackages="true" static="false" module="true" />
</value>
</option>
</JavaCodeStyleSettings>
</code_scheme>

View File

@@ -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();