Move JVM specific IC tests with class hierarchy changes

This commit is contained in:
Alexey Tsvetkov
2017-07-13 08:06:16 +03:00
parent e16c5ddb97
commit 0a5fe3ef7c
50 changed files with 60 additions and 30 deletions
@@ -0,0 +1,10 @@
abstract class Introspector<M : Model>(protected val model: Model) {
protected abstract inner class Retriever(protected val transaction: Any) {
protected var model: Model = this@Introspector.model
}
protected abstract inner class SchemaRetriever(transaction: Any): Retriever(transaction) {
protected inline fun inSchema(crossinline modifier: (Any) -> Unit) =
model.modify { schema -> modifier.invoke(schema) }
}
}
@@ -0,0 +1,12 @@
class IntrospectorImpl(model: ModuleImpl) : Introspector<ModuleImpl>(model) {
private inner class SchemaRetriever(transaction: Any) : Introspector<ModuleImpl>.SchemaRetriever(transaction) {
internal fun retrieve() {
inSchema { schema -> println(schema) }
}
}
}
class ModuleImpl : Model {
override fun modify(modifier: ModelModifier) {}
}
@@ -0,0 +1,4 @@
public interface Model {
void modify(ModelModifier modifier);
}
@@ -0,0 +1,3 @@
public interface ModelModifier {
void perform(Object element);
}
@@ -0,0 +1,7 @@
================ Step #1 =================
Compiling files:
src/IntrospectorImpl.kt
End of files
Exit code: OK
------------------------------------------