-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix generator for open class (use polymorphic serializers)
- Loading branch information
1 parent
20a8393
commit 8ef56aa
Showing
14 changed files
with
1,354 additions
and
12 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
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
.../com/jetbrains/rd/generator/test/cases/generator/csharp/RecursivePolymorphicCSharpTest.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,18 @@ | ||
package com.jetbrains.rd.generator.test.cases.generator.csharp | ||
|
||
import com.jetbrains.rd.generator.test.cases.generator.testModels.RecursivePolymorphicModel | ||
import com.jetbrains.rd.generator.test.cases.generator.testModels.RecursivePolymorphicModelRoot | ||
import com.jetbrains.rd.generator.testframework.CSharpRdGenOutputTest | ||
import com.jetbrains.rd.generator.testframework.KotlinRdGenOutputTest | ||
import org.junit.jupiter.api.Test | ||
|
||
class RecursivePolymorphicCSharpTest : CSharpRdGenOutputTest() { | ||
companion object { | ||
const val testName = "recursivePolymorphicModelTest" | ||
} | ||
|
||
override val testName = Companion.testName | ||
|
||
@Test | ||
fun test1() = doTest<RecursivePolymorphicModelRoot>(RecursivePolymorphicModelRoot::class.java, RecursivePolymorphicModel::class.java) | ||
} |
17 changes: 17 additions & 0 deletions
17
.../com/jetbrains/rd/generator/test/cases/generator/kotlin/RecursivePolymorphicKotlinTest.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,17 @@ | ||
package com.jetbrains.rd.generator.test.cases.generator.kotlin | ||
|
||
import com.jetbrains.rd.generator.test.cases.generator.testModels.RecursivePolymorphicModel | ||
import com.jetbrains.rd.generator.test.cases.generator.testModels.RecursivePolymorphicModelRoot | ||
import com.jetbrains.rd.generator.testframework.KotlinRdGenOutputTest | ||
import org.junit.jupiter.api.Test | ||
|
||
class RecursivePolymorphicKotlinTest : KotlinRdGenOutputTest() { | ||
companion object { | ||
const val testName = "recursivePolymorphicModelTest" | ||
} | ||
|
||
override val testName = Companion.testName | ||
|
||
@Test | ||
fun test1() = doTest<RecursivePolymorphicModelRoot>(RecursivePolymorphicModelRoot::class.java, RecursivePolymorphicModel::class.java) | ||
} |
23 changes: 23 additions & 0 deletions
23
...n/com/jetbrains/rd/generator/test/cases/generator/testModels/RecursivePolymorphicModel.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,23 @@ | ||
package com.jetbrains.rd.generator.test.cases.generator.testModels | ||
|
||
import com.jetbrains.rd.generator.nova.* | ||
import com.jetbrains.rd.generator.test.cases.generator.csharp.RecursivePolymorphicCSharpTest | ||
import com.jetbrains.rd.generator.test.cases.generator.kotlin.RecursivePolymorphicKotlinTest | ||
import com.jetbrains.rd.generator.testframework.CSharpRdGenOutputTest | ||
import com.jetbrains.rd.generator.testframework.KotlinRdGenOutputTest | ||
|
||
object RecursivePolymorphicModelRoot : Root( | ||
*KotlinRdGenOutputTest.generators(RecursivePolymorphicKotlinTest.testName, "org.example"), | ||
*CSharpRdGenOutputTest.generators(RecursivePolymorphicCSharpTest.testName, "org.example") | ||
) | ||
|
||
object RecursivePolymorphicModel : Ext(RecursivePolymorphicModelRoot) { | ||
internal val BeTreeGridLine = openclass BeTreeGridLine@ { | ||
list("children", this@BeTreeGridLine) | ||
} | ||
|
||
init { | ||
property("line", BeTreeGridLine) | ||
property("list", immutableList(BeTreeGridLine)) | ||
} | ||
} |
Oops, something went wrong.