IDEA-313962: add test for property interpolation

GitOrigin-RevId: 1ce80096532b8d5ff0f9ef424622bd4cf0f958a9
This commit is contained in:
Dmitry Kichinsky
2023-03-01 17:10:15 +00:00
committed by intellij-monorepo-bot
parent 5397ce744e
commit 39adb3ef2c
@@ -866,17 +866,48 @@ public class MavenProjectsTreeReadingTest extends MavenProjectsTreeTestCase {
assertEquals("child", myTree.findProject(child).getMavenId().getArtifactId());
}
@Test
@Test
public void testParentPropertyInterpolation() {
createProjectPom("""
<groupId>test</groupId>
<artifactId>parent</artifactId>
<version>1</version>
<packaging>pom</packaging>
<properties>
<childName>child</childName>
</properties>
""");
update(myProjectPom);
VirtualFile child = createModulePom("child",
"""
<groupId>test</groupId>
<artifactId>${childName}</artifactId>
<version>1</version>
<parent>
<groupId>test</groupId>
<artifactId>parent</artifactId>
<version>1</version>
</parent>
""");
update(child);
assertEquals("child", myTree.findProject(child).getMavenId().getArtifactId());
}
@Test
public void testAddingInheritanceChildOnParentUpdate() {
createProjectPom("""
<groupId>test</groupId>
<artifactId>parent</artifactId>
<version>1</version>
<packaging>pom</packaging>
<properties>
<childName>child</childName>
</properties>
<modules>
<module>child</module>
<module>child</module>
</modules>
""");