@@ -13,14 +13,20 @@ import org.jetbrains.kotlin.config.KotlinCompilerVersion
13
13
import org.jetbrains.kotlin.scripting.compiler.plugin.runAndCheckResults
14
14
import org.jetbrains.kotlin.test.util.KtTestUtil
15
15
import org.jetbrains.kotlin.utils.PathUtil
16
+ import org.junit.jupiter.api.Assertions.assertEquals
17
+ import org.junit.jupiter.api.Assertions.assertNotNull
18
+ import org.junit.jupiter.api.Assertions.assertNull
19
+ import org.junit.jupiter.api.Assertions.assertSame
20
+ import org.junit.jupiter.api.Assertions.assertTrue
21
+ import org.junit.jupiter.api.Test
22
+ import org.junit.jupiter.api.fail
16
23
import java.io.File
17
24
import java.lang.management.ManagementFactory
18
25
import java.nio.file.Files.createTempDirectory
19
26
import java.nio.file.Files.createTempFile
20
27
import javax.script.*
21
28
import kotlin.script.experimental.jvmhost.jsr223.KotlinJsr223ScriptEngineImpl
22
29
import kotlin.script.templates.standard.ScriptTemplateWithBindings
23
- import kotlin.test.*
24
30
25
31
// duplicating it here to avoid dependency on the implementation - it may interfere with tests
26
32
private const val KOTLIN_JSR223_RESOLVE_FROM_CLASSLOADER_PROPERTY = " kotlin.jsr223.experimental.resolve.dependencies.from.context.classloader"
@@ -86,8 +92,7 @@ class KotlinJsr223ScriptEngineIT {
86
92
assertEquals(5 , res2)
87
93
}
88
94
89
- @Test
90
- @Ignore // Probably not possible to make it sensible on CI and with parallel run, so leaving it here for manual testing only
95
+ // @Test // Probably not possible to make it sensible on CI and with parallel run, so leaving it here for manual testing only
91
96
fun testMemory () {
92
97
val memoryMXBean = ManagementFactory .getMemoryMXBean()!!
93
98
var prevMem = memoryMXBean.getHeapMemoryUsage().getUsed()
189
194
""" )
190
195
assertNotNull(res0)
191
196
val invocator = engine as ? Invocable
192
- assertNotNull (invocator)
197
+ requireNotNull (invocator)
193
198
val res1 = invocator.invokeFunction(" fn" , 6 )
194
199
assertEquals(8 , res1)
195
200
assertThrows(NoSuchMethodException ::class .java) {
387
392
val result = scriptEngine.eval(script)
388
393
389
394
assertTrue(result is Function0 <* >)
390
- assertEquals(3 , result.invoke())
395
+ assertEquals(3 , ( result as Function0 < * >) .invoke())
391
396
}
392
397
393
398
@Test
0 commit comments