Code cleanup
This commit is contained in:
parent
661c978b07
commit
e995dbdef5
|
@ -52,7 +52,6 @@ class RmiTest : BaseTest() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
suspend fun runTests(connection: Connection, test: TestCow, remoteObjectID: Int) {
|
suspend fun runTests(connection: Connection, test: TestCow, remoteObjectID: Int) {
|
||||||
var caught = false
|
|
||||||
val remoteObject = test as RemoteObject
|
val remoteObject = test as RemoteObject
|
||||||
|
|
||||||
// Default behavior. RMI is transparent, method calls behave like normal
|
// Default behavior. RMI is transparent, method calls behave like normal
|
||||||
|
@ -82,23 +81,18 @@ class RmiTest : BaseTest() {
|
||||||
// Try exception handling
|
// Try exception handling
|
||||||
try {
|
try {
|
||||||
test.throwException()
|
test.throwException()
|
||||||
|
Assert.fail("sync should be throwing an exception!")
|
||||||
} catch (e: UnsupportedOperationException) {
|
} catch (e: UnsupportedOperationException) {
|
||||||
connection.logger.error("Expected exception (exception log should also be on the object impl side).", e)
|
connection.logger.error("Expected exception (exception log should also be on the object impl side).", e)
|
||||||
caught = true
|
|
||||||
}
|
}
|
||||||
Assert.assertTrue(caught)
|
|
||||||
caught = false
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
test.throwSuspendException()
|
test.throwSuspendException()
|
||||||
|
Assert.fail("sync should be throwing an exception!")
|
||||||
} catch (e: UnsupportedOperationException) {
|
} catch (e: UnsupportedOperationException) {
|
||||||
connection.logger.error("\tExpected exception (exception log should also be on the object impl side).", e)
|
connection.logger.error("\tExpected exception (exception log should also be on the object impl side).", e)
|
||||||
caught = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.assertTrue(caught)
|
|
||||||
caught = false
|
|
||||||
|
|
||||||
// Non-blocking call tests
|
// Non-blocking call tests
|
||||||
// Non-blocking call tests
|
// Non-blocking call tests
|
||||||
// Non-blocking call tests
|
// Non-blocking call tests
|
||||||
|
@ -119,23 +113,18 @@ class RmiTest : BaseTest() {
|
||||||
try {
|
try {
|
||||||
test.throwException()
|
test.throwException()
|
||||||
} catch (e: IllegalStateException) {
|
} catch (e: IllegalStateException) {
|
||||||
connection.logger.error("\tExpected exception (exception log should also be on the object impl side).")
|
|
||||||
e.printStackTrace()
|
|
||||||
caught = true
|
|
||||||
}
|
|
||||||
// exceptions are not caught when async = true!
|
// exceptions are not caught when async = true!
|
||||||
Assert.assertFalse(caught)
|
Assert.fail("Async should not be throwing an exception!")
|
||||||
caught = false
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
test.throwSuspendException()
|
test.throwSuspendException()
|
||||||
} catch (e: IllegalStateException) {
|
} catch (e: IllegalStateException) {
|
||||||
connection.logger.error("\tExpected exception (exception log should also be on the object impl side).")
|
|
||||||
e.printStackTrace()
|
|
||||||
caught = true
|
|
||||||
}
|
|
||||||
// exceptions are not caught when async = true!
|
// exceptions are not caught when async = true!
|
||||||
Assert.assertFalse(caught)
|
Assert.fail("Async should not be throwing an exception!")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Call will time out if non-blocking isn't working properly
|
// Call will time out if non-blocking isn't working properly
|
||||||
|
|
Loading…
Reference in New Issue
Block a user