[guiForms jps] refactoring: extract tests from intellij.java.guiForms.jps to a separate module

'intellij.java.guiForms.jps' is added to dependencies of the build scripts modules (to allow compiling GUI forms in the build), and if tests are located in that module, test dependencies of 'intellij.java.guiForms.jps' are included in the classpath of all modules with tests for build scripts. Because of that, for example, 'intellij.idea.ultimate.build.test' had 'intellij.java.impl' in its classpath, so when a necessary dependency (on jaxb libraries) was removed from the build script modules, 'IdeaUltimateBuildTest' didn't find that because that dependency came to its classpath via 'intellij.java.impl' module, and we got a critical problem (see IDEA-358889).

Now tests of 'intellij.java.guiForms.jps' are extracted to a separate module, so their dependencies aren't included in tests for build scripts.

GitOrigin-RevId: be6e794c5a872e1bac05cdb78822616828205fcc
This commit is contained in:
Nikolay Chashnikov
2024-09-09 11:05:47 +02:00
committed by intellij-monorepo-bot
parent 5d0c98019d
commit bebfd609d5
16 changed files with 23 additions and 8 deletions

1
.idea/modules.xml generated
View File

@@ -438,6 +438,7 @@
<module fileurl="file://$PROJECT_DIR$/java/compiler/forms-compiler/intellij.java.guiForms.compiler.iml" filepath="$PROJECT_DIR$/java/compiler/forms-compiler/intellij.java.guiForms.compiler.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/ui-designer/intellij.java.guiForms.designer.iml" filepath="$PROJECT_DIR$/plugins/ui-designer/intellij.java.guiForms.designer.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/ui-designer/jps-plugin/intellij.java.guiForms.jps.iml" filepath="$PROJECT_DIR$/plugins/ui-designer/jps-plugin/intellij.java.guiForms.jps.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/ui-designer/jps-plugin/tests/intellij.java.guiForms.jps.tests.iml" filepath="$PROJECT_DIR$/plugins/ui-designer/jps-plugin/tests/intellij.java.guiForms.jps.tests.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/forms_rt/intellij.java.guiForms.rt.iml" filepath="$PROJECT_DIR$/platform/forms_rt/intellij.java.guiForms.rt.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/java-i18n/intellij.java.i18n.iml" filepath="$PROJECT_DIR$/plugins/java-i18n/intellij.java.i18n.iml" />
<module fileurl="file://$PROJECT_DIR$/java/ide-customization/intellij.java.ide.customization.iml" filepath="$PROJECT_DIR$/java/ide-customization/intellij.java.ide.customization.iml" />

View File

@@ -210,6 +210,7 @@
<orderEntry type="module" module-name="intellij.lombok" scope="TEST" />
<orderEntry type="module" module-name="intellij.xml.xmlbeans" scope="TEST" />
<orderEntry type="module" module-name="intellij.jsonpath" scope="TEST" />
<orderEntry type="module" module-name="intellij.java.guiForms.jps.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.ide.newUiOnboarding" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.platform.ide.newUsersOnboarding" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.kotlin.onboarding-promoter" scope="RUNTIME" />

View File

@@ -20,23 +20,18 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="intellij.platform.util" />
<orderEntry type="module" module-name="intellij.platform.jps.model" />
<orderEntry type="module" module-name="intellij.platform.jps.model.impl" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.jps.model.serialization" />
<orderEntry type="module" module-name="intellij.platform.jps.build" />
<orderEntry type="module" module-name="intellij.java.compiler.instrumentationUtil" />
<orderEntry type="module" module-name="intellij.java.guiForms.compiler" />
<orderEntry type="module" module-name="intellij.java.guiForms.rt" />
<orderEntry type="module" module-name="intellij.platform.jps.model.serialization.tests" scope="TEST" />
<orderEntry type="library" scope="TEST" name="Java Compatibility" level="project" />
<orderEntry type="library" name="ASM" level="project" />
<orderEntry type="module" module-name="intellij.platform.util.jdom" />
<orderEntry type="module" module-name="intellij.platform.jps.build.tests" scope="TEST" />
</component>
</module>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="intellij.platform.jps.build.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.jps.model" scope="TEST" />
<orderEntry type="module" module-name="intellij.java.guiForms.jps" scope="TEST" />
<orderEntry type="library" scope="TEST" name="ASM" level="project" />
<orderEntry type="module" module-name="intellij.java.guiForms.rt" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.testFramework" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.jps.model.serialization.tests" scope="TEST" />
</component>
</module>

View File

@@ -34,7 +34,7 @@ import java.io.File;
import java.io.IOException;
public class FormsBuilderTest extends JpsBuildTestCase {
private static final String SIMPLE_FORM_PATH = "plugins/ui-designer/jps-plugin/testData/build/simple";
private static final String SIMPLE_FORM_PATH = "plugins/ui-designer/jps-plugin/tests/testData/build/simple";
public void testSimple() {
JpsModule m = addModule("m", copyToProject(SIMPLE_FORM_PATH, "src"));
@@ -98,7 +98,7 @@ public class FormsBuilderTest extends JpsBuildTestCase {
}
public void testDoNotCopyRuntimeClassesIfOnlyAlienFormFilesExist() {
JpsModule module = addModule("m", copyToProject("plugins/ui-designer/jps-plugin/testData/build/alienFormFile", "src"));
JpsModule module = addModule("m", copyToProject("plugins/ui-designer/jps-plugin/tests/testData/build/alienFormFile", "src"));
buildAllModules().assertSuccessful();
assertFalse(isRuntimeClassesCopied(module));
}

View File

@@ -24,7 +24,7 @@ import static org.junit.jupiter.api.Assertions.*;
public class JpsUiDesignerConfigurationSerializationTest {
@Test
public void testLoad() {
JpsProjectData projectData = JpsProjectData.loadFromTestData("plugins/ui-designer/jps-plugin/testData/uiDesigner", getClass());
JpsProjectData projectData = JpsProjectData.loadFromTestData("plugins/ui-designer/jps-plugin/tests/testData/uiDesigner", getClass());
JpsProject project = projectData.getProject();
JpsUiDesignerConfiguration configuration = JpsUiDesignerExtensionService.getInstance().getUiDesignerConfiguration(project);
assertNotNull(configuration);