mirror of https://github.com/sbt/sbt.git
Add BSP `buildTarget/run` test
This commit is contained in:
parent
9f04358fce
commit
759392aaf0
|
|
@ -1,3 +1,5 @@
|
|||
package foo
|
||||
|
||||
object FooMain extends App
|
||||
object FooMain extends App {
|
||||
println("Hello World!")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,6 +99,27 @@ object BuildServerTest extends AbstractServerTest {
|
|||
})
|
||||
}
|
||||
|
||||
test("buildTarget/run") { _ =>
|
||||
val x = s"${svr.baseDirectory.getAbsoluteFile.toURI}#foo/Compile"
|
||||
svr.sendJsonRpc(
|
||||
s"""{ "jsonrpc": "2.0", "id": "17", "method": "buildTarget/run", "params": {
|
||||
| "target": { "uri": "$x" },
|
||||
| "dataKind": "scala-main-class",
|
||||
| "data": { "class": "foo.FooMain" }
|
||||
|} }""".stripMargin
|
||||
)
|
||||
assert(svr.waitForString(10.seconds) { s =>
|
||||
println(s)
|
||||
(s contains "build/logMessage") &&
|
||||
(s contains """"message":"Hello World!"""")
|
||||
})
|
||||
assert(svr.waitForString(10.seconds) { s =>
|
||||
println(s)
|
||||
(s contains """"id":"17"""") &&
|
||||
(s contains """"statusCode":1""")
|
||||
})
|
||||
}
|
||||
|
||||
def initializeRequest(): Unit = {
|
||||
svr.sendJsonRpc(
|
||||
"""{ "jsonrpc": "2.0", "id": "10", "method": "build/initialize",
|
||||
|
|
|
|||
Loading…
Reference in New Issue