diff --git a/compiler/testData/codegen/androidPersistence/AndroidManifest.xml b/compiler/testData/codegen/androidPersistence/AndroidManifest.xml
new file mode 100644
index 00000000000..c82007dcc87
--- /dev/null
+++ b/compiler/testData/codegen/androidPersistence/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/compiler/testData/codegen/androidPersistence/fqNameInAttr/fqNameInAttr.kt b/compiler/testData/codegen/androidPersistence/fqNameInAttr/fqNameInAttr.kt
new file mode 100644
index 00000000000..9e4a091ad9a
--- /dev/null
+++ b/compiler/testData/codegen/androidPersistence/fqNameInAttr/fqNameInAttr.kt
@@ -0,0 +1,11 @@
+package com.myapp
+
+import android.app.Activity
+
+
+class MyActivity: Activity() {
+ val button = this.MyButton
+}
+// 1 GETSTATIC
+// 1 INVOKEVIRTUAL
+// 1 CHECKCAST
diff --git a/compiler/testData/codegen/androidPersistence/fqNameInAttr/res/layout/layout.xml b/compiler/testData/codegen/androidPersistence/fqNameInAttr/res/layout/layout.xml
new file mode 100644
index 00000000000..a0be11bdbef
--- /dev/null
+++ b/compiler/testData/codegen/androidPersistence/fqNameInAttr/res/layout/layout.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
diff --git a/compiler/testData/codegen/androidPersistence/fqNameInTag/fqNameInTag.kt b/compiler/testData/codegen/androidPersistence/fqNameInTag/fqNameInTag.kt
new file mode 100644
index 00000000000..fc01b17d59d
--- /dev/null
+++ b/compiler/testData/codegen/androidPersistence/fqNameInTag/fqNameInTag.kt
@@ -0,0 +1,12 @@
+package com.myapp
+
+import android.app.Activity
+
+
+class MyActivity: Activity() {
+ val button = this.MyButton
+}
+
+// 1 GETSTATIC
+// 1 INVOKEVIRTUAL
+// 1 CHECKCAST
diff --git a/compiler/testData/codegen/androidPersistence/fqNameInTag/res/layout/layout.xml b/compiler/testData/codegen/androidPersistence/fqNameInTag/res/layout/layout.xml
new file mode 100644
index 00000000000..0fb4a055ed2
--- /dev/null
+++ b/compiler/testData/codegen/androidPersistence/fqNameInTag/res/layout/layout.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/compiler/testData/codegen/androidPersistence/multiFile/multiFile.kt b/compiler/testData/codegen/androidPersistence/multiFile/multiFile.kt
new file mode 100644
index 00000000000..66e11e4ebdd
--- /dev/null
+++ b/compiler/testData/codegen/androidPersistence/multiFile/multiFile.kt
@@ -0,0 +1,13 @@
+package com.myapp
+
+import android.app.Activity
+
+
+class MyActivity: Activity() {
+ val button = this.login
+ val button1 = this.loginButton
+}
+
+// 2 GETSTATIC
+// 2 INVOKEVIRTUAL
+// 2 CHECKCAST
diff --git a/compiler/testData/codegen/androidPersistence/multiFile/res/layout/layout.xml b/compiler/testData/codegen/androidPersistence/multiFile/res/layout/layout.xml
new file mode 100644
index 00000000000..f4736f6937b
--- /dev/null
+++ b/compiler/testData/codegen/androidPersistence/multiFile/res/layout/layout.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/compiler/testData/codegen/androidPersistence/multiFile/res/layout/layout1.xml b/compiler/testData/codegen/androidPersistence/multiFile/res/layout/layout1.xml
new file mode 100644
index 00000000000..7c48f2b615c
--- /dev/null
+++ b/compiler/testData/codegen/androidPersistence/multiFile/res/layout/layout1.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/compiler/testData/codegen/androidPersistence/simple/res/layout/layout.xml b/compiler/testData/codegen/androidPersistence/simple/res/layout/layout.xml
new file mode 100644
index 00000000000..4d73173b521
--- /dev/null
+++ b/compiler/testData/codegen/androidPersistence/simple/res/layout/layout.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/compiler/testData/codegen/androidPersistence/simple/simple.kt b/compiler/testData/codegen/androidPersistence/simple/simple.kt
new file mode 100644
index 00000000000..2c75fa6f43f
--- /dev/null
+++ b/compiler/testData/codegen/androidPersistence/simple/simple.kt
@@ -0,0 +1,14 @@
+package com.myapp
+
+import android.app.Activity
+import android.os.Bundle
+import java.io.File
+
+
+public class MyActivity : Activity() {
+ {login}
+}
+
+// 1 GETSTATIC
+// 1 INVOKEVIRTUAL
+// 1 CHECKCAST
diff --git a/compiler/tests/org/jetbrains/jet/lang/resolve/android/AbstractAndroidBytecodePersistenceTest.kt b/compiler/tests/org/jetbrains/jet/lang/resolve/android/AbstractAndroidBytecodePersistenceTest.kt
new file mode 100644
index 00000000000..7cbc43805c5
--- /dev/null
+++ b/compiler/tests/org/jetbrains/jet/lang/resolve/android/AbstractAndroidBytecodePersistenceTest.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2010-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jetbrains.jet.lang.resolve.android
+
+import org.jetbrains.jet.codegen.AbstractBytecodeTextTest
+import org.jetbrains.jet.JetTestUtils
+import org.jetbrains.jet.ConfigurationKind
+import org.jetbrains.jet.TestJdkKind
+import org.jetbrains.jet.config.CompilerConfiguration
+import org.jetbrains.jet.cli.jvm.JVMConfigurationKeys
+import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment
+
+public abstract class AbstractAndroidBytecodePersistenceTest : AbstractBytecodeTextTest() {
+
+ private fun createAndroidAPIEnvironment(path: String) {
+ return createEnvironmentForConfiguration(JetTestUtils.compilerConfigurationForTests(ConfigurationKind.ALL, TestJdkKind.ANDROID_API), path)
+ }
+
+ private fun createFakeAndroidEnvironment(path: String) {
+ return createEnvironmentForConfiguration(JetTestUtils.compilerConfigurationForTests(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK), path)
+ }
+
+ private fun createEnvironmentForConfiguration(configuration: CompilerConfiguration, path: String) {
+ configuration.put(JVMConfigurationKeys.ANDROID_RES_PATH, path + "res/layout/");
+ configuration.put(JVMConfigurationKeys.ANDROID_MANIFEST, path + "../AndroidManifest.xml");
+ myEnvironment = JetCoreEnvironment.createForTests(getTestRootDisposable()!!, configuration);
+ }
+ public override fun doTest(path: String) {
+ val fileName = path + getTestName(true) + ".kt"
+ createAndroidAPIEnvironment(path)
+ loadFileByFullPath(fileName)
+ val expected = readExpectedOccurrences(fileName)
+ countAndCompareActualOccurrences(expected)
+ }
+}
diff --git a/compiler/tests/org/jetbrains/jet/lang/resolve/android/AndroidBytecodePersistenceTestGenerated.java b/compiler/tests/org/jetbrains/jet/lang/resolve/android/AndroidBytecodePersistenceTestGenerated.java
new file mode 100644
index 00000000000..d57b1ada3ef
--- /dev/null
+++ b/compiler/tests/org/jetbrains/jet/lang/resolve/android/AndroidBytecodePersistenceTestGenerated.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2010-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jetbrains.jet.lang.resolve.android;
+
+import com.intellij.testFramework.TestDataPath;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jetbrains.jet.JetTestUtils;
+import org.jetbrains.jet.test.InnerTestClasses;
+import org.jetbrains.jet.test.TestMetadata;
+
+import java.io.File;
+import java.util.regex.Pattern;
+
+/** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
+@SuppressWarnings("all")
+@TestMetadata("compiler/testData/codegen/androidPersistence")
+@TestDataPath("$PROJECT_ROOT")
+public class AndroidBytecodePersistenceTestGenerated extends AbstractAndroidBytecodePersistenceTest {
+ public void testAllFilesPresentInAndroidPersistence() throws Exception {
+ JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/androidPersistence"), Pattern.compile("^([^\\.]+)$"), false);
+ }
+
+ @TestMetadata("fqNameInAttr")
+ public void testFqNameInAttr() throws Exception {
+ String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/androidPersistence/fqNameInAttr/");
+ doTest(fileName);
+ }
+
+ @TestMetadata("fqNameInTag")
+ public void testFqNameInTag() throws Exception {
+ String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/androidPersistence/fqNameInTag/");
+ doTest(fileName);
+ }
+
+ @TestMetadata("multiFile")
+ public void testMultiFile() throws Exception {
+ String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/androidPersistence/multiFile/");
+ doTest(fileName);
+ }
+
+ @TestMetadata("simple")
+ public void testSimple() throws Exception {
+ String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/androidPersistence/simple/");
+ doTest(fileName);
+ }
+
+}
diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt
index 05108ae9585..708092d4698 100644
--- a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt
+++ b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt
@@ -150,6 +150,7 @@ import org.jetbrains.jet.android.AbstractAndroidGotoTest
import org.jetbrains.jet.jps.build.android.AbstractAndroidJpsTestCase
import org.jetbrains.jet.android.AbstractAndroidRenameTest
import org.jetbrains.jet.android.AbstractAndroidFindUsagesTest
+import org.jetbrains.jet.lang.resolve.android.AbstractAndroidBytecodePersistenceTest
fun main(args: Array) {
System.setProperty("java.awt.headless", "true")
@@ -331,6 +332,10 @@ fun main(args: Array) {
model("codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest")
model("codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke")
}
+
+ testClass(javaClass()) {
+ model("codegen/androidPersistence", recursive = false, extension = null)
+ }
}
testGroup("idea/tests", "idea/testData") {