From a5a951f8636136de829abd9dc68786625ffd11d6 Mon Sep 17 00:00:00 2001 From: Robinson Date: Thu, 29 Apr 2021 11:26:19 +0200 Subject: [PATCH] removed runBlocking, as it's no longer necessary --- .../network/ConnectionFilterTest.kt | 123 ++++++++---------- 1 file changed, 51 insertions(+), 72 deletions(-) diff --git a/test/dorkboxTest/network/ConnectionFilterTest.kt b/test/dorkboxTest/network/ConnectionFilterTest.kt index 4d69d717..ddce1c65 100644 --- a/test/dorkboxTest/network/ConnectionFilterTest.kt +++ b/test/dorkboxTest/network/ConnectionFilterTest.kt @@ -8,7 +8,6 @@ import dorkbox.network.connection.Connection import dorkbox.network.exceptions.ClientException import dorkbox.network.ipFilter.IpSubnetFilterRule import kotlinx.atomicfu.atomic -import kotlinx.coroutines.runBlocking import org.junit.Assert import org.junit.Test @@ -45,13 +44,11 @@ class ConnectionFilterTest : BaseTest() { stopEndPoints() } - runBlocking { - try { - client.connect(LOOPBACK) - } catch (e: Exception) { - stopEndPoints() - throw e - } + try { + client.connect(LOOPBACK) + } catch (e: Exception) { + stopEndPoints() + throw e } } @@ -96,13 +93,11 @@ class ConnectionFilterTest : BaseTest() { stopEndPoints() } - runBlocking { - try { - client.connect(LOOPBACK) - } catch (e: Exception) { - stopEndPoints() - throw e - } + try { + client.connect(LOOPBACK) + } catch (e: Exception) { + stopEndPoints() + throw e } } @@ -146,13 +141,11 @@ class ConnectionFilterTest : BaseTest() { stopEndPoints() } - runBlocking { - try { - client.connect(LOOPBACK) - } catch (e: Exception) { - stopEndPoints() - throw e - } + try { + client.connect(LOOPBACK) + } catch (e: Exception) { + stopEndPoints() + throw e } } @@ -196,13 +189,11 @@ class ConnectionFilterTest : BaseTest() { stopEndPoints() } - runBlocking { - try { - client.connect(LOOPBACK) - } catch (e: Exception) { - stopEndPoints() - throw e - } + try { + client.connect(LOOPBACK) + } catch (e: Exception) { + stopEndPoints() + throw e } } @@ -239,17 +230,15 @@ class ConnectionFilterTest : BaseTest() { stopEndPoints() } - runBlocking { - try { - client.connect(LOOPBACK) - } catch (e: Exception) { - stopEndPoints() - throw e - } + try { + client.connect(LOOPBACK, 0) + } catch (e: Exception) { + stopEndPoints() + throw e } } - waitForThreads() + waitForThreads(0) } @Test(expected = ClientException::class) @@ -277,13 +266,11 @@ class ConnectionFilterTest : BaseTest() { stopEndPoints() } - runBlocking { - try { - client.connect(LOOPBACK) - } catch (e: Exception) { - stopEndPoints() - throw e - } + try { + client.connect(LOOPBACK) + } catch (e: Exception) { + stopEndPoints() + throw e } } @@ -325,13 +312,11 @@ class ConnectionFilterTest : BaseTest() { stopEndPoints() } - runBlocking { - try { - client.connect(LOOPBACK) - } catch (e: Exception) { - stopEndPoints() - throw e - } + try { + client.connect(LOOPBACK) + } catch (e: Exception) { + stopEndPoints() + throw e } } @@ -377,13 +362,11 @@ class ConnectionFilterTest : BaseTest() { stopEndPoints() } - runBlocking { - try { - client.connect(LOOPBACK) - } catch (e: Exception) { - stopEndPoints() - throw e - } + try { + client.connect(LOOPBACK) + } catch (e: Exception) { + stopEndPoints() + throw e } } @@ -422,13 +405,11 @@ class ConnectionFilterTest : BaseTest() { stopEndPoints() } - runBlocking { - try { - client.connect(LOOPBACK) - } catch (e: Exception) { - stopEndPoints() - throw e - } + try { + client.connect(LOOPBACK) + } catch (e: Exception) { + stopEndPoints() + throw e } } @@ -462,13 +443,11 @@ class ConnectionFilterTest : BaseTest() { stopEndPoints() } - runBlocking { - try { - client.connect(LOOPBACK) - } catch (e: Exception) { - stopEndPoints() - throw e - } + try { + client.connect(LOOPBACK) + } catch (e: Exception) { + stopEndPoints() + throw e } }