-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,053 additions
and
1,094 deletions.
There are no files selected for viewing
215 changes: 78 additions & 137 deletions
215
cffu-core/src/test/java/io/foldright/cffu/CffuFactoryTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
cffu-core/src/test/java/io/foldright/cffu/CffuStateTest.java
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
cffu-core/src/test/java/io/foldright/cffu/CffuStateTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.foldright.cffu | ||
|
||
import io.kotest.matchers.shouldBe | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.condition.EnabledForJreRange | ||
import org.junit.jupiter.api.condition.JRE.JAVA_19 | ||
import java.util.concurrent.Future | ||
|
||
@EnabledForJreRange(min = JAVA_19) | ||
private class CffuStateTest { | ||
@Test | ||
fun toCffuState() { | ||
CffuState.toCffuState(Future.State.RUNNING) shouldBe CffuState.RUNNING | ||
CffuState.toCffuState(Future.State.SUCCESS) shouldBe CffuState.SUCCESS | ||
CffuState.toCffuState(Future.State.FAILED) shouldBe CffuState.FAILED | ||
CffuState.toCffuState(Future.State.CANCELLED) shouldBe CffuState.CANCELLED | ||
} | ||
|
||
@Test | ||
fun toFutureState() { | ||
CffuState.RUNNING.toFutureState() shouldBe Future.State.RUNNING | ||
CffuState.SUCCESS.toFutureState() shouldBe Future.State.SUCCESS | ||
CffuState.FAILED.toFutureState() shouldBe Future.State.FAILED | ||
CffuState.CANCELLED.toFutureState() shouldBe Future.State.CANCELLED | ||
} | ||
} |
166 changes: 76 additions & 90 deletions
166
cffu-core/src/test/java/io/foldright/cffu/CffuTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
cffu-core/src/test/java/io/foldright/cffu/CffuTestHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@file:JvmName("CffuTestHelper") | ||
|
||
package io.foldright.cffu | ||
|
||
import io.foldright.cffu.CffuFactoryBuilder.CffuMadeExecutor | ||
import java.util.concurrent.Executor | ||
|
||
fun CffuFactory.unwrapMadeExecutor(): Executor { | ||
val executor = defaultExecutor() as CffuMadeExecutor | ||
return executor.unwrap() | ||
} | ||
|
||
fun Cffu<*>.unwrapMadeExecutor(): Executor { | ||
val executor = defaultExecutor() as CffuMadeExecutor | ||
return executor.unwrap() | ||
} |
Oops, something went wrong.