Skip to content

Commit fbb36d3

Browse files
committed
xxx-test files are renamed to xxx-example as appropriate
1 parent d528e3e commit fbb36d3

File tree

10 files changed

+11
-4
lines changed

10 files changed

+11
-4
lines changed

kotlinx-coroutines-core/src/test/kotlin/examples/coroutineName-test.kt renamed to kotlinx-coroutines-core/src/test/kotlin/examples/coroutineName-example.kt

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

33
import kotlinx.coroutines.experimental.*
44

5-
fun main(args: Array<String>) = runBlocking(Here + CoroutineName("main")) {
5+
fun main(args: Array<String>) = runBlocking(CoroutineName("main")) {
66
log("Started main coroutine")
77
// run two background value computations
88
val v1 = defer(CommonPool + CoroutineName("v1")) {

kotlinx-coroutines-core/src/test/kotlin/examples/defer-test.kt renamed to kotlinx-coroutines-core/src/test/kotlin/examples/defer-example.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import kotlinx.coroutines.experimental.*
44

55
val receiverThread = newSingleThreadContext("ReceiverThread")
66

7-
fun main(args: Array<String>) = runBlocking(Here) {
7+
fun main(args: Array<String>) = runBlocking {
88
val va = Array<Deferred<String>>(10) { i ->
99
defer(CommonPool) {
1010
val sleepTime = i * 200L

kotlinx-coroutines-javafx/src/test/kotlin/FxTestApp.kt renamed to kotlinx-coroutines-javafx/src/test/kotlin/examples/FxExampleApp.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package examples
2+
13
import javafx.application.Application
24
import javafx.scene.Node
35
import javafx.scene.Scene
@@ -8,6 +10,7 @@ import javafx.scene.paint.Color
810
import javafx.scene.shape.Circle
911
import javafx.scene.shape.Rectangle
1012
import javafx.stage.Stage
13+
import kotlinx.coroutines.experimental.CoroutineScope
1114
import kotlinx.coroutines.experimental.Job
1215
import kotlinx.coroutines.experimental.delay
1316
import kotlinx.coroutines.experimental.javafx.JavaFx
@@ -50,7 +53,7 @@ class FxTestApp : Application() {
5053
val animations = arrayListOf<Job>()
5154
var animationIndex = 0
5255

53-
private fun animation(node: Node, block: suspend () -> Unit) {
56+
private fun animation(node: Node, block: suspend CoroutineScope.() -> Unit) {
5457
root.children += node
5558
val job = launch(JavaFx, block)
5659
animations += job

kotlinx-coroutines-swing/src/test/kotlin/swing-ui-example.kt renamed to kotlinx-coroutines-swing/src/test/kotlin/examples/SwingExampleApp.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package examples
2+
13
import kotlinx.coroutines.experimental.future.await
24
import kotlinx.coroutines.experimental.launch
35
import kotlinx.coroutines.experimental.swing.Swing

kotlinx-coroutines-swing/src/test/kotlin/swing-test.kt renamed to kotlinx-coroutines-swing/src/test/kotlin/examples/swing-example.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package examples
2+
13
import kotlinx.coroutines.experimental.runBlocking
24
import kotlinx.coroutines.experimental.swing.Swing
35
import java.time.Instant
@@ -23,7 +25,7 @@ fun main(args: Array<String>) = runBlocking(Swing) {
2325
try {
2426
// suspend while asynchronously making request
2527
val result = makeRequest()
26-
// display result in UI, here Swing dispatcher ensures that we always stay in event dispatch thread
28+
// example.display result in UI, here Swing dispatcher ensures that we always stay in event dispatch thread
2729
display(result)
2830
} catch (exception: Throwable) {
2931
// process exception

0 commit comments

Comments
 (0)