Skip to content

Commit

Permalink
Optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
nsk90 committed Oct 23, 2024
1 parent 1b4f63e commit 126e6b6
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 18 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ state (like stack based FSMs do)
transitions
* **[Export](https://kstatemachine.github.io/kstatemachine/pages/export.html)** state machine structure
to [PlantUML](https://plantuml.com/) and [Mermaid](https://mermaid.js.org/) diagrams
* **[Persist (serialize)](https://kstatemachine.github.io/kstatemachine/pages/persistence.html)** state machine's
* **[Persist (serialize)](https://kstatemachine.github.io/kstatemachine/pages/persistence.html)** state machine's
active
configuration and restore it later. Built-in `kotlinx.serialization` support.
* **[Testable](https://kstatemachine.github.io/kstatemachine/pages/testing.html)** - run state machine from specified
Expand Down Expand Up @@ -223,7 +223,6 @@ dependencies {
// multiplatform artifacts, where <Tag> is a library version.
implementation("io.github.nsk90:kstatemachine:<Tag>")
implementation("io.github.nsk90:kstatemachine-coroutines:<Tag>")
implementation("io.github.nsk90:kstatemachine-serialization:<Tag>")
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/persistence.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: page
title: Persistence
title: Persistence (Serialization)
---

# Persistence (Serialization)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package ru.nsk.kstatemachine.persistence

import ru.nsk.kstatemachine.event.SerializableGeneratedEvent
import ru.nsk.kstatemachine.event.StartEvent
import ru.nsk.kstatemachine.statemachine.*
import ru.nsk.kstatemachine.visitors.structureHashCode

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package ru.nsk.samples

import kotlinx.coroutines.runBlocking
import ru.nsk.kstatemachine.statemachine.StateMachine
import ru.nsk.kstatemachine.event.Event
import ru.nsk.kstatemachine.state.*
import ru.nsk.kstatemachine.statemachine.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import kotlinx.coroutines.runBlocking
import kotlinx.serialization.Serializable
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import kotlinx.serialization.modules.*
import kotlinx.serialization.modules.SerializersModule
import kotlinx.serialization.modules.plus
import kotlinx.serialization.modules.polymorphic
import kotlinx.serialization.modules.subclass
import ru.nsk.kstatemachine.event.Event
import ru.nsk.kstatemachine.persistence.RecordedEvents
import ru.nsk.kstatemachine.persistence.restoreByRecordedEvents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.take
import ru.nsk.kstatemachine.SecondEvent
import ru.nsk.kstatemachine.SwitchEvent
import ru.nsk.kstatemachine.statemachine.StateMachineNotification.*
import ru.nsk.kstatemachine.event.StartEvent
import ru.nsk.kstatemachine.mockkCallbacks
import ru.nsk.kstatemachine.state.*
import ru.nsk.kstatemachine.statemachine.*
import ru.nsk.kstatemachine.statemachine.StateMachineNotification.*
import ru.nsk.kstatemachine.transition.onTriggered
import ru.nsk.kstatemachine.transition.stay
import kotlin.coroutines.EmptyCoroutineContext


@OptIn(ExperimentalCoroutinesApi::class, DelicateCoroutinesApi::class)
class CoroutinesTest : StringSpec({
/** Coroutines manipulations like withContext or launch from coroutineScope make test fail. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import io.mockk.verifySequence
import ru.nsk.kstatemachine.*
import ru.nsk.kstatemachine.state.*
import ru.nsk.kstatemachine.statemachine.StateMachine
import ru.nsk.kstatemachine.statemachine.processEventBlocking
import ru.nsk.kstatemachine.transition.EventAndArgument
import ru.nsk.kstatemachine.transition.onTriggered
import ru.nsk.kstatemachine.visitors.export.exportToPlantUml

class FinishedEventTest : StringSpec({
CoroutineStarterType.entries.forEach { coroutineStarterType ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import io.kotest.matchers.collections.shouldContainInOrder
import io.kotest.matchers.collections.shouldHaveSize
import io.kotest.matchers.shouldBe
import io.kotest.matchers.types.shouldBeInstanceOf
import io.kotest.mpp.start
import ru.nsk.kstatemachine.*
import ru.nsk.kstatemachine.event.FinishedEvent
import ru.nsk.kstatemachine.event.SerializableGeneratedEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import io.kotest.matchers.types.shouldBeInstanceOf
import kotlinx.coroutines.CoroutineScope
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.builtins.nullable
import kotlinx.serialization.builtins.serializer
import kotlinx.serialization.descriptors.buildClassSerialDescriptor
import kotlinx.serialization.descriptors.element
import kotlinx.serialization.encodeToString
Expand All @@ -27,7 +25,6 @@ import kotlinx.serialization.modules.polymorphic
import kotlinx.serialization.modules.subclass
import ru.nsk.kstatemachine.event.DataEvent
import ru.nsk.kstatemachine.event.Event
import ru.nsk.kstatemachine.event.SerializableGeneratedEvent.EventType
import ru.nsk.kstatemachine.persistence.RecordedEvents
import ru.nsk.kstatemachine.persistence.restoreByRecordedEvents
import ru.nsk.kstatemachine.state.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import io.kotest.matchers.shouldBe
import io.mockk.verifySequence
import ru.nsk.kstatemachine.*
import ru.nsk.kstatemachine.event.DataEvent
import ru.nsk.kstatemachine.event.defaultDataExtractor
import ru.nsk.kstatemachine.state.ChoiceStateTestData.IntEvent
import ru.nsk.kstatemachine.state.ChoiceStateTestData.State1
import ru.nsk.kstatemachine.state.ChoiceStateTestData.State2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import ru.nsk.kstatemachine.event.UndoEvent
import ru.nsk.kstatemachine.event.WrappedEvent
import ru.nsk.kstatemachine.state.UndoTestData.SwitchDataEvent
import ru.nsk.kstatemachine.statemachine.*
import ru.nsk.kstatemachine.statemachine.StateMachine.*
import ru.nsk.kstatemachine.statemachine.StateMachine.IgnoredEventHandler
import ru.nsk.kstatemachine.statemachine.StateMachine.Logger
import ru.nsk.kstatemachine.transition.unwrappedArgument
import ru.nsk.kstatemachine.transition.unwrappedEvent

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import io.kotest.data.table
import io.kotest.matchers.shouldBe
import io.kotest.matchers.types.shouldNotBeInstanceOf
import ru.nsk.kstatemachine.*
import ru.nsk.kstatemachine.metainfo.UmlMetaInfo
import ru.nsk.kstatemachine.metainfo.buildUmlMetaInfo
import ru.nsk.kstatemachine.state.*
import ru.nsk.kstatemachine.statemachine.StateMachine
Expand Down

0 comments on commit 126e6b6

Please sign in to comment.