mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-391550: maven: add real tests for maven compat into aggregator
(cherry picked from commit e039ec22eafbffa277a650e3f9a3279ab7ceedf4) IJ-CR-214363 GitOrigin-RevId: 5b419d0e5222c1c86cb5615c7826e217a558a878
This commit is contained in:
committed by
intellij-monorepo-bot
parent
377054509f
commit
ac1d7effc9
+16
-3
@@ -22,6 +22,7 @@ import com.intellij.pom.java.LanguageLevel
|
||||
import com.intellij.testFramework.junit5.TestApplication
|
||||
import com.intellij.util.text.VersionComparatorUtil
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.jetbrains.idea.maven.model.MavenConstants
|
||||
import org.jetbrains.idea.maven.model.MavenProjectProblem
|
||||
import org.jetbrains.idea.maven.server.MavenServerManager
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
@@ -50,15 +51,27 @@ private val MAVEN_VERSIONS = listOf(
|
||||
|
||||
internal class MavenCompatibilityVersions : ArgumentsProvider {
|
||||
override fun provideArguments(parameters: ParameterDeclarations?, context: ExtensionContext?): Stream<out Arguments?> {
|
||||
return MAVEN_VERSIONS.map { Arguments.of(it) }.stream()
|
||||
return MAVEN_VERSIONS.flatMap { version ->
|
||||
if (version.startsWith("4.")) {
|
||||
listOf(
|
||||
Arguments.of(version, MavenConstants.MODEL_VERSION_4_0_0),
|
||||
Arguments.of(version, MavenConstants.MODEL_VERSION_4_1_0)
|
||||
)
|
||||
}
|
||||
else {
|
||||
listOf(
|
||||
Arguments.of(version, MavenConstants.MODEL_VERSION_4_0_0)
|
||||
)
|
||||
}
|
||||
}.stream()
|
||||
}
|
||||
}
|
||||
|
||||
@TestApplication
|
||||
@ParameterizedClass
|
||||
@ArgumentsSource(MavenCompatibilityVersions::class)
|
||||
class MavenCompatibilityProjectImportingTest(private val myMavenVersion: String) {
|
||||
private val maven by mavenImportingFixture(mavenVersion = myMavenVersion, skipPluginResolution = false)
|
||||
class MavenCompatibilityProjectImportingTest(private val myMavenVersion: String, private val myModelVersion: String) {
|
||||
private val maven by mavenImportingFixture(mavenVersion = myMavenVersion, modelVersion = myModelVersion, skipPluginResolution = false)
|
||||
|
||||
@BeforeEach
|
||||
fun before() {
|
||||
|
||||
+2
@@ -7,6 +7,7 @@ import com.intellij.maven.testFramework.fixtures.importProjectAsync
|
||||
import com.intellij.maven.testFramework.fixtures.mavenImportingFixture
|
||||
import com.intellij.testFramework.junit5.TestApplication
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.jetbrains.idea.maven.compatibility.MavenCompatibilityVersions
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.params.ParameterizedClass
|
||||
import org.junit.jupiter.params.provider.ArgumentsSource
|
||||
@@ -14,6 +15,7 @@ import org.junit.jupiter.params.provider.ArgumentsSource
|
||||
@TestApplication
|
||||
@ParameterizedClass
|
||||
@ArgumentsSource(MavenVersionArguments::class)
|
||||
@ArgumentsSource(MavenCompatibilityVersions::class)
|
||||
class RealProjectsImportingTest(mavenVersion: String, modelVersion: String) {
|
||||
|
||||
private val maven by mavenImportingFixture(
|
||||
|
||||
Reference in New Issue
Block a user