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

- more tests

GitOrigin-RevId: 5b0b65e0b74bb858dab0a0ceeb5f176b0e3f0fdc
This commit is contained in:
Mikhail Pyltsin
2025-03-01 10:12:48 +00:00
committed by intellij-monorepo-bot
parent bf91092644
commit dc12ba0d28
2 changed files with 23 additions and 0 deletions
@@ -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>
@@ -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();