diff --git a/idea/tests/com/intellij/debugger/streams/kotlin/LibraryManager.kt b/idea/tests/com/intellij/debugger/streams/kotlin/LibraryManager.kt new file mode 100644 index 00000000000..5a813705fdf --- /dev/null +++ b/idea/tests/com/intellij/debugger/streams/kotlin/LibraryManager.kt @@ -0,0 +1,10 @@ +package com.intellij.debugger.streams.kotlin + +import java.io.File + +/** + * @author Vitaliy.Bibaev + */ +object LibraryManager { + val LIBRARIES_DIRECTORY: String = File("lib").absolutePath +} \ No newline at end of file diff --git a/idea/tests/com/intellij/debugger/streams/kotlin/psi/java/PositiveStreamExTest.kt b/idea/tests/com/intellij/debugger/streams/kotlin/psi/java/PositiveStreamExTest.kt index 324fdbca1fd..ac308cf92ff 100644 --- a/idea/tests/com/intellij/debugger/streams/kotlin/psi/java/PositiveStreamExTest.kt +++ b/idea/tests/com/intellij/debugger/streams/kotlin/psi/java/PositiveStreamExTest.kt @@ -1,14 +1,34 @@ package com.intellij.debugger.streams.kotlin.psi.java import com.intellij.debugger.streams.kotlin.KotlinPsiChainBuilderTestCase +import com.intellij.debugger.streams.kotlin.LibraryManager import com.intellij.debugger.streams.kotlin.lib.StreamExLibrarySupportProvider import com.intellij.debugger.streams.wrapper.StreamChainBuilder +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess +import com.intellij.testFramework.LightPlatformTestCase +import com.intellij.testFramework.PsiTestUtil /** * @author Vitaliy.Bibaev */ class PositiveStreamExTest : KotlinPsiChainBuilderTestCase.Positive("streams/positive/streamex") { override val kotlinChainBuilder: StreamChainBuilder = StreamExLibrarySupportProvider().chainBuilder + override fun setUp() { + super.setUp() + ApplicationManager.getApplication().runWriteAction { + VfsRootAccess.allowRootAccess(LibraryManager.LIBRARIES_DIRECTORY) + PsiTestUtil.addLibrary(testRootDisposable, LightPlatformTestCase.getModule(), + "StreamEx", LibraryManager.LIBRARIES_DIRECTORY, "streamex-0.6.5.jar") + } + } + + override fun tearDown() { + super.tearDown() + ApplicationManager.getApplication().runWriteAction { + VfsRootAccess.disallowRootAccess(LibraryManager.LIBRARIES_DIRECTORY) + } + } fun testSimple() { doTest()