Refactor JSR223 to support Compilable interface, drop daemon eval engine and sample, simplify
This commit is contained in:
+16
-4
@@ -38,14 +38,13 @@ import org.jetbrains.kotlin.utils.PathUtil
|
||||
import org.jetbrains.kotlin.utils.PathUtil.getResourcePathForClass
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.File
|
||||
import java.io.PrintStream
|
||||
import java.io.*
|
||||
import java.net.URI
|
||||
import java.util.jar.Manifest
|
||||
import kotlin.reflect.KClass
|
||||
import kotlin.test.*
|
||||
|
||||
|
||||
class ScriptUtilIT {
|
||||
|
||||
companion object {
|
||||
@@ -89,7 +88,14 @@ done
|
||||
|
||||
@Test
|
||||
fun testResolveStdJUnitHelloWorld() {
|
||||
Assert.assertNull(compileScript("args-junit-hello-world.kts", StandardArgsScriptTemplateWithLocalResolving::class))
|
||||
val savedErr = System.err
|
||||
try {
|
||||
System.setErr(PrintStream(NullOutputStream()))
|
||||
Assert.assertNull(compileScript("args-junit-hello-world.kts", StandardArgsScriptTemplateWithLocalResolving::class))
|
||||
}
|
||||
finally {
|
||||
System.setErr(savedErr)
|
||||
}
|
||||
|
||||
val scriptClass = compileScript("args-junit-hello-world.kts", StandardArgsScriptTemplateWithMavenResolving::class)
|
||||
if (scriptClass == null) {
|
||||
@@ -196,3 +202,9 @@ done
|
||||
return outStream.toString()
|
||||
}
|
||||
}
|
||||
|
||||
private class NullOutputStream : OutputStream() {
|
||||
override fun write(b: Int) { }
|
||||
override fun write(b: ByteArray) { }
|
||||
override fun write(b: ByteArray, off: Int, len: Int) { }
|
||||
}
|
||||
Reference in New Issue
Block a user