aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin
diff options
context:
space:
mode:
authorbush-did-711 <39170869+bush-did-711@users.noreply.github.com>2022-03-27 23:14:27 -1000
committerbush-did-711 <39170869+bush-did-711@users.noreply.github.com>2022-03-27 23:14:27 -1000
commite14ab8f09fd5cf2a8917d43c7edc9a402283b0a3 (patch)
treea919b08b9cd716e03ffbf534737d79dac6129863 /src/test/kotlin
parentdcd9eaad6d679307c54d18ea16bbd54abae0fc35 (diff)
downloadeventbus-kotlin-e14ab8f09fd5cf2a8917d43c7edc9a402283b0a3.tar.gz
eventbus-kotlin-e14ab8f09fd5cf2a8917d43c7edc9a402283b0a3.tar.bz2
eventbus-kotlin-e14ab8f09fd5cf2a8917d43c7edc9a402283b0a3.zip
not done
Diffstat (limited to 'src/test/kotlin')
-rw-r--r--src/test/kotlin/Main.kt58
1 files changed, 45 insertions, 13 deletions
diff --git a/src/test/kotlin/Main.kt b/src/test/kotlin/Main.kt
index 0933c97..dc6e194 100644
--- a/src/test/kotlin/Main.kt
+++ b/src/test/kotlin/Main.kt
@@ -1,26 +1,58 @@
import me.bush.illnamethislater.*
+import org.apache.logging.log4j.Level
+import org.apache.logging.log4j.LogManager
+import org.apache.logging.log4j.core.config.Configurator
/**
* @author bush
- * @since 3/13/2022
+ * @since 1.0.0
*/
fun main() {
- EventBus().run {
+ Configurator.setRootLevel(Level.INFO)
- subscribe(Subscriber())
+// EventBus().run {
+//
+// subscribe(Subscriber())
+//
+// post("String")
+//
+// val key = register(listener<Int> {
+// println(it)
+// })
+//
+// val topLevelListenerKey = register(topLevelListener())
+//
+// unsubscribe(key)
+//
+// unsubscribe(topLevelListenerKey)
+//
+// debugInfo()
+// }
- post("Object()")
+ val not = NotDuck()
+ not.wtf()
+ doDuck(not)
+ //doDuck(Any())
+}
+
+fun topLevelListener() = listener<Int> { println("topLevelListener(): $it") }
- register(listener<String> {
- println("it")
- })
+class Subscriber {
+
+ val listener0 get() = listener<String>(500, true, false) {
+ println(it.uppercase())
}
}
-class Subscriber {
-// clean up and writr tests
- @EventListener
- fun onDeez() = listener(listener = { e: String ->
- println(e.uppercase())
- }, receiveCancelled = false, )
+fun doDuck(any: Any) {
+}
+
+class NotDuck {
+ fun wtf() {
+ println("wtf")
+ }
+}
+
+interface Duck {
+ fun wtf()
}