-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NU-1923] Rename source 'periodic' to 'sample generator' (#7368)
rename periodic source to sample generator
- Loading branch information
Showing
32 changed files
with
110 additions
and
40 deletions.
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
...cala/pl/touk/nussknacker/defaultmodel/migrations/PeriodicToSampleGeneratorMigration.scala
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,18 @@ | ||
package pl.touk.nussknacker.defaultmodel.migrations | ||
|
||
import pl.touk.nussknacker.engine.api.MetaData | ||
import pl.touk.nussknacker.engine.graph.node | ||
import pl.touk.nussknacker.engine.graph.node.Source | ||
import pl.touk.nussknacker.engine.graph.source.SourceRef | ||
import pl.touk.nussknacker.engine.migration.NodeMigration | ||
|
||
object PeriodicToSampleGeneratorMigration extends NodeMigration { | ||
|
||
override val description: String = "Change name of component: periodic -> sample-generator" | ||
|
||
override def migrateNode(metaData: MetaData): PartialFunction[node.NodeData, node.NodeData] = { | ||
case n @ Source(_, ref @ SourceRef("periodic", _), _) => | ||
n.copy(ref = ref.copy(typ = "sample-generator")) | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
...est/scala/pl/touk/nussknacker/defaultModel/migrations/PeriodicToSampleGeneratorSpec.scala
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,45 @@ | ||
package pl.touk.nussknacker.defaultModel.migrations | ||
|
||
import org.scalatest.freespec.AnyFreeSpecLike | ||
import org.scalatest.matchers.should.Matchers | ||
import pl.touk.nussknacker.defaultmodel.migrations.PeriodicToSampleGeneratorMigration | ||
import pl.touk.nussknacker.engine.api.parameter.ParameterName | ||
import pl.touk.nussknacker.engine.api.{MetaData, StreamMetaData} | ||
import pl.touk.nussknacker.engine.graph.evaluatedparam.Parameter | ||
import pl.touk.nussknacker.engine.graph.node.Source | ||
import pl.touk.nussknacker.engine.graph.source.SourceRef | ||
import pl.touk.nussknacker.engine.spel.SpelExtension._ | ||
|
||
class PeriodicToSampleGeneratorSpec extends AnyFreeSpecLike with Matchers { | ||
|
||
"PeriodicToSampleGeneratorMigration should be applied" in { | ||
val metaData = MetaData("test", StreamMetaData(Some(1))) | ||
val beforeMigration = Source( | ||
id = "periodic", | ||
ref = SourceRef( | ||
typ = "periodic", | ||
parameters = List( | ||
Parameter(ParameterName("period"), "T(java.time.Duration).parse('PT1M')".spel), | ||
Parameter(ParameterName("count"), "1".spel), | ||
Parameter(ParameterName("value"), "1".spel), | ||
) | ||
) | ||
) | ||
val expectedAfterMigration = Source( | ||
id = "periodic", | ||
ref = SourceRef( | ||
typ = "sample-generator", | ||
parameters = List( | ||
Parameter(ParameterName("period"), "T(java.time.Duration).parse('PT1M')".spel), | ||
Parameter(ParameterName("count"), "1".spel), | ||
Parameter(ParameterName("value"), "1".spel), | ||
) | ||
) | ||
) | ||
|
||
val migrated = PeriodicToSampleGeneratorMigration.migrateNode(metaData)(beforeMigration) | ||
|
||
migrated shouldBe expectedAfterMigration | ||
} | ||
|
||
} |
Binary file modified
BIN
+1.31 KB
(110%)
...should display question mark when renaming a node and updating the count #0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.4 KB
...hots__/electron/Linux/Node window should display sample-generator source #0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.46 KB
(100%)
...ots__/electron/Linux/Process initially clean should import JSON and save #1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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