From edeb1cc677aebe63fcd56d9bdcd600f82002b583 Mon Sep 17 00:00:00 2001 From: Dmitry Kichinsky Date: Thu, 8 Aug 2024 11:58:14 +0200 Subject: [PATCH] [maven] IDEA-356780 test updating transitive dependency version in dependencyManagement GitOrigin-RevId: a9c4c6ce4adf12b31a914d9b377643cbeba5ed70 --- .../importing/DependenciesImportingTest.kt | 61 +++++++++++++++++-- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/DependenciesImportingTest.kt b/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/DependenciesImportingTest.kt index 0a16455aa34f..dfa701c0ed45 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/DependenciesImportingTest.kt +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/DependenciesImportingTest.kt @@ -43,9 +43,9 @@ class DependenciesImportingTest : MavenMultiVersionImportingTestCase() { assertModules("project") assertModuleLibDep("project", "Maven: junit:junit:4.0", - "jar://" + repositoryPath + "/junit/junit/4.0/junit-4.0.jar!/", - "jar://" + repositoryPath + "/junit/junit/4.0/junit-4.0-sources.jar!/", - "jar://" + repositoryPath + "/junit/junit/4.0/junit-4.0-javadoc.jar!/") + "jar://$repositoryPath/junit/junit/4.0/junit-4.0.jar!/", + "jar://$repositoryPath/junit/junit/4.0/junit-4.0-sources.jar!/", + "jar://$repositoryPath/junit/junit/4.0/junit-4.0-javadoc.jar!/") assertProjectLibraryCoordinates("Maven: junit:junit:4.0", "junit", "junit", "4.0") } @@ -978,6 +978,59 @@ class DependenciesImportingTest : MavenMultiVersionImportingTestCase() { assertModuleLibDep("project", "Maven: xml-apis:xml-apis:1.0.b2") } + @Test + fun testIncrementalSyncTransitiveLibraryDependencyManagement() = runBlocking { + importProjectAsync(""" + test + project + 1 + + + + asm + asm + 3.3.0 + + + + + + asm + asm-attrs + 2.2.1 + + + """.trimIndent()) + + assertModules("project") + assertModuleLibDeps("project", "Maven: asm:asm-attrs:2.2.1", "Maven: asm:asm:3.3.0") + + updateProjectPom(""" + test + project + 1 + + + + asm + asm + 3.3.1 + + + + + + asm + asm-attrs + 2.2.1 + + + """.trimIndent()) + updateAllProjects() + + assertModuleLibDeps("project", "Maven: asm:asm-attrs:2.2.1", "Maven: asm:asm:3.3.1") + } + @Test fun testExclusionOfTransitiveDependencies() = runBlocking { createProjectPom(""" @@ -1469,7 +1522,7 @@ class DependenciesImportingTest : MavenMultiVersionImportingTestCase() { assertProjectLibraries("Maven: junit:junit:4.0") assertModuleLibDeps("project", "Maven: junit:junit:4.0") - importProjectAsync() + updateAllProjects() assertProjectLibraries("Maven: junit:junit:4.0") assertModuleLibDeps("project", "Maven: junit:junit:4.0")