Commit 4d459d61 authored by Philipp Auersperg's avatar Philipp Auersperg

switch to jsonrpc 0.10,2

parent 2f16617b
......@@ -31,10 +31,10 @@ dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
// YAJ
compile("info.laht:yaj-rpc:0.8")
compile("info.laht:yaj-rpc-tcp:0.8")
implementation("info.laht:yaj-rpc:0.8")
implementation("info.laht:yaj-rpc-tcp:0.8")
compile("info.laht:yaj-rpc:0.10.2")
compile("info.laht:yaj-rpc-tcp:0.10.2")
implementation("info.laht:yaj-rpc:0.10.2")
implementation("info.laht:yaj-rpc-tcp:0.10.2")
testCompile("com.natpryce:hamkrest:1.6.0.0")
implementation ("org.slf4j:slf4j-api:$slf4j_version")
runtimeOnly("org.slf4j:slf4j-log4j12:$slf4j_version")
......
......@@ -36,35 +36,35 @@ class AppTest {
@Test fun checkClient() {
println("TEST:starting client")
val ww: RpcResponse
ww = client.write("SimpleService.echo", RpcListParams("Clint Eastwood"))
ww.also{
val ww = client.write("SimpleService.echo", RpcListParams("Clint Eastwood"))
ww.get().also{
println("res: $it")
}
val res=ww.getResult(String::class.java)
val res=ww.get().getResult(String::class.java)
println("res2:${res}")
client.write("SimpleService.add", RpcListParams(1,2)).also {
client.write("SimpleService.add", RpcListParams(1,2)).get().also {
val res=it.getResult(Int::class.java)
println("add: $res")
}
client.write("SimpleService.point", RpcListParams(1.0,2.0,3.0)).also{
client.write("SimpleService.point", RpcListParams(1.0,2.0,3.0)).get().also{
val res=it.getResult(Point::class.java)
println("point:$res")
}
//
}
// @Test fun testpoint() {
// println("========================================================testpoint $server")
// server
// client.write("SimpleService.point", RpcListParams(1.0,2.0,3.0)).also{
// val res=it.getResult(Point::class.java)
// println("point1:$res")
// }
//
// }
@Test fun testpoint_sync() {
println("========================================================testpoint $server")
server
client.write("SimpleService.point", RpcListParams(11.0,12.0,13.0), 100000)
//// client.write("SimpleService.point", RpcListParams(11.0,12.0,13.0))
.get().also{
val res=it.getResult(Point::class.java)
println("point1:$res")
}
}
@Test fun whatsoever() {
assert.that("xyzzy", startsWith("xy") and endsWith("y"))
......@@ -72,10 +72,13 @@ class AppTest {
// System.setProperty(, "Info");
}
fun tearDown() {
server.close()
client.close()
}
private companion object {
private val LOG: Logger = LoggerFactory.getLogger("XXX")
}
}
class OtherTest
\ No newline at end of file
......@@ -111,6 +111,93 @@
"gson.fromJson(json, Point::class.java)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"@file:DependsOnMaven(\"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1\")"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"import kotlinx.coroutines.*"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"error: modifier 'suspend' is not applicable to 'local function'\n",
"suspend fun schas() {\n",
"^\n"
]
}
],
"source": [
"suspend fun schas() {\n",
" Thread.sleep(1000)\n",
" println(\"schas\")\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"error: unresolved reference. None of the following candidates is applicable because of receiver type mismatch: \n",
"public fun <T> CoroutineScope.async(context: CoroutineContext = ..., start: CoroutineStart = ..., block: [ERROR : Bad suspend function in metadata with constructor: Function2]<CoroutineScope, Continuation<T>, Any?>): Deferred<???> defined in kotlinx.coroutines\n",
"async{schas()}\n",
"^\n"
]
}
],
"source": [
"async{schas()}"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Line_21@1c441c0c"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"this"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment