diff --git a/idea/testData/kotlinAndJavaChecker/ClassObjects.java b/idea/testData/kotlinAndJavaChecker/ClassObjects.java new file mode 100644 index 00000000000..c09e6cf4c82 --- /dev/null +++ b/idea/testData/kotlinAndJavaChecker/ClassObjects.java @@ -0,0 +1,12 @@ +class ClassObject { + void foo() { + WithClassObject.object.$instance.getValue(); + WithClassObject.object.$instance.getValue(); + WithClassObject.object.$instance.foo(); + WithClassObject.object.$instance.getValueWithGetter(); + WithClassObject.object.$instance.getVariable(); + WithClassObject.object.$instance.setVariable(0); + WithClassObject.object.$instance.getVariableWithAccessors(); + WithClassObject.object.$instance.setVariableWithAccessors(0); + } +} \ No newline at end of file diff --git a/idea/testData/kotlinAndJavaChecker/ClassObjects.kt b/idea/testData/kotlinAndJavaChecker/ClassObjects.kt new file mode 100644 index 00000000000..eaa99622492 --- /dev/null +++ b/idea/testData/kotlinAndJavaChecker/ClassObjects.kt @@ -0,0 +1,15 @@ +class WithClassObject { + class object { + fun foo() {} + + val value: Int = 0 + val valueWithGetter: Int + get() = 1 + + var variable: Int = 0 + var variableWithAccessors: Int + get() = 0 + set(v) {} + + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/checkers/KotlinAndJavaCheckerTest.java b/idea/tests/org/jetbrains/jet/checkers/KotlinAndJavaCheckerTest.java new file mode 100644 index 00000000000..d5af09d3a28 --- /dev/null +++ b/idea/tests/org/jetbrains/jet/checkers/KotlinAndJavaCheckerTest.java @@ -0,0 +1,39 @@ +/* + * Copyright 2010-2013 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.checkers; + +import com.intellij.codeInsight.daemon.DaemonAnalyzerTestCase; +import com.intellij.openapi.projectRoots.Sdk; +import org.jetbrains.jet.JetTestCaseBuilder; +import org.jetbrains.jet.plugin.PluginTestCaseBase; + +public class KotlinAndJavaCheckerTest extends DaemonAnalyzerTestCase { + + @Override + protected Sdk getTestProjectJdk() { + return PluginTestCaseBase.jdkFromIdeaHome(); + } + + @Override + protected String getTestDataPath() { + return JetTestCaseBuilder.getHomeDirectory() + "/idea/testData/kotlinAndJavaChecker/"; + } + + public void testName() throws Exception { + doTest(false, false, "ClassObjects.java", "ClassObjects.kt"); + } +}