mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
utility method TestModeFlags.runWithFlag, reset flags at the test end
GitOrigin-RevId: 0614d45dd075aa9f0edb7d436df4bfd42074ddba
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4d298d267e
commit
8fd9522f2d
+1
-8
@@ -304,14 +304,7 @@ abstract class CommonJavaTargetTestBase(protected val executionMode: ExecutionMo
|
||||
}
|
||||
|
||||
private fun runWithConnectInUnitTestMode(block: () -> Unit) {
|
||||
val connectInUnitTestModeValue = TestModeFlags.get(SearchForTestsTask.CONNECT_IN_UNIT_TEST_MODE_PROPERTY_KEY)
|
||||
TestModeFlags.set(SearchForTestsTask.CONNECT_IN_UNIT_TEST_MODE_PROPERTY_KEY, true)
|
||||
try {
|
||||
block()
|
||||
}
|
||||
finally {
|
||||
TestModeFlags.set(SearchForTestsTask.CONNECT_IN_UNIT_TEST_MODE_PROPERTY_KEY, connectInUnitTestModeValue)
|
||||
}
|
||||
TestModeFlags.runWithFlag(SearchForTestsTask.CONNECT_IN_UNIT_TEST_MODE_PROPERTY_KEY, true, block)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user