mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-578 wait for indexes to be ready in tests (maven)
GitOrigin-RevId: 0bc80c99fe633d479eb3db029b40d51c429c9a4a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ca852d2c96
commit
29b2f62087
+3
@@ -9,6 +9,7 @@ import com.intellij.openapi.vfs.LocalFileSystem
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettingsManager
|
||||
import com.intellij.psi.codeStyle.CommonCodeStyleSettings
|
||||
import com.intellij.psi.formatter.xml.XmlCodeStyleSettings
|
||||
import com.intellij.testFramework.IndexingTestUtil
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.withContext
|
||||
@@ -370,6 +371,8 @@ class MavenDependencyCompletionAndResolutionTest : MavenDomWithIndicesTestCase()
|
||||
|
||||
importProjectsWithErrors(projectPom, m1, m2)
|
||||
|
||||
IndexingTestUtil.waitUntilIndexesAreReady(project)
|
||||
|
||||
assertCompletionVariantsInclude(projectPom, RENDERING_TEXT, "m1", "m2")
|
||||
assertCompletionVariantsInclude(projectPom, LOOKUP_STRING, "project-group:m1:1", "project-group:m2:1")
|
||||
|
||||
|
||||
+7
-3
@@ -5,13 +5,17 @@ import com.intellij.internal.statistic.FUCollectorTestCase.collectProjectStateCo
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.maven.testFramework.MavenImportingTestCase
|
||||
import com.intellij.openapi.application.EDT
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.junit.Test
|
||||
|
||||
class MavenPluginCollectorTest : MavenImportingTestCase() {
|
||||
|
||||
override fun runInDispatchThread(): Boolean = false
|
||||
|
||||
@Test
|
||||
fun `test should collect info about plugins`() = runBlocking {
|
||||
fun `test should collect info about plugins`() = runBlocking(Dispatchers.EDT) {
|
||||
importProjectAsync("""
|
||||
<groupId>test</groupId>
|
||||
<artifactId>project</artifactId>
|
||||
@@ -41,7 +45,7 @@ class MavenPluginCollectorTest : MavenImportingTestCase() {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test should not collect info for private plugins`() = runBlocking {
|
||||
fun `test should not collect info for private plugins`() = runBlocking(Dispatchers.EDT) {
|
||||
importProjectAsync("""
|
||||
<groupId>test</groupId>
|
||||
<artifactId>project</artifactId>
|
||||
@@ -74,7 +78,7 @@ class MavenPluginCollectorTest : MavenImportingTestCase() {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test check whitelist plugin Rule`() = runBlocking {
|
||||
fun `test check whitelist plugin Rule`() = runBlocking(Dispatchers.EDT) {
|
||||
val rule = MavenPluginCoordinatesWhitelistValidationRule()
|
||||
assertEquals(ValidationResultType.ACCEPTED,
|
||||
rule.validate("org.apache.maven.plugins:maven-eclipse-plugin", EventContext.create("", emptyMap())))
|
||||
|
||||
+1
@@ -424,6 +424,7 @@ abstract class MavenImportingTestCase : MavenTestCase() {
|
||||
assertFalse("Failed to import Maven project: " + each.getProblems(), each.hasReadingProblems())
|
||||
}
|
||||
}
|
||||
IndexingTestUtil.waitUntilIndexesAreReady(project);
|
||||
}
|
||||
|
||||
protected suspend fun doImportProjectsAsync(files: List<VirtualFile>, failOnReadingError: Boolean, vararg profiles: String) {
|
||||
|
||||
Reference in New Issue
Block a user