Remove dependency on kotlin.test
diff --git a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/DeferTest.kt b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/DeferTest.kt
index a98b6f0..4a87c8c 100644
--- a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/DeferTest.kt
+++ b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/DeferTest.kt
@@ -2,7 +2,7 @@
import org.junit.Test
import java.io.IOException
-import kotlin.test.assertTrue
+import org.junit.Assert.*
class DeferTest : TestBase() {
@Test
diff --git a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ArrayChannelTest.kt b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ArrayChannelTest.kt
index 2f837e5..10e4b04 100644
--- a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ArrayChannelTest.kt
+++ b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ArrayChannelTest.kt
@@ -2,9 +2,7 @@
import kotlinx.coroutines.experimental.*
import org.junit.Test
-import kotlin.test.assertEquals
-import kotlin.test.assertFalse
-import kotlin.test.assertTrue
+import org.junit.Assert.*
class ArrayChannelTest : TestBase() {
@Test
diff --git a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ChannelAtomicCancelStressTest.kt b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ChannelAtomicCancelStressTest.kt
index a395ce4..47b4da3 100644
--- a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ChannelAtomicCancelStressTest.kt
+++ b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ChannelAtomicCancelStressTest.kt
@@ -5,7 +5,7 @@
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import java.util.*
-import kotlin.test.assertEquals
+import org.junit.Assert.*
@RunWith(Parameterized::class)
class ChannelAtomicCancelStressTest(val kind: TestChannelKind) {
diff --git a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ChannelSendReceiveStressTest.kt b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ChannelSendReceiveStressTest.kt
index 32a33ca..2f58efe 100644
--- a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ChannelSendReceiveStressTest.kt
+++ b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ChannelSendReceiveStressTest.kt
@@ -6,9 +6,7 @@
import org.junit.runners.Parameterized
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicInteger
-import kotlin.test.assertEquals
-import kotlin.test.assertTrue
-
+import org.junit.Assert.*
@RunWith(Parameterized::class)
class ChannelSendReceiveStressTest(
@@ -72,7 +70,7 @@
assertEquals(0, dupes.get())
assertEquals(nEvents, received.size)
repeat(nReceivers) { receiveIndex ->
- assertTrue(receivedBy[receiveIndex] > 0, "Each receiver should have received something")
+ assertTrue("Each receiver should have received something", receivedBy[receiveIndex] > 0)
}
}
diff --git a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/RendezvousChannelTest.kt b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/RendezvousChannelTest.kt
index a0ef4d1..777e4a3 100644
--- a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/RendezvousChannelTest.kt
+++ b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/RendezvousChannelTest.kt
@@ -2,9 +2,7 @@
import kotlinx.coroutines.experimental.*
import org.junit.Test
-import kotlin.test.assertEquals
-import kotlin.test.assertFalse
-import kotlin.test.assertTrue
+import org.junit.Assert.*
class RendezvousChannelTest : TestBase() {
@Test
diff --git a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/SimpleSendReceiveTest.kt b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/SimpleSendReceiveTest.kt
index 1464151..f46136d 100644
--- a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/SimpleSendReceiveTest.kt
+++ b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/SimpleSendReceiveTest.kt
@@ -6,7 +6,7 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
-import kotlin.test.assertEquals
+import org.junit.Assert.*
@RunWith(Parameterized::class)
class SimpleSendReceiveTest(
diff --git a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/internal/LockFreeLinkedListStressTest.kt b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/internal/LockFreeLinkedListStressTest.kt
index 635a896..04541fa 100644
--- a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/internal/LockFreeLinkedListStressTest.kt
+++ b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/internal/LockFreeLinkedListStressTest.kt
@@ -26,6 +26,7 @@
for (i in j until nAdded step nAddThreads) {
list.addFirst(IntNode(i))
}
+ println("${Thread.currentThread().name} completed")
workingAdders.decrementAndGet()
}
for (j in 0 until nAddThreads)
@@ -33,6 +34,7 @@
for (i in -j-1 downTo -nAdded step nAddThreads) {
list.addLast(IntNode(i))
}
+ println("${Thread.currentThread().name} completed")
workingAdders.decrementAndGet()
}
for (j in 0 until nRemoveThreads)
@@ -45,6 +47,7 @@
node.remove()
}
} while (!lastTurn)
+ println("${Thread.currentThread().name} completed")
}
println("Starting ${threads.size} threads")
for (thread in threads)
diff --git a/kotlinx-coroutines-jdk8/src/test/kotlin/kotlinx/coroutines/experimental/future/FutureTest.kt b/kotlinx-coroutines-jdk8/src/test/kotlin/kotlinx/coroutines/experimental/future/FutureTest.kt
index cd1296e..65eac20 100644
--- a/kotlinx-coroutines-jdk8/src/test/kotlin/kotlinx/coroutines/experimental/future/FutureTest.kt
+++ b/kotlinx-coroutines-jdk8/src/test/kotlin/kotlinx/coroutines/experimental/future/FutureTest.kt
@@ -6,10 +6,7 @@
import java.util.concurrent.ExecutionException
import java.util.concurrent.atomic.AtomicInteger
import kotlin.coroutines.experimental.CoroutineContext
-import kotlin.test.assertEquals
-import kotlin.test.assertFalse
-import kotlin.test.assertTrue
-import kotlin.test.fail
+import org.junit.Assert.*
class FutureTest {
@Test
@@ -96,22 +93,20 @@
it()
depth.andDecrement
}) {
- assertEquals(1, depth.get(), "Part before first suspension must be wrapped")
+ assertEquals("Part before first suspension must be wrapped", 1, depth.get())
val result =
CompletableFuture.supplyAsync {
- while (depth.get() > 0);
-
- assertEquals(0, depth.get(), "Part inside suspension point should not be wrapped")
+ while (depth.get() > 0) ;
+ assertEquals("Part inside suspension point should not be wrapped", 0, depth.get())
"OK"
}.await()
- assertEquals(1, depth.get(), "Part after first suspension should be wrapped")
+ assertEquals("Part after first suspension should be wrapped", 1, depth.get())
CompletableFuture.supplyAsync {
- while (depth.get() > 0);
-
- assertEquals(0, depth.get(), "Part inside suspension point should not be wrapped")
+ while (depth.get() > 0) ;
+ assertEquals("Part inside suspension point should not be wrapped", 0, depth.get())
"ignored"
}.await()
diff --git a/kotlinx-coroutines-nio/src/test/kotlin/kotlinx/coroutines/experimental/nio/AsyncIOTest.kt b/kotlinx-coroutines-nio/src/test/kotlin/kotlinx/coroutines/experimental/nio/AsyncIOTest.kt
index c78ea09..e8ff627 100644
--- a/kotlinx-coroutines-nio/src/test/kotlin/kotlinx/coroutines/experimental/nio/AsyncIOTest.kt
+++ b/kotlinx-coroutines-nio/src/test/kotlin/kotlinx/coroutines/experimental/nio/AsyncIOTest.kt
@@ -13,8 +13,7 @@
import java.nio.channels.AsynchronousServerSocketChannel
import java.nio.channels.AsynchronousSocketChannel
import java.nio.file.StandardOpenOption
-import kotlin.test.assertEquals
-import kotlin.test.assertTrue
+import org.junit.Assert.*
class AsyncIOTest {
@Rule
diff --git a/kotlinx-coroutines-rx/src/test/kotlin/kotlinx/coroutines/experimental/rx/AsyncRxTest.kt b/kotlinx-coroutines-rx/src/test/kotlin/kotlinx/coroutines/experimental/rx/AsyncRxTest.kt
index 04bb0a2..731286e 100644
--- a/kotlinx-coroutines-rx/src/test/kotlin/kotlinx/coroutines/experimental/rx/AsyncRxTest.kt
+++ b/kotlinx-coroutines-rx/src/test/kotlin/kotlinx/coroutines/experimental/rx/AsyncRxTest.kt
@@ -1,10 +1,9 @@
package kotlinx.coroutines.experimental.rx
+import org.junit.Assert.*
import org.junit.Test
import rx.Observable
import java.util.concurrent.TimeUnit
-import kotlin.test.assertEquals
-import kotlin.test.fail
class AsyncRxTest {
@Test
diff --git a/pom.xml b/pom.xml
index d3fa563..e174569 100644
--- a/pom.xml
+++ b/pom.xml
@@ -102,12 +102,6 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-test-junit</artifactId>
- <version>${kotlin.version}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>