e7a00993cee2c85cf838ce97d9edccdf2e88a5bd
[idea/community.git] / plugins / stream-debugger / test / com / intellij / debugger / streams / exec / streamex / StreamExTestCase.kt
1 // Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
2 package com.intellij.debugger.streams.exec.streamex
3
4 import com.intellij.debugger.streams.exec.LibraryTraceExecutionTestCase
5 import com.intellij.debugger.streams.lib.LibrarySupportProvider
6 import com.intellij.debugger.streams.lib.impl.StreamExLibrarySupportProvider
7
8 /**
9  * @author Vitaliy.Bibaev
10  */
11 abstract class StreamExTestCase : LibraryTraceExecutionTestCase("streamex-0.6.5.jar") {
12   private companion object {
13     const val STREAM_EX_REFLECTION_WARNING_MESSAGE =
14       "WARNING: An illegal reflective access operation has occurred\n" +
15       "WARNING: Illegal reflective access by one.util.streamex.StreamExInternals (file:!LIBRARY_JAR!) to field " +
16       "java.util.stream.AbstractPipeline.sourceSpliterator\n" +
17       "WARNING: Please consider reporting this to the maintainers of one.util.streamex.StreamExInternals\n" +
18       "WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations\n" +
19       "WARNING: All illegal access operations will be denied in a future release\n"
20   }
21
22   protected abstract val packageName: String
23
24   override fun getLibrarySupportProvider(): LibrarySupportProvider {
25     return StreamExLibrarySupportProvider()
26   }
27
28   override fun replaceAdditionalInOutput(str: String): String {
29     return super.replaceAdditionalInOutput(str)
30       .replace("file:/!LIBRARY_JAR!", "file:!LIBRARY_JAR!")
31       .replace(STREAM_EX_REFLECTION_WARNING_MESSAGE, "")
32   }
33
34   private val className: String
35     get() = packageName + "." + getTestName(false)
36
37   final override fun getTestAppRelativePath(): String = "streamex"
38
39   protected fun doStreamExVoidTest() = doTest(true, className)
40   protected fun doStreamExWithResultTest() = doTest(false, className)
41 }