Added back RMI test for multi-jvm

This commit is contained in:
nathan 2020-09-11 03:30:27 +02:00
parent 495bf8931f
commit 77d114e525
2 changed files with 12 additions and 8 deletions

View File

@ -25,6 +25,7 @@ import ch.qos.logback.core.ConsoleAppender
import dorkbox.network.Client import dorkbox.network.Client
import dorkbox.network.connection.Connection import dorkbox.network.connection.Connection
import dorkboxTest.network.BaseTest import dorkboxTest.network.BaseTest
import dorkboxTest.network.rmi.RmiCommonTest
import dorkboxTest.network.rmi.cows.TestCow import dorkboxTest.network.rmi.cows.TestCow
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import org.junit.Assert import org.junit.Assert
@ -64,22 +65,25 @@ object TestClient {
fun main(args: Array<String>) { fun main(args: Array<String>) {
setup() setup()
val configuration = BaseTest.clientConfig() val config = BaseTest.clientConfig()
configuration.enableRemoteSignatureValidation = false config.enableRemoteSignatureValidation = false
config.enableIpc = false
config.aeronDirectoryForceUnique = true
val client = Client<Connection>(configuration)
val client = Client<Connection>(config)
client.onConnect { connection -> client.onConnect { connection ->
System.err.println("Starting test for: Client -> Server") System.err.println("Starting test for: Client -> Server")
connection.createObject<TestCow>(124123) { _, remoteObject -> connection.createObject<TestCow>(124123) { _, remoteObject ->
// RmiTest.runTests(connection, remoteObject, 124123) RmiCommonTest.runTests(connection, remoteObject, 124123)
// System.err.println("DONE") client.logger.error("DONE")
// now send this remote object ACROSS the wire to the server (on the server, this is where the IMPLEMENTATION lives) // now send this remote object ACROSS the wire to the server (on the server, this is where the IMPLEMENTATION lives)
connection.send(remoteObject) connection.send(remoteObject)
// client.close() client.close()
} }
} }

View File

@ -50,7 +50,7 @@ object TestServer {
val `object` = m.testCow val `object` = m.testCow
val id = `object`.id() val id = `object`.id()
Assert.assertEquals(124123, id.toLong()) Assert.assertEquals(124123, id.toLong())
System.err.println("Finished test for: Client -> Server") connection.logger.error("Finished test for: Client -> Server")
// //
// System.err.println("Starting test for: Server -> Client") // System.err.println("Starting test for: Server -> Client")
@ -62,7 +62,7 @@ object TestServer {
} }
server.onMessage<TestCow> { connection, test -> server.onMessage<TestCow> { connection, test ->
System.err.println("Received test cow from client") connection.logger.error("Received test cow from client")
// this object LIVES on the server. // this object LIVES on the server.
try { try {