Skip to content

Commit 12f961d

Browse files
committed
Remove dependency on kotlin.test
1 parent b6b0125 commit 12f961d

File tree

11 files changed

+19
-35
lines changed

11 files changed

+19
-35
lines changed

kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/DeferTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package kotlinx.coroutines.experimental
22

33
import org.junit.Test
44
import java.io.IOException
5-
import kotlin.test.assertTrue
5+
import org.junit.Assert.*
66

77
class DeferTest : TestBase() {
88
@Test

kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ArrayChannelTest.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package kotlinx.coroutines.experimental.channels
22

33
import kotlinx.coroutines.experimental.*
44
import org.junit.Test
5-
import kotlin.test.assertEquals
6-
import kotlin.test.assertFalse
7-
import kotlin.test.assertTrue
5+
import org.junit.Assert.*
86

97
class ArrayChannelTest : TestBase() {
108
@Test

kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ChannelAtomicCancelStressTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.junit.Test
55
import org.junit.runner.RunWith
66
import org.junit.runners.Parameterized
77
import java.util.*
8-
import kotlin.test.assertEquals
8+
import org.junit.Assert.*
99

1010
@RunWith(Parameterized::class)
1111
class ChannelAtomicCancelStressTest(val kind: TestChannelKind) {

kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ChannelSendReceiveStressTest.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import org.junit.runner.RunWith
66
import org.junit.runners.Parameterized
77
import java.util.concurrent.ConcurrentHashMap
88
import java.util.concurrent.atomic.AtomicInteger
9-
import kotlin.test.assertEquals
10-
import kotlin.test.assertTrue
11-
9+
import org.junit.Assert.*
1210

1311
@RunWith(Parameterized::class)
1412
class ChannelSendReceiveStressTest(
@@ -72,7 +70,7 @@ class ChannelSendReceiveStressTest(
7270
assertEquals(0, dupes.get())
7371
assertEquals(nEvents, received.size)
7472
repeat(nReceivers) { receiveIndex ->
75-
assertTrue(receivedBy[receiveIndex] > 0, "Each receiver should have received something")
73+
assertTrue("Each receiver should have received something", receivedBy[receiveIndex] > 0)
7674
}
7775
}
7876

kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/RendezvousChannelTest.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package kotlinx.coroutines.experimental.channels
22

33
import kotlinx.coroutines.experimental.*
44
import org.junit.Test
5-
import kotlin.test.assertEquals
6-
import kotlin.test.assertFalse
7-
import kotlin.test.assertTrue
5+
import org.junit.Assert.*
86

97
class RendezvousChannelTest : TestBase() {
108
@Test

kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/SimpleSendReceiveTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import kotlinx.coroutines.experimental.runBlocking
66
import org.junit.Test
77
import org.junit.runner.RunWith
88
import org.junit.runners.Parameterized
9-
import kotlin.test.assertEquals
9+
import org.junit.Assert.*
1010

1111
@RunWith(Parameterized::class)
1212
class SimpleSendReceiveTest(

kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/internal/LockFreeLinkedListStressTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ class LockFreeLinkedListStressTest {
2626
for (i in j until nAdded step nAddThreads) {
2727
list.addFirst(IntNode(i))
2828
}
29+
println("${Thread.currentThread().name} completed")
2930
workingAdders.decrementAndGet()
3031
}
3132
for (j in 0 until nAddThreads)
3233
threads += thread(start = false, name = "lastAdder-$j") {
3334
for (i in -j-1 downTo -nAdded step nAddThreads) {
3435
list.addLast(IntNode(i))
3536
}
37+
println("${Thread.currentThread().name} completed")
3638
workingAdders.decrementAndGet()
3739
}
3840
for (j in 0 until nRemoveThreads)
@@ -45,6 +47,7 @@ class LockFreeLinkedListStressTest {
4547
node.remove()
4648
}
4749
} while (!lastTurn)
50+
println("${Thread.currentThread().name} completed")
4851
}
4952
println("Starting ${threads.size} threads")
5053
for (thread in threads)

kotlinx-coroutines-jdk8/src/test/kotlin/kotlinx/coroutines/experimental/future/FutureTest.kt

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import java.util.concurrent.CompletableFuture
66
import java.util.concurrent.ExecutionException
77
import java.util.concurrent.atomic.AtomicInteger
88
import kotlin.coroutines.experimental.CoroutineContext
9-
import kotlin.test.assertEquals
10-
import kotlin.test.assertFalse
11-
import kotlin.test.assertTrue
12-
import kotlin.test.fail
9+
import org.junit.Assert.*
1310

1411
class FutureTest {
1512
@Test
@@ -96,22 +93,20 @@ class FutureTest {
9693
it()
9794
depth.andDecrement
9895
}) {
99-
assertEquals(1, depth.get(), "Part before first suspension must be wrapped")
96+
assertEquals("Part before first suspension must be wrapped", 1, depth.get())
10097

10198
val result =
10299
CompletableFuture.supplyAsync {
103-
while (depth.get() > 0);
104-
105-
assertEquals(0, depth.get(), "Part inside suspension point should not be wrapped")
100+
while (depth.get() > 0) ;
101+
assertEquals("Part inside suspension point should not be wrapped", 0, depth.get())
106102
"OK"
107103
}.await()
108104

109-
assertEquals(1, depth.get(), "Part after first suspension should be wrapped")
105+
assertEquals("Part after first suspension should be wrapped", 1, depth.get())
110106

111107
CompletableFuture.supplyAsync {
112-
while (depth.get() > 0);
113-
114-
assertEquals(0, depth.get(), "Part inside suspension point should not be wrapped")
108+
while (depth.get() > 0) ;
109+
assertEquals("Part inside suspension point should not be wrapped", 0, depth.get())
115110
"ignored"
116111
}.await()
117112

kotlinx-coroutines-nio/src/test/kotlin/kotlinx/coroutines/experimental/nio/AsyncIOTest.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import java.nio.channels.AsynchronousFileChannel
1313
import java.nio.channels.AsynchronousServerSocketChannel
1414
import java.nio.channels.AsynchronousSocketChannel
1515
import java.nio.file.StandardOpenOption
16-
import kotlin.test.assertEquals
17-
import kotlin.test.assertTrue
16+
import org.junit.Assert.*
1817

1918
class AsyncIOTest {
2019
@Rule

kotlinx-coroutines-rx/src/test/kotlin/kotlinx/coroutines/experimental/rx/AsyncRxTest.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package kotlinx.coroutines.experimental.rx
22

3+
import org.junit.Assert.*
34
import org.junit.Test
45
import rx.Observable
56
import java.util.concurrent.TimeUnit
6-
import kotlin.test.assertEquals
7-
import kotlin.test.fail
87

98
class AsyncRxTest {
109
@Test

0 commit comments

Comments
 (0)