Skip to content

betschwa/ksteps

Repository files navigation

Logo

ksteps

Kotlin Apache License

Kolin Steps Framework.

How to use ksteps in your project

Maven

<dependency>
    <groupId>org.ib</groupId>
    <artifactId>ksteps-threads</artifactId>
    <version>[KSTEPS VERSION]</version>
</dependency>

Kotlin

val value = SyncValue(initValue = false,
                      name = "Sample Value")

assertFalse(actual = value.value,
            message = "Value not initialised")

kotlin.concurrent.timer(name = "Set value timer",
                        daemon = true,
                        period = 10_000L) {
    value.value = true
}

assertTrue(actual = value.waitFor(duration = 30.seconds) { it },
           message = "Value not changed")

Java

final SyncValue<Boolean> value = new SyncValue<>(false,
                                                 "Sample Value");

Assertions.assertFalse(value.getValue(),
                       "Value not initialised");

new Timer("Set value timer",
          true).schedule(new TimerTask() {
                             @Override
                             public void run() {
                                 value.setValue(true);
                             }
                         },
                         10_000L);

Assertions.assertTrue(value.waitFor(Duration.ofSeconds(30L),
                                    "Wait for TV...",
                                    (newValue) -> newValue),
                      "Value not changed");

Reporting issues/Support

Please use GitHub issues for filing feature requests and bug reports.

License

ksteps is licensed under the Apache 2.0 License.

About

Kotlin Steps Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published