mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
ExternalSystemRunConfigurationJavaExtensionTest: restore test dialog
GitOrigin-RevId: c15ddcb6a0ee1e5c0c12a18c52f06b30146c919a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ecb8fba035
commit
b77aad8faa
@@ -36,18 +36,23 @@ class ExternalSystemRunConfigurationJavaExtensionTest : ExecutionTestCase() {
|
||||
ExtensionTestUtil.maskExtensions(RunConfigurationExtension.EP_NAME, listOf(CantUpdateJavaParametersExtension()), testRootDisposable)
|
||||
val configuration = createExternalSystemRunConfiguration()
|
||||
val notificationsCollector = NotificationsCollector()
|
||||
Messages.setTestDialog(notificationsCollector)
|
||||
LoggedErrorProcessor.setNewInstance(object : LoggedErrorProcessor() {
|
||||
override fun processError(message: String?, t: Throwable?, details: Array<out String>?, logger: Logger) {
|
||||
// don't fail this if `LOG.error()` was called for our exception somewhere
|
||||
if (t is FakeExecutionException) return
|
||||
super.processError(message, t, details, logger)
|
||||
val oldTestDialog = Messages.setTestDialog(notificationsCollector)
|
||||
try {
|
||||
LoggedErrorProcessor.setNewInstance(object : LoggedErrorProcessor() {
|
||||
override fun processError(message: String?, t: Throwable?, details: Array<out String>?, logger: Logger) {
|
||||
// don't fail this if `LOG.error()` was called for our exception somewhere
|
||||
if (t is FakeExecutionException) return
|
||||
super.processError(message, t, details, logger)
|
||||
}
|
||||
})
|
||||
runInEdtAndWait {
|
||||
ExecutionEnvironmentBuilder.create(DefaultRunExecutor.getRunExecutorInstance(), configuration).buildAndExecute()
|
||||
}
|
||||
})
|
||||
runInEdtAndWait {
|
||||
ExecutionEnvironmentBuilder.create(DefaultRunExecutor.getRunExecutorInstance(), configuration).buildAndExecute()
|
||||
assertThat(assertOneElement(notificationsCollector.notifications), containsString(FakeExecutionException.MESSAGE))
|
||||
}
|
||||
finally {
|
||||
Messages.setTestDialog(oldTestDialog)
|
||||
}
|
||||
assertThat(assertOneElement(notificationsCollector.notifications), containsString(FakeExecutionException.MESSAGE))
|
||||
}
|
||||
|
||||
fun `test only applicable configuration extensions should be processed`() {
|
||||
|
||||
Reference in New Issue
Block a user