mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[plugin tests] simplification: clear errors in PluginSetTestBuilder instead of doing it in individual tests
(cherry picked from commit b2c50cb2a03136e960b1184c1ed26657f207c162) IJ-CR-166252 GitOrigin-RevId: c027ac65c5d079f6bdde0a9dc1d785e3bce36899
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4aa0af0eac
commit
0f5ea36f4e
@@ -1050,8 +1050,6 @@ class DynamicPluginsTest {
|
|||||||
@Test
|
@Test
|
||||||
@TestFor(issues = ["IJPL-183884"])
|
@TestFor(issues = ["IJPL-183884"])
|
||||||
fun `initial loading errors are cleared after successful dynamic plugin loading`() {
|
fun `initial loading errors are cleared after successful dynamic plugin loading`() {
|
||||||
PluginManagerCore.getAndClearPluginLoadingErrors() // clear errors which may be registered by other tests
|
|
||||||
|
|
||||||
val barPluginPath = pluginsDir.resolve("bar")
|
val barPluginPath = pluginsDir.resolve("bar")
|
||||||
val fooPluginPath = pluginsDir.resolve("foo")
|
val fooPluginPath = pluginsDir.resolve("foo")
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,6 @@ internal class PluginDependenciesTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `plugin is not loaded if required module is not available`() {
|
fun `plugin is not loaded if required module is not available`() {
|
||||||
PluginManagerCore.getAndClearPluginLoadingErrors() //clear errors which may be registered by other tests
|
|
||||||
plugin("sample.plugin") {
|
plugin("sample.plugin") {
|
||||||
content {
|
content {
|
||||||
module("required.module", ModuleLoadingRule.REQUIRED) {
|
module("required.module", ModuleLoadingRule.REQUIRED) {
|
||||||
@@ -207,7 +206,6 @@ internal class PluginDependenciesTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `required content module with unresolved dependency in the core plugin`() {
|
fun `required content module with unresolved dependency in the core plugin`() {
|
||||||
PluginManagerCore.getAndClearPluginLoadingErrors() //clear errors which may be registered by other tests
|
|
||||||
val corePluginDir = pluginDirPath.resolve("core")
|
val corePluginDir = pluginDirPath.resolve("core")
|
||||||
plugin(PluginManagerCore.CORE_PLUGIN_ID) {
|
plugin(PluginManagerCore.CORE_PLUGIN_ID) {
|
||||||
content {
|
content {
|
||||||
|
|||||||
@@ -217,7 +217,6 @@ class PluginSetLoadingTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `package prefix collision prevents plugin from loading`() {
|
fun `package prefix collision prevents plugin from loading`() {
|
||||||
PluginManagerCore.getAndClearPluginLoadingErrors()
|
|
||||||
// FIXME these plugins are not related, but one of them loads => depends on implicit order
|
// FIXME these plugins are not related, but one of them loads => depends on implicit order
|
||||||
plugin("foo") {
|
plugin("foo") {
|
||||||
content {
|
content {
|
||||||
@@ -255,7 +254,6 @@ class PluginSetLoadingTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `package prefix collision prevents plugin from loading - same plugin`() {
|
fun `package prefix collision prevents plugin from loading - same plugin`() {
|
||||||
PluginManagerCore.getAndClearPluginLoadingErrors()
|
|
||||||
plugin("foo") {
|
plugin("foo") {
|
||||||
packagePrefix = "common.module"
|
packagePrefix = "common.module"
|
||||||
content {
|
content {
|
||||||
@@ -271,7 +269,6 @@ class PluginSetLoadingTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `package prefix collision does not prevent plugin from loading if module is optional`() {
|
fun `package prefix collision does not prevent plugin from loading if module is optional`() {
|
||||||
PluginManagerCore.getAndClearPluginLoadingErrors()
|
|
||||||
plugin("foo") {
|
plugin("foo") {
|
||||||
content {
|
content {
|
||||||
module("foo.module", loadingRule = ModuleLoadingRule.OPTIONAL) { packagePrefix = "common.module" }
|
module("foo.module", loadingRule = ModuleLoadingRule.OPTIONAL) { packagePrefix = "common.module" }
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ jvm_library(
|
|||||||
deps = [
|
deps = [
|
||||||
"@lib//:kotlin-stdlib",
|
"@lib//:kotlin-stdlib",
|
||||||
"@lib//:jetbrains-annotations",
|
"@lib//:jetbrains-annotations",
|
||||||
|
"//platform/util",
|
||||||
"//platform/core-api:core",
|
"//platform/core-api:core",
|
||||||
"//platform/core-impl",
|
"//platform/core-impl",
|
||||||
"//platform/util-class-loader:util-classLoader",
|
"//platform/util-class-loader:util-classLoader",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="kotlin-stdlib" level="project" />
|
<orderEntry type="library" name="kotlin-stdlib" level="project" />
|
||||||
<orderEntry type="library" name="jetbrains-annotations" level="project" />
|
<orderEntry type="library" name="jetbrains-annotations" level="project" />
|
||||||
|
<orderEntry type="module" module-name="intellij.platform.util" />
|
||||||
<orderEntry type="module" module-name="intellij.platform.core" />
|
<orderEntry type="module" module-name="intellij.platform.core" />
|
||||||
<orderEntry type="module" module-name="intellij.platform.core.impl" />
|
<orderEntry type="module" module-name="intellij.platform.core.impl" />
|
||||||
<orderEntry type="module" module-name="intellij.platform.util.classLoader" />
|
<orderEntry type="module" module-name="intellij.platform.util.classLoader" />
|
||||||
|
|||||||
@@ -101,6 +101,9 @@ class PluginSetTestBuilder private constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun build(): PluginSet {
|
fun build(): PluginSet {
|
||||||
|
//clear errors, which may be registered by other tests
|
||||||
|
PluginManagerCore.getAndClearPluginLoadingErrors()
|
||||||
|
|
||||||
val initContext = buildInitContext()
|
val initContext = buildInitContext()
|
||||||
val (loadingContext, loadingResult) = buildLoadingResult(initContext)
|
val (loadingContext, loadingResult) = buildLoadingResult(initContext)
|
||||||
return PluginManagerCore.initializePlugins(
|
return PluginManagerCore.initializePlugins(
|
||||||
|
|||||||
Reference in New Issue
Block a user