From f2ab424c413412de5021bc1fd06c71e3e0dd9b63 Mon Sep 17 00:00:00 2001 From: dedoz Date: Tue, 26 Aug 2014 21:10:55 +0400 Subject: [PATCH] add generated tests --- .../codegen/android/fqNameInAttr/1.kt | 29 ++++ .../android/fqNameInAttr/AndroidManifest.xml | 33 ++++ .../android/fqNameInAttr/CustomWidgets.kt | 8 + .../android/fqNameInAttr/layout/layout.xml | 15 ++ .../testData/codegen/android/fqNameInTag/1.kt | 29 ++++ .../android/fqNameInTag/AndroidManifest.xml | 33 ++++ .../android/fqNameInTag/CustomWidgets.kt | 8 + .../android/fqNameInTag/layout/layout.xml | 14 ++ .../testData/codegen/android/manyWidgets/1.kt | 1 + .../android/manyWidgets/AndroidManifest.xml | 33 ++++ .../android/manyWidgets/layout/layout.xml | 67 +++++++++ .../testData/codegen/android/multiFile/1.kt | 37 +++++ .../android/multiFile/AndroidManifest.xml | 33 ++++ .../android/multiFile/layout/layout.xml | 29 ++++ .../android/multiFile/layout/layout1.xml | 29 ++++ .../testData/codegen/android/singleFile/1.kt | 37 +++++ .../android/singleFile/AndroidManifest.xml | 33 ++++ .../android/singleFile/layout/layout.xml | 29 ++++ .../resolve/android/AbstractAndroidBoxTest.kt | 59 ++++++++ .../android/AndroidBoxTestGenerated.java | 64 ++++++++ .../lang/resolve/android/AndroidXmlTest.java | 141 ------------------ .../resolve/android/ByteArrayClassLoader.java | 84 ----------- .../AbstractBlackBoxCodegenTest.java | 2 +- .../kotlin/generators/tests/GenerateTests.kt | 9 ++ .../android/IDEAndroidUIXmlProcessor.kt | 4 +- .../fqNameInAttr/AndroidManifest.xml | 33 ++++ .../crossParser/fqNameInAttr/layout.kt | 9 ++ .../fqNameInAttr/layout/layout.xml | 15 ++ .../fqNameInTag/AndroidManifest.xml | 33 ++++ .../android/crossParser/fqNameInTag/layout.kt | 9 ++ .../crossParser/fqNameInTag/layout/layout.xml | 14 ++ .../crossParser/multiFile/AndroidManifest.xml | 33 ++++ .../android/crossParser/multiFile/layout.kt | 30 ++++ .../crossParser/multiFile/layout/layout.xml | 29 ++++ .../crossParser/multiFile/layout/layout1.xml | 29 ++++ .../crossParser/noIds/AndroidManifest.xml | 33 ++++ .../android/crossParser/noIds/layout.kt | 6 + .../crossParser/noIds/layout/layout.xml | 25 ++++ .../singleFile/AndroidManifest.xml | 33 ++++ .../crossParser/singleFile/MyActivity.kt | 27 ++++ .../android/crossParser/singleFile/R.kt | 14 ++ .../android/crossParser/singleFile/layout.kt | 18 +++ .../crossParser/singleFile/layout/layout.xml | 29 ++++ .../jet}/android/AbstractCrossParserTest.kt | 26 +++- .../jet/android/CrossParserTestGenerated.java | 64 ++++++++ 45 files changed, 1135 insertions(+), 234 deletions(-) create mode 100644 compiler/testData/codegen/android/fqNameInAttr/1.kt create mode 100644 compiler/testData/codegen/android/fqNameInAttr/AndroidManifest.xml create mode 100644 compiler/testData/codegen/android/fqNameInAttr/CustomWidgets.kt create mode 100644 compiler/testData/codegen/android/fqNameInAttr/layout/layout.xml create mode 100644 compiler/testData/codegen/android/fqNameInTag/1.kt create mode 100644 compiler/testData/codegen/android/fqNameInTag/AndroidManifest.xml create mode 100644 compiler/testData/codegen/android/fqNameInTag/CustomWidgets.kt create mode 100644 compiler/testData/codegen/android/fqNameInTag/layout/layout.xml create mode 100644 compiler/testData/codegen/android/manyWidgets/1.kt create mode 100644 compiler/testData/codegen/android/manyWidgets/AndroidManifest.xml create mode 100644 compiler/testData/codegen/android/manyWidgets/layout/layout.xml create mode 100644 compiler/testData/codegen/android/multiFile/1.kt create mode 100644 compiler/testData/codegen/android/multiFile/AndroidManifest.xml create mode 100644 compiler/testData/codegen/android/multiFile/layout/layout.xml create mode 100644 compiler/testData/codegen/android/multiFile/layout/layout1.xml create mode 100644 compiler/testData/codegen/android/singleFile/1.kt create mode 100644 compiler/testData/codegen/android/singleFile/AndroidManifest.xml create mode 100644 compiler/testData/codegen/android/singleFile/layout/layout.xml create mode 100644 compiler/tests/org/jetbrains/jet/lang/resolve/android/AbstractAndroidBoxTest.kt create mode 100644 compiler/tests/org/jetbrains/jet/lang/resolve/android/AndroidBoxTestGenerated.java delete mode 100644 compiler/tests/org/jetbrains/jet/lang/resolve/android/AndroidXmlTest.java delete mode 100644 compiler/tests/org/jetbrains/jet/lang/resolve/android/ByteArrayClassLoader.java create mode 100644 idea/testData/android/crossParser/fqNameInAttr/AndroidManifest.xml create mode 100644 idea/testData/android/crossParser/fqNameInAttr/layout.kt create mode 100644 idea/testData/android/crossParser/fqNameInAttr/layout/layout.xml create mode 100644 idea/testData/android/crossParser/fqNameInTag/AndroidManifest.xml create mode 100644 idea/testData/android/crossParser/fqNameInTag/layout.kt create mode 100644 idea/testData/android/crossParser/fqNameInTag/layout/layout.xml create mode 100644 idea/testData/android/crossParser/multiFile/AndroidManifest.xml create mode 100644 idea/testData/android/crossParser/multiFile/layout.kt create mode 100644 idea/testData/android/crossParser/multiFile/layout/layout.xml create mode 100644 idea/testData/android/crossParser/multiFile/layout/layout1.xml create mode 100644 idea/testData/android/crossParser/noIds/AndroidManifest.xml create mode 100644 idea/testData/android/crossParser/noIds/layout.kt create mode 100644 idea/testData/android/crossParser/noIds/layout/layout.xml create mode 100644 idea/testData/android/crossParser/singleFile/AndroidManifest.xml create mode 100644 idea/testData/android/crossParser/singleFile/MyActivity.kt create mode 100644 idea/testData/android/crossParser/singleFile/R.kt create mode 100644 idea/testData/android/crossParser/singleFile/layout.kt create mode 100644 idea/testData/android/crossParser/singleFile/layout/layout.xml rename {compiler/tests/org/jetbrains/jet/lang/resolve => idea/tests/org/jetbrains/jet}/android/AbstractCrossParserTest.kt (56%) create mode 100644 idea/tests/org/jetbrains/jet/android/CrossParserTestGenerated.java diff --git a/compiler/testData/codegen/android/fqNameInAttr/1.kt b/compiler/testData/codegen/android/fqNameInAttr/1.kt new file mode 100644 index 00000000000..d7202aa8c72 --- /dev/null +++ b/compiler/testData/codegen/android/fqNameInAttr/1.kt @@ -0,0 +1,29 @@ +package com.myapp + +import android.app.Activity +import android.view.View +import android.widget.* +import org.my.cool.MyButton + +class R { + class id { + class object { + val login = 5 + } + } +} + +class MyActivity(): Activity() { + val buttonWidget = MyButton(this) + + override fun findViewById(id: Int): View? { + return when (id) { + R.id.login -> buttonWidget + else -> null + } + } +} + +fun box(): String { + return "OK" +} diff --git a/compiler/testData/codegen/android/fqNameInAttr/AndroidManifest.xml b/compiler/testData/codegen/android/fqNameInAttr/AndroidManifest.xml new file mode 100644 index 00000000000..580c474f5de --- /dev/null +++ b/compiler/testData/codegen/android/fqNameInAttr/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/compiler/testData/codegen/android/fqNameInAttr/CustomWidgets.kt b/compiler/testData/codegen/android/fqNameInAttr/CustomWidgets.kt new file mode 100644 index 00000000000..cf15bfe703e --- /dev/null +++ b/compiler/testData/codegen/android/fqNameInAttr/CustomWidgets.kt @@ -0,0 +1,8 @@ +package org.my.cool + +import android.widget.Button +import android.app.Activity + +class MyButton(ctx: Activity): Button(ctx) { + override fun toString(): String {return "Button"} +} diff --git a/compiler/testData/codegen/android/fqNameInAttr/layout/layout.xml b/compiler/testData/codegen/android/fqNameInAttr/layout/layout.xml new file mode 100644 index 00000000000..101bb490115 --- /dev/null +++ b/compiler/testData/codegen/android/fqNameInAttr/layout/layout.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/compiler/testData/codegen/android/fqNameInTag/1.kt b/compiler/testData/codegen/android/fqNameInTag/1.kt new file mode 100644 index 00000000000..9f597fb6c3e --- /dev/null +++ b/compiler/testData/codegen/android/fqNameInTag/1.kt @@ -0,0 +1,29 @@ +package com.myapp + +import android.app.Activity +import android.view.View +import android.widget.* +import org.my.cool.MyButton + +class R { + class id { + class object { + val login = 5 + } + } +} + +class MyActivity(): Activity() { + val buttonWidget = Button(this) + + override fun findViewById(id: Int): View? { + return when (id) { + R.id.login -> buttonWidget + else -> null + } + } +} + +fun box(): String { + return "OK" +} diff --git a/compiler/testData/codegen/android/fqNameInTag/AndroidManifest.xml b/compiler/testData/codegen/android/fqNameInTag/AndroidManifest.xml new file mode 100644 index 00000000000..580c474f5de --- /dev/null +++ b/compiler/testData/codegen/android/fqNameInTag/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/compiler/testData/codegen/android/fqNameInTag/CustomWidgets.kt b/compiler/testData/codegen/android/fqNameInTag/CustomWidgets.kt new file mode 100644 index 00000000000..59c3b9ff5be --- /dev/null +++ b/compiler/testData/codegen/android/fqNameInTag/CustomWidgets.kt @@ -0,0 +1,8 @@ +package org.my.cool + +import android.widget.Button +import android.content.Context + +class MyButton(ctx: Context): Button(ctx) { + override fun toString(): String {return "Button"} +} diff --git a/compiler/testData/codegen/android/fqNameInTag/layout/layout.xml b/compiler/testData/codegen/android/fqNameInTag/layout/layout.xml new file mode 100644 index 00000000000..27907c09826 --- /dev/null +++ b/compiler/testData/codegen/android/fqNameInTag/layout/layout.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/compiler/testData/codegen/android/manyWidgets/1.kt b/compiler/testData/codegen/android/manyWidgets/1.kt new file mode 100644 index 00000000000..bdc79a107c2 --- /dev/null +++ b/compiler/testData/codegen/android/manyWidgets/1.kt @@ -0,0 +1 @@ +fun box() = "OK" diff --git a/compiler/testData/codegen/android/manyWidgets/AndroidManifest.xml b/compiler/testData/codegen/android/manyWidgets/AndroidManifest.xml new file mode 100644 index 00000000000..580c474f5de --- /dev/null +++ b/compiler/testData/codegen/android/manyWidgets/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/compiler/testData/codegen/android/manyWidgets/layout/layout.xml b/compiler/testData/codegen/android/manyWidgets/layout/layout.xml new file mode 100644 index 00000000000..6ca5e004050 --- /dev/null +++ b/compiler/testData/codegen/android/manyWidgets/layout/layout.xml @@ -0,0 +1,67 @@ + + + + + + + + + \ No newline at end of file diff --git a/compiler/testData/codegen/android/multiFile/1.kt b/compiler/testData/codegen/android/multiFile/1.kt new file mode 100644 index 00000000000..246b6dee346 --- /dev/null +++ b/compiler/testData/codegen/android/multiFile/1.kt @@ -0,0 +1,37 @@ +package com.myapp + +import android.app.Activity +import android.view.View +import android.widget.* + +class R { + class id { + class object { + val item_detail_container = 0 + val textView1 = 1 + val password = 2 + val textView2 = 3 + val passwordConfirmation = 4 + val login = 5 + } + } +} + +class MyActivity(): Activity() { + val textViewWidget = TextView(this) + val editTextWidget = EditText(this) + val buttonWidget = Button(this) + + override fun findViewById(id: Int): View? { + return when (id) { + R.id.textView1 -> textViewWidget + R.id.password -> editTextWidget + R.id.login -> buttonWidget + else -> null + } + } +} + +fun box(): String { + return "OK" +} diff --git a/compiler/testData/codegen/android/multiFile/AndroidManifest.xml b/compiler/testData/codegen/android/multiFile/AndroidManifest.xml new file mode 100644 index 00000000000..580c474f5de --- /dev/null +++ b/compiler/testData/codegen/android/multiFile/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/compiler/testData/codegen/android/multiFile/layout/layout.xml b/compiler/testData/codegen/android/multiFile/layout/layout.xml new file mode 100644 index 00000000000..f4736f6937b --- /dev/null +++ b/compiler/testData/codegen/android/multiFile/layout/layout.xml @@ -0,0 +1,29 @@ + + + + + + + +